cfahlgren1's picture
download
raw
5.82 kB
import Mathlib
import OAI.Combinatorics.IndependentSets.Expansion.SpectralReturn
namespace OAI
noncomputable section
namespace IndependentSetsGames.Foundations.PCP.SpectralCut
open scoped BigOperators
open PoweringWalks SpectralReturn
section Indicators
variable {V : Type*} [Fintype V] [DecidableEq V]
def indicator (S : Finset V) (v : V) : ℝ := if v ∈ S then 1 else 0
theorem mean_indicator (S : Finset V) :
mean (indicator S) = (S.card : ℝ) / (Fintype.card V : ℝ) := by
have hf : Finset.univ.filter (fun v : V => v ∈ S) = S := by
ext v
simp
rw [mean_eq_sum_div_card]
simp only [indicator, Finset.sum_boole, hf]
theorem energy_indicator (S : Finset V) : energy (indicator S) = mean (indicator S) := by
unfold energy
congr 1
funext v
unfold indicator
split_ifs <;> norm_num
omit [Fintype V] in
theorem indicator_nonnegative (S : Finset V) (v : V) : 0 ≤ indicator S v := by
unfold indicator
split_ifs <;> norm_num
end Indicators
variable {V D : Type*} [Fintype V] [Fintype D] [DecidableEq V]
def cut (G : PortGraph V D) (S : Finset V) : Finset (V × D) :=
Finset.univ.filter (fun e => e.1 ∈ S ∧ (G.rot e).1 ∉ S)
section Nonempty
variable [Nonempty V] [Nonempty D] (G : PortGraph V D)
omit [Nonempty V] in
theorem cut_density_eq (S : Finset V) :
((cut G S).card : ℝ) / (Fintype.card (V × D) : ℝ) =
mean (indicator S) - correlation (indicator S) (averagingOperator G (indicator S)) := by
classical
calc
_ = mean (indicator (cut G S)) := (mean_indicator (cut G S)).symm
_ = mean (fun e : V × D => indicator S e.1 -
indicator S e.1 * indicator S (G.rot e).1) := by
congr 1
funext e
by_cases hv : e.1 ∈ S <;> by_cases hw : (G.rot e).1 ∈ S <;>
simp [indicator, cut, hv, hw]
_ = mean (fun v => mean (fun d : D => indicator S v -
indicator S v * indicator S (G.rot (v,d)).1)) := mean_prod _
_ = mean (fun v => indicator S v -
indicator S v * averagingOperator G (indicator S) v) := by
congr 1
funext v
rw [mean_sub, mean_const, mean_mul_left]
rfl
_ = _ := mean_sub _ _
theorem cut_density_ge_variance
(certificate : SpectralCertificate G (1/2)) (S : Finset V) :
(1/2:ℝ) * mean (indicator S) * (1 - mean (indicator S)) ≤
((cut G S).card : ℝ) / (Fintype.card (V × D) : ℝ) := by
let f := indicator S
have hz : mean (fun v => f v - mean f) = 0 := by
rw [mean_sub, mean_const, sub_self]
have he : energy (fun v => f v - mean f) = mean f - mean f ^ 2 := by
rw [energy_sub_const, energy_indicator]
ring
have hb := zero_mean_correlation_bound G (1/2) certificate
(fun v => f v - mean f) hz 1
have hc := correlation_centered G f 1
simp only [iterateOperator, pow_one, he] at hb hc
rw [cut_density_eq]
change (1/2:ℝ) * mean f * (1 - mean f) ≤
mean f - correlation f (averagingOperator G f)
nlinarith
theorem cut_density_ge_quarter
(certificate : SpectralCertificate G (1/2)) (S : Finset V)
(hsmall : 2 * S.card ≤ Fintype.card V) :
mean (indicator S) / 4 ≤
((cut G S).card : ℝ) / (Fintype.card (V × D) : ℝ) := by
have hN : (0:ℝ) < Fintype.card V := by exact_mod_cast Fintype.card_pos
have hp0 : 0 ≤ mean (indicator S) := mean_nonnegative _ (indicator_nonnegative S)
have hp : mean (indicator S) ≤ (1/2:ℝ) := by
rw [mean_indicator]
apply (div_le_iff₀ hN).mpr
have hs : (2:ℝ) * (S.card : ℝ) ≤ (Fintype.card V : ℝ) := by exact_mod_cast hsmall
nlinarith
have hv := cut_density_ge_variance G certificate S
have hprod := mul_nonneg hp0 (sub_nonneg.mpr hp)
nlinarith
theorem cut_card_ge_quarter_degree
(certificate : SpectralCertificate G (1/2)) (S : Finset V)
(hsmall : 2 * S.card ≤ Fintype.card V) :
(Fintype.card D : ℝ) * (S.card : ℝ) / 4 ≤ ((cut G S).card : ℝ) := by
have hN : (0:ℝ) < Fintype.card V := by exact_mod_cast Fintype.card_pos
have hD : (0:ℝ) < Fintype.card D := by exact_mod_cast Fintype.card_pos
have h := cut_density_ge_quarter G certificate S hsmall
rw [Fintype.card_prod, Nat.cast_mul] at h
have hh := (le_div_iff₀ (mul_pos hN hD)).mp h
have he : mean (indicator S) / 4 *
((Fintype.card V : ℝ) * (Fintype.card D : ℝ)) =
(Fintype.card D : ℝ) * (S.card : ℝ) / 4 := by
rw [mean_indicator]
field_simp [ne_of_gt hN]
rw [he] at hh
exact hh
theorem degree_mul_card_le_four_cut
(certificate : SpectralCertificate G (1/2)) (S : Finset V)
(hsmall : 2 * S.card ≤ Fintype.card V) :
Fintype.card D * S.card ≤ 4 * (cut G S).card := by
have h := cut_card_ge_quarter_degree G certificate S hsmall
have hr : (Fintype.card D : ℝ) * (S.card : ℝ) ≤ 4 * ((cut G S).card : ℝ) := by
linarith
exact_mod_cast hr
theorem cut_card_ge_quarter_degree_of_card_le_half
(certificate : SpectralCertificate G (1/2)) (S : Finset V)
(hsmall : S.card ≤ Fintype.card V / 2) :
(Fintype.card D : ℝ) * (S.card : ℝ) / 4 ≤ ((cut G S).card : ℝ) :=
cut_card_ge_quarter_degree G certificate S (by omega)
end Nonempty
theorem cut_card_ge_twice (G : PortGraph V D)
(certificate : SpectralCertificate G (1/2)) (hdegree : 8 ≤ Fintype.card D)
(S : Finset V) (hsmall : 2 * S.card ≤ Fintype.card V) :
2 * S.card ≤ (cut G S).card := by
let : Nonempty D := Fintype.card_pos_iff.mp (by omega)
rcases isEmpty_or_nonempty V with hV | hV
· let := hV
have hzero : Fintype.card V = 0 := Fintype.card_eq_zero
have hs : S.card = 0 := by omega
simp only [hs, mul_zero, Nat.zero_le]
· let := hV
have h := degree_mul_card_le_four_cut G certificate S hsmall
have hdeg := Nat.mul_le_mul_right S.card hdegree
omega
end IndependentSetsGames.Foundations.PCP.SpectralCut
end
end OAI

Xet Storage Details

Size:
5.82 kB
·
Xet hash:
0ab243e17f5d8f2d22b63a90fa5f7a504b01dbe0319d97bd397f332ff59bee88

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.