theoremwitness_bit_eq (G : PortGraphVD) (accepts : EdgeVD→A→A→Bool)
(n N : Nat) (selectors : ∀ v, AddressSelectorG (n + 1) v)
(labels : V→PaddedLabelD (n + 1) A) (fallback : A)
(w : WalkVD (n + 1)) (k : Fin (n + 1)) :
bit (witness G accepts n selectors labels fallback
(decoded G (n + 1) N selectors labels fallback) w k) =
vertexWitness G
(decodedBad G accepts (decoded G (n + 1) N selectors labels fallback))
(matchFn G (n + 1) N selectors labels fallback) n k w :=by
proof · 2
lines
simp only [witness, vertexWitness, endpointWitness, matchFn,
PoweringMoment.bit_mul, next, and_assoc]
theoremmodal_witness_mean (G : PortGraphVD) (M : Nat) (hM : 1≤M)
(accepts : EdgeV (Bool×D) →A→A→Bool)
(selectors : ∀ v, AddressSelector (lazyGraph G) (2 * center (Fintype.card A) M + 1) v)
(labels : V→PaddedLabel (Bool×D) (2 * center (Fintype.card A) M + 1) A)
(fallback : A) (k : Fin (2 * center (Fintype.card A) M + 1))
(hlo : center (Fintype.card A) M - M≤ k.val)
(hhi : k.val ≤ center (Fintype.card A) M + M) :
decodedError (lazyGraph G) accepts (2 * center (Fintype.card A) M)
(center (Fintype.card A) M) selectors labels fallback / (4 * (Fintype.card A : ℝ) ^ 2) ≤
mean (fun w => bit (witness (lazyGraph G) accepts (2 * center (Fintype.card A) M)
selectors labels fallback (decoded (lazyGraph G) (2 * center (Fintype.card A) M + 1)
(center (Fintype.card A) M) selectors labels fallback) w k)) :=by
proof · 12
lines
have h := lazy_middle_witness_mean G (Fintype.card A) MFintype.card_pos hM k hlo hhi
(decodedBad (lazyGraph G) accepts
(decoded (lazyGraph G) (2 * center (Fintype.card A) M + 1)
(center (Fintype.card A) M) selectors labels fallback))
(matchFn (lazyGraph G) (2 * center (Fintype.card A) M + 1)
(center (Fintype.card A) M) selectors labels fallback)
(matchFn_mem_Icc (lazyGraph G) (2 * center (Fintype.card A) M + 1)
(center (Fintype.card A) M) selectors labels fallback)
(decoded_modal_baseline (lazyGraph G) (2 * center (Fintype.card A) M + 1)
(center (Fintype.card A) M) selectors labels fallback)
simp_rw [witness_bit_eq]
convert h using1 <;> rfl
theoremrejection_lower_bound (G : PortGraphVD) (lambda : ℝ)
(certificate : SpectralCertificate (lazyGraph G) lambda)
(accepts : EdgeV (Bool×D) →A→A→Bool)
(reverse_accepts : ∀ e a b, accepts ((lazyGraph G).rot e) b a = accepts e a b)
(M : Nat) (hM : 1≤M)
(selectors : ∀ v, AddressSelector (lazyGraph G) (2 * center (Fintype.card A) M + 1) v)
(labels : V→PaddedLabel (Bool×D) (2 * center (Fintype.card A) M + 1) A)
(fallback : A)
(hε : 0 < decodedError (lazyGraph G) accepts (2 * center (Fintype.card A) M)
(center (Fintype.card A) M) selectors labels fallback) :
gain (Fintype.card A) M lambda *
min (decodedError (lazyGraph G) accepts (2 * center (Fintype.card A) M)
(center (Fintype.card A) M) selectors labels fallback)
(1 / ((2 * center (Fintype.card A) M + 1 : Nat) : ℝ)) ≤
poweredRejection (lazyGraph G) accepts (2 * center (Fintype.card A) M) selectors labels :=by
proof · 76
lines
let q :=Fintype.card AletN:= center q Mlet n :=2 * Nlet m :=2 * M + 1let start :=N - MletL:= lazyGraph Glet assignment := decoded L (n + 1) N selectors labels fallback
let bad := decodedBad L accepts assignment
let ε := edgeDensity bad
letα : ℝ:=1 / (2 * (q : ℝ))
letC : ℝ:=1 + 2 / (1 - lambda)
havehNM : M≤N:= le_center q MFintype.card_pos hM
havehw : start + m ≤ n + 1:=by dsimp [start, m, n]; omega
letE:= windowEvent L bad n start m hw
letW : Fin m →WalkV (Bool×D) (n + 1) →Prop:=fun i w =>
witness L accepts n selectors labels fallback assignment w (windowIndex n start m hw i)
letR : WalkV (Bool×D) (n + 1) →Prop:=fun w =>
pathAccepts L accepts n selectors w (labels w.1) (labels (endpoint L w)) = falsehavehWE : ∀ i w, W i w →E i w :=by
intro i w h
exact h.1havehWR : ∀ i w, W i w →R w :=by
intro i w h
exact witness_implies_path_rejection L accepts n selectors labels fallback assignment w
(windowIndex n start m hw i) h
have hpoint (i : Fin m) : ε / (4 * (q : ℝ) ^ 2) ≤ mean (fun w => bit (W i w)) :=byhavehlo : N - M≤ (windowIndex n start m hw i).val :=by
dsimp [windowIndex, start]
omega
havehhi : (windowIndex n start m hw i).val ≤N + M:=byhave hi := i.isLt
dsimp [windowIndex, start]
dsimp [m] at hi
omega
exact modal_witness_mean GM hM accepts selectors labels fallback
(windowIndex n start m hw i) hlo hhi
havehfirst : α ^ 2 * (m : ℝ) * ε ≤ mean (hits W) :=by
change α ^ 2 * (m : ℝ) * ε ≤PoweringMoment.mean (hits W)
rw [PoweringMoment.mean_hits]
calc
_ = ∑_i : Fin m, ε / (4 * (q : ℝ) ^ 2) :=by
simp only [Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul]
dsimp [α]
ring
_ ≤ _ :=Finset.sum_le_sum (fun i _ => hpoint i)
havehsecond : mean (fun w => hits E w ^ 2) ≤
(m : ℝ) * ε * (C + ((m : ℝ) - 1) * ε) :=
window_second_moment_le L lambda certificate bad
(decodedBad_rot L accepts reverse_accepts assignment) n start m hw
havehε' : 0 < ε := hε
havehm : 0 < m :=by dsimp [m]; omega
havehmReal : (0 : ℝ) < m :=Nat.cast_pos.mpr hm
havehqReal : (0 : ℝ) < q :=Nat.cast_pos.mpr Fintype.card_pos
havehden : 0 < 1 - lambda := sub_pos.mpr certificate.lt_one
havehC : 0 < C:=by dsimp [C]; positivity
havehmOne : (1 : ℝ) ≤ m :=by exact_mod_cast hm
havehα : 0 < α :=by dsimp [α]; positivity
haveha : 0 < α ^ 2 * (m : ℝ) * ε :=by positivity
havehb : 0 < (m : ℝ) * ε * (C + ((m : ℝ) - 1) * ε) :=byhavehdiff : 0≤ (m : ℝ) - 1:= sub_nonneg.mpr hmOne
positivity
have hCS :=PoweringMoment.rejection_lower_bound EWR hWE hWR
(α ^ 2 * (m : ℝ) * ε) ((m : ℝ) * ε * (C + ((m : ℝ) - 1) * ε))
ha hb hfirst hsecond
haveht : (0 : ℝ) < ((n + 1 : Nat) : ℝ) :=Nat.cast_pos.mpr (Nat.succ_pos n)
havehmn : m ≤ n + 1:=by dsimp [m, n]; omega
havehmt : (m : ℝ) - 1≤ ((n + 1 : Nat) : ℝ) :=byhavehmnReal : (m : ℝ) ≤ ((n + 1 : Nat) : ℝ) :=by exact_mod_cast hmn
linarith
have hratio :=PoweringNumeric.count_moment_ratio_lower α ε C ((n + 1 : Nat) : ℝ)
m hm hε' hC ht hmt
change (α ^ 4 * (m : ℝ) / (C + 1)) * min ε (1 / ((n + 1 : Nat) : ℝ)) ≤ _
change _ ≤ mean (fund : DartV (Bool×D) n =>
bit ((poweredGraph L accepts n selectors).edgeSatisfied labels d = false))
rw [rejection_mean_eq_path_mean]
exact hratio.trans hCS