math / data /lean /OAI /Probability /CoordinateSweeps /SparseMoment.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
21.1 kB
import Mathlib
import OAI.Probability.CoordinateSweeps.TrajectoryMoment
import OAI.Combinatorics.Graphs.Coverage
import OAI.RepresentationTheory.Placement.Occurrence
namespace OAI
noncomputable section
open scoped BigOperators Matrix.Norms.L2Operator ComplexOrder
attribute [local instance] Classical.propDecidable
noncomputable section
open scoped BigOperators
attribute [local instance] Classical.propDecidable
noncomputable section
open scoped BigOperators
open MvPolynomial
noncomputable section
open MeasureTheory ProbabilityTheory Real Set Filter
open scoped ENNReal NNReal BigOperators
noncomputable section
open scoped BigOperators
namespace CoordinateSweeps.Grid.Holes
variable {G : Grid} {h k : β„•}
open Coverage
def holeHeavy (H : G.Holes h) (Ξ· : ℝ) (j : Fin G.b) : Finset (G.Line j) :=
heavySet (H.lineCount j) ((2^G.bits j : β„•)*Ξ·/2)
def particleHeavy (p : Fin k β†’ G.Slot Γ— G.Slot) (Ξ· : ℝ) (j : Fin G.b) : Finset (G.Line j) :=
heavySet (occupancy (fun a : G.Slot Γ— G.Slot => G.pathLine a.1 a.2 j) p)
((2^G.bits j : β„•)*Ξ·/2)
def holeHeavyHits (H : G.Holes h) (p : Fin k β†’ G.Slot Γ— G.Slot) (Ξ· : ℝ) (j : Fin G.b) : Finset (Fin k) :=
Finset.univ.filter (fun i => G.pathLine (p i).1 (p i).2 j ∈ H.holeHeavy η j)
def particleHeavyHits (p : Fin k β†’ G.Slot Γ— G.Slot) (Ξ· : ℝ) (j : Fin G.b) : Finset (Fin k) :=
Finset.univ.filter (fun i => G.pathLine (p i).1 (p i).2 j ∈ particleHeavy p η j)
theorem probability_holeHeavy_single (H : G.Holes h) {Ξ· : ℝ} (hΞ· : 0 < Ξ·) (j : Fin G.b) :
(βˆ‘ p : G.Slot Γ— G.Slot, if G.pathLine p.1 p.2 j ∈ H.holeHeavy Ξ· j then G.endpointWeight p else 0) ≀
2*h/((G.size : ℝ)*Ξ·) := by
have hs : 0 < (G.size : ℝ) := by unfold Grid.size; positivity
have hm : 0 < ((2^G.bits j : β„•) : ℝ) := by positivity
have ht : βˆ‘ l, (H.lineCount j l : ℝ) = h := by exact_mod_cast H.sum_lineCount j
have hc := heavySet_card_mul_le (H.lineCount j) (((2^G.bits j : β„•) : ℝ)*Ξ·/2)
rw [ht] at hc
have hline : βˆ€ l : G.Line j,
(βˆ‘ p : G.Slot Γ— G.Slot, if G.pathLine p.1 p.2 j = l then G.endpointWeight p else 0) ≀
((2^G.bits j : β„•) : ℝ)/G.size := by
intro l
exact le_of_eq (by simpa using G.probability_path_line j l)
apply (probability_lineSet_le G.endpointWeight (fun p : G.Slot Γ— G.Slot => G.pathLine p.1 p.2 j)
(H.holeHeavy Ξ· j) (((2^G.bits j : β„•) : ℝ)/G.size) hline).trans
change ((heavySet (H.lineCount j) _).card : ℝ) * _ ≀ _
apply (le_div_iffβ‚€ (mul_pos hs hΞ·)).mpr
field_simp at ⊒
nlinarith
theorem probability_holeHeavyHits_le (H : G.Holes h) {Ξ· : ℝ} (hΞ· : 0 < Ξ·)
(hp : 2*h/((G.size : ℝ)*Ξ·) ≀ 1) (j : Fin G.b) (u : ℝ) (hu : 0 ≀ u) :
Coverage.probability G.endpointWeight (fun p : Fin k β†’ G.Slot Γ— G.Slot =>
u ≀ ((H.holeHeavyHits p Ξ· j).card : ℝ)) ≀
(2 : ℝ)^k * (2*h/((G.size : ℝ)*Ξ·))^u := by
convert (probability_many_hits_le_rpow (I := Fin k) G.endpointWeight G.endpointWeight_nonneg
G.endpointWeight_total (fun p : G.Slot Γ— G.Slot => G.pathLine p.1 p.2 j ∈ H.holeHeavy Ξ· j)
_ (by positivity) hp (by convert H.probability_holeHeavy_single hΞ· j using 1; congr!) u hu) using 1 <;>
simp only [holeHeavyHits, Fintype.card_fin]
congr!
theorem probability_particleHeavyHits_le {Ξ· : ℝ} (hΞ· : 0 < Ξ·)
(hp : 2*k/((G.size : ℝ)*Ξ·) ≀ 1) (j : Fin G.b) (u : ℝ) (hu : 0 ≀ u) :
Coverage.probability G.endpointWeight (fun p : Fin k β†’ G.Slot Γ— G.Slot =>
u ≀ ((particleHeavyHits p Ξ· j).card : ℝ)) ≀
((Fintype.card (G.Line j)+1 : β„•) : ℝ)^⌊2*k/(((2^G.bits j : β„•) : ℝ)*Ξ·)βŒ‹β‚Š *
(2 : ℝ)^k * (2*k/((G.size : ℝ)*Ξ·))^u := by
have hs : 0 < (G.size : ℝ) := by unfold Grid.size; positivity
have hm : 0 < ((2^G.bits j : β„•) : ℝ) := by positivity
have hv : 0 < ((2^G.bits j : β„•) : ℝ)*Ξ·/2 := by positivity
have he : (k : ℝ)/(((2^G.bits j : β„•) : ℝ)*Ξ·/2) = 2*k/(((2^G.bits j : β„•) : ℝ)*Ξ·) := by ring
have hf : (⌊(k : ℝ)/(((2^G.bits j : β„•) : ℝ)*Ξ·/2)βŒ‹β‚Š : ℝ)*
(((2^G.bits j : β„•) : ℝ)/G.size) ≀ 2*k/((G.size : ℝ)*Ξ·) := by
apply le_trans (mul_le_mul_of_nonneg_right (Nat.floor_le (by positivity)) (by positivity))
apply le_of_eq
field_simp
have hb := probability_heavy_occupancy_le (I := Fin k)
G.endpointWeight G.endpointWeight_nonneg G.endpointWeight_total
(fun p : G.Slot Γ— G.Slot => G.pathLine p.1 p.2 j) hv
(2*k/((G.size : ℝ)*Ξ·)) (((2^G.bits j : β„•) : ℝ)/G.size)
(by positivity) (by positivity) hp
(fun l => le_of_eq (by simpa using G.probability_path_line j l))
(by simpa using hf) u hu
convert hb using 1 <;>
simp only [particleHeavyHits, particleHeavy, Fintype.card_fin, he]
congr!
theorem not_vertexIsolated_iff (H : G.Holes h) (hH : H.Feasible)
(p : Fin k β†’ G.Slot Γ— G.Slot) (i : Fin k) :
Β¬ H.VertexIsolated (fun i => (p i).1) (fun i => (p i).2) i ↔
i ∈ sharingCoverage G.vertexShares H.endpointData p := by
simp only [VertexIsolated, sharingCoverage, mem_covered, Grid.vertexShares]
constructor
Β· intro hi
by_cases ha : βˆ€ a s, G.pathBetween (p i).1 (p i).2 s β‰  H.path a s
Β· have hj : Β¬ βˆ€ j, i β‰  j β†’ βˆ€ s, G.pathBetween (p i).1 (p i).2 s β‰  G.pathBetween (p j).1 (p j).2 s := fun h => hi ⟨ha,h⟩
push Not at hj
obtain ⟨j,hij,t,hjt⟩ := hj
exact Or.inl ⟨j,hij,t,hjt⟩
Β· push Not at ha
obtain ⟨a,t,hat⟩ := ha
exact Or.inr ⟨a,t,hat.trans (H.path_eq_pathBetween hH a t)⟩
· rintro (⟨j,hij,t,he⟩ | ⟨a,t,he⟩) hv
Β· exact hv.2 j hij t he
Β· exact hv.1 a t (he.trans (H.path_eq_pathBetween hH a t).symm)
end CoordinateSweeps.Grid.Holes
namespace CoordinateSweeps.Grid.Holes
variable {G : Grid} {h k : β„•}
open Coverage
theorem not_good_cover (H : G.Holes h) (hH : H.Feasible)
(p : Fin k β†’ G.Slot Γ— G.Slot) (Ξ· : ℝ) (i : Fin k)
(hi : i βˆ‰ H.goodSet (fun i => (p i).1) (fun i => (p i).2) Ξ·) :
i ∈ sharingCoverage G.vertexShares H.endpointData p ∨
βˆƒ j, i ∈ H.holeHeavyHits p Ξ· j ∨ i ∈ particleHeavyHits p Ξ· j := by
have hn : Β¬ H.Good (fun i => (p i).1) (fun i => (p i).2) Ξ· i := by simpa using hi
by_cases hv : H.VertexIsolated (fun i => (p i).1) (fun i => (p i).2) i
Β· right
have hj : Β¬ βˆ€ j, H.Light (fun i => (p i).1) (fun i => (p i).2) Ξ·
(G.stagePath (fun i => (p i).1) (fun i => (p i).2) i j) := fun ht => hn ⟨hv,ht⟩
push Not at hj
obtain ⟨j,hj⟩ := hj
refine ⟨j,?_⟩
simp only [Light, Grid.stagePath, Nat.cast_add, not_le] at hj
simp only [holeHeavyHits, particleHeavyHits, holeHeavy, particleHeavy,
heavySet, Finset.mem_filter, Finset.mem_univ, true_and]
change ((2^G.bits j : β„•) : ℝ)*Ξ·/2 < (H.lineCount j (G.pathLine (p i).1 (p i).2 j) : ℝ) ∨
((2^G.bits j : β„•) : ℝ)*Ξ·/2 < (auxCount (fun i => (p i).1) (fun i => (p i).2)
Finset.univ j (G.pathLine (p i).1 (p i).2 j) : ℝ)
by_contra hc
push Not at hc
linarith
Β· exact Or.inl ((H.not_vertexIsolated_iff hH p i).mp hv)
theorem card_covered_by_good_and_bad (H : G.Holes h) (hH : H.Feasible)
(p : Fin k β†’ G.Slot Γ— G.Slot) (Ξ· : ℝ) :
k ≀ (H.goodSet (fun i => (p i).1) (fun i => (p i).2) Ξ·).card +
(sharingCoverage G.vertexShares H.endpointData p).card +
βˆ‘ j, ((H.holeHeavyHits p Ξ· j).card + (particleHeavyHits p Ξ· j).card) := by
let A := H.goodSet (fun i => (p i).1) (fun i => (p i).2) Ξ·
let V := sharingCoverage G.vertexShares H.endpointData p
let B := (Finset.univ : Finset (Fin G.b)).biUnion
(fun j => H.holeHeavyHits p Ξ· j βˆͺ particleHeavyHits p Ξ· j)
have hc : (Finset.univ : Finset (Fin k)) βŠ† (A βˆͺ V) βˆͺ B := by
intro i _
by_cases hi : i ∈ A
Β· exact Finset.mem_union_left _ (Finset.mem_union_left _ hi)
· rcases H.not_good_cover hH p η i hi with hv | ⟨j,hj⟩
Β· exact Finset.mem_union_left _ (Finset.mem_union_right _ hv)
Β· exact Finset.mem_union_right _ (Finset.mem_biUnion.mpr
⟨j,Finset.mem_univ _, Finset.mem_union.mpr hj⟩)
calc
k = (Finset.univ : Finset (Fin k)).card := by simp
_ ≀ ((A βˆͺ V) βˆͺ B).card := Finset.card_le_card hc
_ ≀ (A βˆͺ V).card + B.card := Finset.card_union_le _ _
_ ≀ (A.card+V.card) + B.card := Nat.add_le_add_right (Finset.card_union_le _ _) _
_ ≀ (A.card+V.card) + βˆ‘ j, ((H.holeHeavyHits p Ξ· j).card + (particleHeavyHits p Ξ· j).card) := by
apply Nat.add_le_add_left
apply (Finset.card_biUnion_le).trans
exact Finset.sum_le_sum (fun j _ => Finset.card_union_le _ _)
theorem fewGood_cover (H : G.Holes h) (hH : H.Feasible)
(p : Fin k β†’ G.Slot Γ— G.Slot) (Ξ· : ℝ)
(he : ((H.goodSet (fun i => (p i).1) (fun i => (p i).2) Ξ·).card : ℝ) < k/2) :
(k : ℝ)/4 ≀ ((sharingCoverage G.vertexShares H.endpointData p).card : ℝ) ∨
βˆƒ j, (k : ℝ)/(8*G.b) ≀ ((H.holeHeavyHits p Ξ· j).card : ℝ) ∨
(k : ℝ)/(8*G.b) ≀ ((particleHeavyHits p Ξ· j).card : ℝ) := by
have hb : 0 < (G.b : ℝ) := by exact_mod_cast G.positive
by_contra hf
push Not at hf
have hc : (k : ℝ) ≀ (H.goodSet (fun i => (p i).1) (fun i => (p i).2) Ξ·).card +
(sharingCoverage G.vertexShares H.endpointData p).card +
βˆ‘ j, (((H.holeHeavyHits p Ξ· j).card : ℝ) + (particleHeavyHits p Ξ· j).card) := by
exact_mod_cast H.card_covered_by_good_and_bad hH p Ξ·
have hsum : (βˆ‘ j, (((H.holeHeavyHits p Ξ· j).card : ℝ) + (particleHeavyHits p Ξ· j).card)) ≀
(G.b : ℝ)*((k : ℝ)/(4*G.b)) := by
calc
_ ≀ βˆ‘ _j : Fin G.b, (k : ℝ)/(4*G.b) := by
apply Finset.sum_le_sum
intro j _
have h1 := (hf.2 j).1
have h2 := (hf.2 j).2
have hid : (k : ℝ)/(4*G.b) = 2*((k : ℝ)/(8*G.b)) := by ring
rw [hid]
linarith
_ = _ := by simp
have hid : (G.b : ℝ)*((k : ℝ)/(4*G.b)) = k/4 := by field_simp
rw [hid] at hsum
linarith [hf.1]
/- Source04:eq12 prior to choosing absolute parameters and absorbing
subpolynomial factors. There is no conditioning on a particle-selected line set. -/
theorem probability_fewGood_le (H : G.Holes h) (hH : H.Feasible) {Ξ· : ℝ} (hΞ· : 0 < Ξ·)
(hh : 2*h/((G.size : ℝ)*Ξ·) ≀ 1) (hk : 2*k/((G.size : ℝ)*Ξ·) ≀ 1)
(hv : ((k+h : β„•) : ℝ)*G.vertexSharingRate ≀ 1) :
Coverage.probability G.endpointWeight (fun p : Fin k β†’ G.Slot Γ— G.Slot =>
((H.goodSet (fun i => (p i).1) (fun i => (p i).2) Ξ·).card : ℝ) < k/2) ≀
(2 : ℝ)^k * (((k+h : β„•) : ℝ)*G.vertexSharingRate)^((k : ℝ)/8) +
βˆ‘ j : Fin G.b, ((2 : ℝ)^k * (2*h/((G.size : ℝ)*Ξ·))^((k : ℝ)/(8*G.b)) +
((Fintype.card (G.Line j)+1 : β„•) : ℝ)^⌊2*k/(((2^G.bits j : β„•) : ℝ)*Ξ·)βŒ‹β‚Š *
(2 : ℝ)^k * (2*k/((G.size : ℝ)*Ξ·))^((k : ℝ)/(8*G.b))) := by
let V := fun p : Fin k β†’ G.Slot Γ— G.Slot =>
(k : ℝ)/4 ≀ ((sharingCoverage G.vertexShares H.endpointData p).card : ℝ)
let B := fun (j : Fin G.b) (p : Fin k β†’ G.Slot Γ— G.Slot) =>
(k : ℝ)/(8*G.b) ≀ ((H.holeHeavyHits p Ξ· j).card : ℝ) ∨
(k : ℝ)/(8*G.b) ≀ ((particleHeavyHits p Ξ· j).card : ℝ)
have hu := probability_coverage_le_real (I := Fin k) G.vertexShares G.vertexShares_symm
H.endpointData G.endpointWeight G.endpointWeight_nonneg G.endpointWeight_total
G.vertexSharingRate G.vertexSharingRate_nonneg G.probability_vertexShares_le
(by simpa using hv) ((k : ℝ)/4) (by positivity)
have hV : Coverage.probability G.endpointWeight V ≀
(2 : ℝ)^k * (((k+h : β„•) : ℝ)*G.vertexSharingRate)^((k : ℝ)/8) := by
simpa only [V, Fintype.card_fin, div_div, show (4:ℝ)*2=8 by norm_num] using hu
have hB (j : Fin G.b) : Coverage.probability G.endpointWeight (B j) ≀
(2 : ℝ)^k * (2*h/((G.size : ℝ)*Ξ·))^((k : ℝ)/(8*G.b)) +
((Fintype.card (G.Line j)+1 : β„•) : ℝ)^⌊2*k/(((2^G.bits j : β„•) : ℝ)*Ξ·)βŒ‹β‚Š *
(2 : ℝ)^k * (2*k/((G.size : ℝ)*Ξ·))^((k : ℝ)/(8*G.b)) := by
apply (probability_or_le G.endpointWeight G.endpointWeight_nonneg _ _).trans
exact add_le_add (H.probability_holeHeavyHits_le hΞ· hh j _ (by positivity))
(probability_particleHeavyHits_le hΞ· hk j _ (by positivity))
calc
_ ≀ Coverage.probability G.endpointWeight (fun p => V p ∨ βˆƒ j, B j p) :=
probability_mono G.endpointWeight G.endpointWeight_nonneg (fun p hp => H.fewGood_cover hH p Ξ· hp)
_ ≀ Coverage.probability G.endpointWeight V +
Coverage.probability G.endpointWeight (fun p => βˆƒ j, B j p) :=
probability_or_le G.endpointWeight G.endpointWeight_nonneg _ _
_ ≀ Coverage.probability G.endpointWeight V +
βˆ‘ j, Coverage.probability G.endpointWeight (B j) :=
add_le_add le_rfl (probability_exists_le G.endpointWeight G.endpointWeight_nonneg B)
_ ≀ _ := add_le_add hV (Finset.sum_le_sum (fun j _ => hB j))
end CoordinateSweeps.Grid.Holes
namespace CoordinateSweeps.Grid.Holes
variable {G : Grid} {h k : β„•}
/- An explicit absolute prefactor used before asymptotic absorption. -/
def uniformSparsePrefactor (G : Grid) (h k : β„•) : ℝ :=
(2 : ℝ)^k * Real.exp ((G.b : ℝ)*(h+k)+Real.log 4*k*G.b) *
(16*Real.exp 2)^(G.b*k) * (1+16*Real.exp 2)^(G.b*k)
/- The source's good/bad entry split, in counting HS normalization. -/
theorem placementHSsq_uniform_le_fewGood (H : G.Holes h) {Ξ· : ℝ}
(hΞ· : 0 ≀ Ξ·) (hΞ·small : Ξ· ≀ 1/8) :
H.placementHSsq (k := k) (fun _ => FiniteLaw.uniform _) ≀
(uniformSparsePrefactor G h k)^2 *
(Ξ·^((k : ℝ)/2) + Coverage.probability G.endpointWeight
(fun p : Fin k β†’ G.Slot Γ— G.Slot =>
((H.goodSet (fun i => (p i).1) (fun i => (p i).2) Ξ·).card : ℝ) < k/2)) := by
let M := uniformSparsePrefactor G h k
let Bad := fun p : Fin k β†’ G.Slot Γ— G.Slot =>
((H.goodSet (fun i => (p i).1) (fun i => (p i).2) Ξ·).card : ℝ) < k/2
have hM : 0 ≀ M := by dsimp [M, uniformSparsePrefactor]; positivity
have hΞ·1 : Ξ· ≀ 1 := by linarith
have hsum : βˆ‘ p : Fin k β†’ G.Slot Γ— G.Slot, Coverage.productMass G.endpointWeight p = 1 := by
unfold Coverage.productMass
rw [← Fintype.prod_sum]
simp only [G.endpointWeight_total, Finset.prod_const_one]
rw [H.placementHSsq_eq_full]
calc
_ ≀ βˆ‘ p : Fin k β†’ G.Slot Γ— G.Slot,
Coverage.productMass G.endpointWeight p * (M^2 *
(Ξ·^((k : ℝ)/2) + if Bad p then 1 else 0)) := by
apply Finset.sum_le_sum
intro p _
apply mul_le_mul_of_nonneg_left _
(Coverage.productMass_nonneg G.endpointWeight G.endpointWeight_nonneg p)
by_cases hp : H.ValidInput (fun i => (p i).1) ∧ H.ValidOutput (fun i => (p i).2)
Β· rw [ite_eq_left hp]
have he := H.scaled_placementKernel_good_bound (fun i => (p i).1) (fun i => (p i).2)
hp.1 hΞ· hΞ·small
change |(G.size : ℝ)^k * H.placementKernel _ _ _| ≀ M *
Ξ·^(((H.goodSet (fun i => (p i).1) (fun i => (p i).2) Ξ·).card : ℝ)/2) at he
have hpow : Ξ·^(((H.goodSet (fun i => (p i).1) (fun i => (p i).2) Ξ·).card : ℝ)/2) ≀ 1 :=
Real.rpow_le_one hΞ· hΞ·1 (by positivity)
by_cases hb : Bad p
Β· rw [ite_eq_left hb]
have hf : |(G.size : ℝ)^k * H.placementKernel _ _ _| ≀ M :=
he.trans (mul_le_of_le_one_right hM hpow)
have hsq := (sq_le_sqβ‚€ (abs_nonneg _) hM).mpr hf
rw [sq_abs] at hsq
have he0 := Real.rpow_nonneg hΞ· ((k : ℝ)/2)
nlinarith [sq_nonneg M]
Β· rw [ite_eq_right hb, add_zero]
have hc : (k : ℝ)/4 ≀ ((H.goodSet (fun i => (p i).1) (fun i => (p i).2) Ξ·).card : ℝ)/2 := by
dsimp [Bad] at hb
linarith
have hmono := Real.rpow_le_rpow_of_exponent_ge' hΞ· hΞ·1 (by positivity) hc
have hf := he.trans (mul_le_mul_of_nonneg_left hmono hM)
have hsq := (sq_le_sqβ‚€ (abs_nonneg _) (mul_nonneg hM (Real.rpow_nonneg hΞ· _))).mpr hf
simp only [sq_abs, mul_pow] at hsq
have hid : (Ξ·^((k : ℝ)/4))^2 = Ξ·^((k : ℝ)/2) := by
rw [← Real.rpow_natCast, ← Real.rpow_mul hΞ·]
congr 1
ring
simpa only [mul_pow, hid] using hsq
Β· rw [ite_eq_right hp]
positivity
_ = _ := by
simp only [mul_add, Finset.sum_add_distrib]
rw [← Finset.sum_mul, hsum, one_mul]
rw [Coverage.probability, Finset.mul_sum]
congr 1
apply Finset.sum_congr rfl
intro p _
split_ifs <;> ring
end CoordinateSweeps.Grid.Holes
/- Required top-placement compression for the conditional main. The top space
is the annihilator of all functions depending on a proper set of coordinates.
This is the exact top level used in source04 around eq7. -/
noncomputable section
open scoped BigOperators Matrix.Norms.L2Operator
attribute [local instance] Classical.propDecidable
namespace CoordinateSweeps.Grid.Holes
variable {G : Grid} {h k : β„•}
abbrev InputPlacements (H : G.Holes h) (k : β„•) := {x : Fin k β†’ G.Slot // H.ValidInput x}
abbrev OutputPlacements (H : G.Holes h) (k : β„•) := {y : Fin k β†’ G.Slot // H.ValidOutput y}
def placementTop (H : G.Holes h) (k : β„•) : Submodule β„‚ (H.OutputPlacements k β†’ β„‚) :=
Placement.topSpace (fun y : H.OutputPlacements k => y.val)
def transitionMatrix (H : G.Holes h)
(ΞΌ : βˆ€ j, FiniteLaw (Equiv.Perm (Cube (G.bits j)))) :
Matrix (H.InputPlacements k) (H.OutputPlacements k) β„‚ :=
fun x y => (H.extraProbability x.val y.val Finset.univ ΞΌ : β„‚)
theorem extraProbability_dependsOn (H : G.Holes h)
(ΞΌ : βˆ€ j, FiniteLaw (Equiv.Perm (Cube (G.bits j)))) (A : Finset (Fin k))
(x : H.InputPlacements k) :
Placement.DependsOn (fun y : H.OutputPlacements k => y.val) A
(fun y => (H.extraProbability x.val y.val A ΞΌ : β„‚)) := by
intro y y' hy
apply congrArg Complex.ofReal
rw [H.extraProbability_eq_conditionalEndpoint, H.extraProbability_eq_conditionalEndpoint]
have he (Ο‰ : G.Choices) : G.endpointEvent x.val y.val A Ο‰ ↔ G.endpointEvent x.val y'.val A Ο‰ := by
constructor <;> intro hw i hi
Β· exact (hw i hi).trans (hy i hi)
Β· exact (hw i hi).trans (hy i hi).symm
simp only [conditionalEndpointProbability, he]
theorem alternatingKernel_eq_placementKernel (H : G.Holes h)
(ΞΌ : βˆ€ j, FiniteLaw (Equiv.Perm (Cube (G.bits j))))
(x : H.InputPlacements k) (y : H.OutputPlacements k) :
Placement.alternatingKernel (G.size : ℝ)
(fun A (x : H.InputPlacements k) (y : H.OutputPlacements k) => H.extraProbability x.val y.val A ΞΌ)
x y = (H.placementKernel x.val y.val ΞΌ : β„‚) := by
simp only [Placement.alternatingKernel, placementKernel, Fintype.card_fin]
theorem placementHSsq_eq_subtype (H : G.Holes h)
(ΞΌ : βˆ€ j, FiniteLaw (Equiv.Perm (Cube (G.bits j)))) :
H.placementHSsq (k := k) ΞΌ =
βˆ‘ x : H.InputPlacements k, βˆ‘ y : H.OutputPlacements k,
β€–(H.placementKernel x.val y.val ΞΌ : β„‚)β€–^2 := by
simp only [Complex.norm_real, Real.norm_eq_abs, sq_abs]
unfold placementHSsq
symm
rw [sum_subtype_eq_sum_ite_of_iff (p := H.ValidInput) (q := H.ValidInput)
(fun x : Fin k β†’ G.Slot => Iff.rfl)
(fun x => βˆ‘ y : H.OutputPlacements k, H.placementKernel x y.val ΞΌ ^ 2)]
apply Finset.sum_congr rfl
intro x _
split_ifs with hx
Β· rw [sum_subtype_eq_sum_ite_of_iff (p := H.ValidOutput) (q := H.ValidOutput)
(fun y : Fin k β†’ G.Slot => Iff.rfl) (fun y => H.placementKernel x y ΞΌ ^ 2)]
apply Finset.sum_congr rfl
intro y _
simp only [hx, true_and]
Β· apply Eq.symm
simp only [hx, false_and, ite_false, Finset.sum_const_zero]
/- Exact top-placement restriction of the ACTUAL conditioned sweep, bounded
by the already proved path-weight Q counting norm. No representation-theoretic
conclusion is inserted as a hypothesis. -/
theorem transitionMatrix_top_norm_le (H : G.Holes h)
(ΞΌ : βˆ€ j, FiniteLaw (Equiv.Perm (Cube (G.bits j))))
(v : EuclideanSpace β„‚ (H.OutputPlacements k))
(hv : (fun y => v y) ∈ H.placementTop k) :
β€–(EuclideanSpace.equiv (H.InputPlacements k) β„‚).symm ((H.transitionMatrix ΞΌ).mulVec v)β€– ≀
Real.sqrt (H.placementHSsq (k := k) ΞΌ) * β€–vβ€– := by
have hs : (G.size : ℝ) β‰  0 := by unfold Grid.size; positivity
have hh := Placement.fullKernel_top_norm_le (fun y : H.OutputPlacements k => y.val)
(G.size : ℝ) hs
(fun A (x : H.InputPlacements k) (y : H.OutputPlacements k) => H.extraProbability x.val y.val A ΞΌ)
(H.extraProbability_dependsOn ΞΌ) v hv
change β€–(EuclideanSpace.equiv (H.InputPlacements k) β„‚).symm
(Matrix.mulVec (fun x y => (H.extraProbability x.val y.val Finset.univ ΞΌ : β„‚)) v)β€– ≀ _
simpa only [H.alternatingKernel_eq_placementKernel, ← H.placementHSsq_eq_subtype] using hh
end CoordinateSweeps.Grid.Holes
end
end
end
end
end
end
open scoped Matrix.Norms.L2Operator
end OAI