Download data/lean/OAI/Probability/CoordinateSweeps/SparseDimension.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 36.6 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/CoordinateSweeps/SparseDimension.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Probability/CoordinateSweeps/SparseDimension.lean
-
curl -L -o SparseDimension.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/CoordinateSweeps/SparseDimension.lean
36.6 kB
| import Mathlib | |
| import OAI.RepresentationTheory.Placement.Occurrence | |
| import OAI.Probability.CoordinateSweeps.SparseMoment | |
| 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 | |
| noncomputable section | |
| open scoped BigOperators Matrix.Norms.L2Operator | |
| attribute [local instance] Classical.propDecidable | |
| noncomputable section | |
| universe u v | |
| open scoped ComplexConjugate | |
| noncomputable section | |
| open scoped BigOperators | |
| open scoped Matrix.Norms.L2Operator | |
| namespace CoordinateSweeps.Grid.Holes | |
| open PlacementOccurrence Placement | |
| variable {G : Grid} {h k : β} (H : G.Holes h) | |
| def inputPlacementEquiv : (Fin k βͺ H.FreeAt 0) β H.InputPlacements k where | |
| toFun x := β¨fun i => (x i).val,β¨fun _ _ he => x.injective (Subtype.ext he),fun i a => (x i).property aβ©β© | |
| invFun x := β¨fun i => β¨x.val i,x.property.2 iβ©,fun _ _ he => x.property.1 (congrArg Subtype.val he)β© | |
| left_inv _ := rfl | |
| right_inv _ := rfl | |
| def outputFreePlacementEquiv : (Fin k βͺ H.FreeAt (Fin.last G.b)) β H.OutputPlacements k where | |
| toFun x := β¨fun i => (x i).val,β¨fun _ _ he => x.injective (Subtype.ext he),fun i a => (x i).property aβ©β© | |
| invFun x := β¨fun i => β¨x.val i,x.property.2 iβ©,fun _ _ he => x.property.1 (congrArg Subtype.val he)β© | |
| left_inv _ := rfl | |
| right_inv _ := rfl | |
| def outputPlacementEquiv (hf : H.Feasible) : (Fin k βͺ H.FreeAt 0) β H.OutputPlacements k := | |
| (Equiv.embeddingCongr (Equiv.refl (Fin k)) | |
| (H.freeBoundary β¨H.reference hf,H.reference_compatible hfβ© (Fin.last G.b))).trans H.outputFreePlacementEquiv | |
| lemma outputPlacementEquiv_apply (hf : H.Feasible) (y : Fin k βͺ H.FreeAt 0) (i : Fin k) : | |
| (H.outputPlacementEquiv hf y).val i=G.sweep (H.reference hf) (y i).val := rfl | |
| def residualFree (hf : H.Feasible) (Ο : {Ο : G.Choices // H.Compatible Ο}) : Equiv.Perm (H.FreeAt 0) := | |
| H.stabilizerFreeEquiv (H.residual hf Ο) | |
| lemma residualFree_apply (hf : H.Feasible) (Ο : {Ο : G.Choices // H.Compatible Ο}) (x : H.FreeAt 0) : | |
| (H.residualFree hf Ο x).val=(G.sweep (H.reference hf))β»ΒΉ (G.sweep Ο.val x.val) := rfl | |
| lemma endpointEvent_residualFree (hf : H.Feasible) (x y : Fin k βͺ H.FreeAt 0) | |
| (Ο : {Ο : G.Choices // H.Compatible Ο}) : | |
| G.endpointEvent (H.inputPlacementEquiv x).val (H.outputPlacementEquiv hf y).val Finset.univ Ο.val β | |
| H.residualFree hf Ο β’ x=y := by | |
| constructor | |
| Β· intro he | |
| apply Function.Embedding.ext | |
| intro i | |
| apply Subtype.ext | |
| change (H.residualFree hf Ο (x i)).val=(y i).val | |
| rw [H.residualFree_apply] | |
| apply (Equiv.symm_apply_eq (G.sweep (H.reference hf))).mpr | |
| exact he i (Finset.mem_univ _) | |
| Β· intro he i hi | |
| have hh := congrArg (fun x : Fin k βͺ H.FreeAt 0 => (x i).val) he | |
| change (H.residualFree hf Ο (x i)).val=(y i).val at hh | |
| rw [H.residualFree_apply] at hh | |
| exact (Equiv.symm_apply_eq (G.sweep (H.reference hf))).mp hh | |
| lemma extraProbability_eq_residual_sum (hf : H.Feasible) (x y : Fin k βͺ H.FreeAt 0) | |
| {z : β} (hz : 0 β€ z) (hz' : z β€ 1) : | |
| H.extraProbability (H.inputPlacementEquiv x).val (H.outputPlacementEquiv hf y).val Finset.univ | |
| (fun j => lineLaw (G.bits j) z hz hz') = | |
| β Ο : {Ο : G.Choices // H.Compatible Ο}, | |
| if H.residualFree hf Ο β’ x=y then G.choiceWeight z Ο.val/H.probability z else 0 := by | |
| rw [H.extraProbability_eq_conditionalEndpoint,conditionalEndpointProbability,H.lineMass_hole_normalizer hz hz'] | |
| have hn : (β Ο : G.Choices, if H.Compatible Ο β§ | |
| G.endpointEvent (H.inputPlacementEquiv x).val (H.outputPlacementEquiv hf y).val Finset.univ Ο then | |
| G.productLineMass (fun j => lineLaw (G.bits j) z hz hz') Ο else 0)= | |
| β Ο : {Ο : G.Choices // H.Compatible Ο}, | |
| if H.residualFree hf Ο β’ x=y then G.choiceWeight z Ο.val else 0 := by | |
| symm | |
| calc | |
| _ = β Ο : {Ο : G.Choices // H.Compatible Ο}, | |
| if G.endpointEvent (H.inputPlacementEquiv x).val | |
| (H.outputPlacementEquiv hf y).val Finset.univ Ο.val then G.choiceWeight z Ο.val else 0 := by | |
| apply Finset.sum_congr rfl | |
| intro Ο _ | |
| rw [H.endpointEvent_residualFree hf] | |
| split_ifs <;> rfl | |
| _ = _ := by | |
| rw [sum_subtype_eq_sum_ite_of_iff (fun _ => Iff.rfl) | |
| (fun Ο : G.Choices => if G.endpointEvent (H.inputPlacementEquiv x).val | |
| (H.outputPlacementEquiv hf y).val Finset.univ Ο then G.choiceWeight z Ο else 0)] | |
| apply Finset.sum_congr rfl | |
| intro Ο _ | |
| split_ifs <;> try rfl | |
| all_goals simp_all | |
| rw [hn,Finset.sum_div] | |
| apply Finset.sum_congr rfl | |
| intro Ο _ | |
| split_ifs <;> simp | |
| /- Partial endpoint matrix written on a single placement set using the | |
| reference sweep; every variable is a literal conditional path probability. -/ | |
| def referencePartial (hf : H.Feasible) (ΞΌ : β j, FiniteLaw (Equiv.Perm (Cube (G.bits j)))) | |
| (A : Finset (Fin k)) (x y : Fin k βͺ H.FreeAt 0) : β := | |
| H.extraProbability (H.inputPlacementEquiv x).val (H.outputPlacementEquiv hf y).val A ΞΌ | |
| lemma referencePartial_depends (hf : H.Feasible) | |
| (ΞΌ : β j, FiniteLaw (Equiv.Perm (Cube (G.bits j)))) (A : Finset (Fin k)) (x : Fin k βͺ H.FreeAt 0) : | |
| Placement.DependsOn (fun y : Fin k βͺ H.FreeAt 0 => y) A | |
| (fun y => (H.referencePartial hf ΞΌ A x y : β)) := by | |
| intro y y' hy | |
| apply H.extraProbability_dependsOn ΞΌ A (H.inputPlacementEquiv x) | |
| intro i hi | |
| simp only [outputPlacementEquiv_apply,hy i hi] | |
| lemma referencePartial_full (hf : H.Feasible) {z : β} (hz : 0 β€ z) (hz' : z β€ 1) : | |
| (show Matrix (Fin k βͺ H.FreeAt 0) (Fin k βͺ H.FreeAt 0) β from fun x y => | |
| (H.referencePartial hf (fun j => lineLaw (G.bits j) z hz hz') Finset.univ x y : β))= | |
| β Ο : {Ο : G.Choices // H.Compatible Ο}, | |
| ((G.choiceWeight z Ο.val/H.probability z : β) : β) β’ | |
| actionMatrix (X := Fin k βͺ H.FreeAt 0) (H.residualFree hf Ο)β»ΒΉ := by | |
| ext x y | |
| simp only [Matrix.sum_apply,Matrix.smul_apply,smul_eq_mul,actionMatrix_entry,inv_inv] | |
| rw [referencePartial,H.extraProbability_eq_residual_sum hf x y hz hz',Complex.ofReal_sum] | |
| apply Finset.sum_congr rfl | |
| intro Ο _ | |
| split_ifs <;> simp | |
| lemma referenceAlternating_entry (hf : H.Feasible) | |
| (ΞΌ : β j, FiniteLaw (Equiv.Perm (Cube (G.bits j)))) (x y : Fin k βͺ H.FreeAt 0) : | |
| alternatingKernel (G.size : β) (H.referencePartial hf ΞΌ) x y= | |
| (H.placementKernel (H.inputPlacementEquiv x).val (H.outputPlacementEquiv hf y).val ΞΌ : β) := by | |
| simp only [alternatingKernel,referencePartial,placementKernel,Fintype.card_fin] | |
| lemma referenceAlternating_hs (hf : H.Feasible) | |
| (ΞΌ : β j, FiniteLaw (Equiv.Perm (Cube (G.bits j)))) : | |
| (β x : Fin k βͺ H.FreeAt 0, β y : Fin k βͺ H.FreeAt 0, | |
| βalternatingKernel (G.size : β) (H.referencePartial hf ΞΌ) x yβ^2)=H.placementHSsq (k := k) ΞΌ := by | |
| rw [H.placementHSsq_eq_subtype] | |
| simp only [referenceAlternating_entry] | |
| apply Fintype.sum_equiv H.inputPlacementEquiv | |
| intro x | |
| exact (H.outputPlacementEquiv hf).sum_comp | |
| (fun y => β(H.placementKernel (H.inputPlacementEquiv x).val y.val ΞΌ : β)β^2) | |
| /- The missing attachment of source04:eq7 to the faithful conditional | |
| irreducible average, not merely an abstract stochastic matrix. -/ | |
| theorem conditional_norm_le_placementHS (hf : H.Feasible) {z : β} (hz : 0 β€ z) (hz' : z β€ 1) | |
| (Ο : UnitaryIrrep (Equiv.Perm (H.FreeAt 0))) | |
| (u : Fin Ο.dimension β β) (hu : u β 0) (xβ : Fin k βͺ H.FreeAt 0) | |
| (hfixed : β g : Equiv.Perm (H.FreeAt 0), (β i, g (xβ i)=xβ i) β Ο.asRepresentation g u=u) | |
| (hnof : β A : Finset (H.FreeAt 0), A.card < k β β v : Fin Ο.dimension β β, | |
| (β g : Equiv.Perm (H.FreeAt 0), (β a β A, g a=a) β Ο.asRepresentation g v=v) β v=0) : | |
| βH.conditionalAverage hf z (Ο.pullback H.stabilizerFreeEquiv)β β€ | |
| Real.sqrt (H.placementHSsq (k := k) (fun j => lineLaw (G.bits j) z hz hz')) := by | |
| have hm := first_level_norm_le Ο u hu xβ hfixed (by simpa only [Fintype.card_fin] using hnof) | |
| (fun Ο : {Ο : G.Choices // H.Compatible Ο} => ((G.choiceWeight z Ο.val/H.probability z : β) : β)) | |
| (fun Ο => (H.residualFree hf Ο)β»ΒΉ) (G.size : β) (by unfold Grid.size; positivity) | |
| (H.referencePartial hf (fun j => lineLaw (G.bits j) z hz hz')) | |
| (H.referencePartial_depends hf _) (H.referencePartial_full hf hz hz') | |
| have he : (β Ο : {Ο : G.Choices // H.Compatible Ο}, | |
| ((G.choiceWeight z Ο.val/H.probability z : β):β) β’ Ο.matrix (H.residualFree hf Ο)β»ΒΉ)= | |
| (H.conditionalAverage hf z (Ο.pullback H.stabilizerFreeEquiv)).conjTranspose := by | |
| rw [H.conditionalAverage_eq_sum,Matrix.conjTranspose_sum] | |
| apply Finset.sum_congr rfl | |
| intro Ο _ | |
| rw [Matrix.conjTranspose_smul,Complex.star_def,Complex.conj_ofReal] | |
| exact congrArg (fun M => ((G.choiceWeight z Ο.val/H.probability z : β):β) β’ M) | |
| (Ο.matrix_inv (H.residualFree hf Ο)) | |
| rw [he] at hm | |
| change β(H.conditionalAverage hf z (Ο.pullback H.stabilizerFreeEquiv)).conjTransposeβ β€ _ at hm | |
| rw [Matrix.l2_opNorm_conjTranspose] at hm | |
| apply hm.trans | |
| have hh := Placement.matrix_l2_norm_le_hs (alternatingKernel (G.size : β) | |
| (H.referencePartial (k := k) hf (fun j => lineLaw (G.bits j) z hz hz'))) | |
| rw [H.referenceAlternating_hs] at hh | |
| convert hh using 1 | |
| rfl | |
| end CoordinateSweeps.Grid.Holes | |
| namespace CoordinateSweeps | |
| -- Archived complete binary-sign support, reused without a new-result claim. | |
| /- The real-valued sign character, not a replacement for the permutation. -/ | |
| def realSign {Ξ© : Type*} [Fintype Ξ©] [DecidableEq Ξ©] : Equiv.Perm Ξ© β* β where | |
| toFun g := ((Equiv.Perm.sign g : β€) : β) | |
| map_one' := by simp | |
| map_mul' g h := by simp | |
| def boolSwitch (b : Bool) : Equiv.Perm Bool := | |
| if b then Equiv.swap false true else 1 | |
| theorem boolSwitch_apply (b x : Bool) : boolSwitch b x = Bool.xor x b := by | |
| cases b <;> cases x <;> simp [boolSwitch] | |
| theorem sign_boolSwitch (b : Bool) : realSign (boolSwitch b) = if b then -1 else 1 := by | |
| cases b <;> simp [boolSwitch, realSign] | |
| theorem pairSwitch_eq_prod {L : Type*} (bits : L β Bool) : | |
| pairSwitch bits = Equiv.prodCongrLeft (fun l => boolSwitch (bits l)) := by | |
| apply Equiv.ext | |
| rintro β¨b,lβ© | |
| change (Bool.xor b (bits l), l) = (boolSwitch (bits l) b, l) | |
| rw [boolSwitch_apply] | |
| theorem sign_pairSwitch {L : Type*} [Fintype L] (bits : L β Bool) : | |
| realSign (pairSwitch bits) = β l, (if bits l then (-1 : β) else 1) := by | |
| rw [pairSwitch_eq_prod] | |
| change (((Equiv.Perm.sign (Equiv.prodCongrLeft (fun l => boolSwitch (bits l)))) : β€) : β) = _ | |
| rw [Equiv.Perm.sign_prodCongrLeft] | |
| change (((Units.coeHom β€) (β l, Equiv.Perm.sign (boolSwitch (bits l)))) : β) = _ | |
| rw [map_prod, Int.cast_prod] | |
| apply Finset.prod_congr rfl | |
| intro l _ | |
| exact sign_boolSwitch (bits l) | |
| theorem sign_binaryLayer {d : β} (j : Fin d) | |
| (bits : ({k : Fin d // k β j} β Bool) β Bool) : | |
| realSign (binaryLayer j bits) = realSign (pairSwitch bits) := by | |
| change (((Equiv.Perm.sign (_)) : β€) : β) = _ | |
| rw [binaryLayer, Equiv.Perm.sign_trans_trans] | |
| simp [realSign] | |
| theorem sum_sign_pairSwitch {L : Type*} [Fintype L] [Nonempty L] : | |
| (β bits : L β Bool, realSign (pairSwitch bits)) = 0 := by | |
| simp_rw [sign_pairSwitch] | |
| rw [β Fintype.prod_sum (fun (_ : L) (b : Bool) => if b then (-1 : β) else 1)] | |
| simp | |
| theorem sign_binarySweep (d : β) (bits : BinaryChoices d) : | |
| realSign (binarySweep d bits) = β j, realSign (binaryLayer j (bits j)) := by | |
| unfold binarySweep orderedProduct | |
| rw [map_list_prod] | |
| simp [List.map_reverse, List.map_ofFn, List.prod_reverse, List.prod_ofFn] | |
| theorem sum_sign_binarySweep {d : β} (hd : 0 < d) : | |
| (β bits : BinaryChoices d, realSign (binarySweep d bits)) = 0 := by | |
| simp_rw [sign_binarySweep, sign_binaryLayer] | |
| change (β bits : BinaryChoices d, β j : Fin d, | |
| realSign (pairSwitch (bits j))) = 0 | |
| have hs : β (j : Fin d) (b : ({k : Fin d // k β j} β Bool) β Bool), | |
| realSign (pairSwitch b) = β l, if b l then (-1 : β) else 1 := by | |
| intro j b | |
| convert sign_pairSwitch b using 1 | |
| congr 2 | |
| exact Subsingleton.elim _ _ | |
| simp_rw [hs] | |
| rw [β Fintype.prod_sum (fun j : Fin d => | |
| fun b : ({k : Fin d // k β j} β Bool) β Bool => | |
| β l, if b l then (-1 : β) else 1)] | |
| apply Finset.prod_eq_zero (i := (β¨0,hdβ© : Fin d)) (Finset.mem_univ _) | |
| rw [β Fintype.prod_sum (fun (_ : ({k : Fin d // k β (β¨0,hdβ© : Fin d)} β Bool)) | |
| (b : Bool) => if b then (-1 : β) else 1)] | |
| simp | |
| end CoordinateSweeps | |
| namespace CoordinateSweeps | |
| variable {Ξ© : Type*} [Fintype Ξ©] [DecidableEq Ξ©] | |
| lemma signed_sum_zero_of_swap (w : Equiv.Perm Ξ© β β) (P : Equiv.Perm Ξ© β Prop) | |
| (a b : Ξ©) (hab : a β b) | |
| (hw : β Ο, w (Equiv.swap a b*Ο)=w Ο) | |
| (hP : β Ο, P (Equiv.swap a b*Ο) β P Ο) : | |
| (β Ο : Equiv.Perm Ξ©, if P Ο then w Ο*realSign Ο else 0)=0 := by | |
| classical | |
| have hs : realSign (Equiv.swap a b)=(-1:β) := by | |
| simp [realSign,Equiv.Perm.sign_swap hab] | |
| have he := Equiv.sum_comp (Equiv.mulLeft (Equiv.swap a b)) | |
| (fun Ο : Equiv.Perm Ξ© => if P Ο then w Ο*realSign Ο else 0) | |
| have hn : (β Ο : Equiv.Perm Ξ©, if P (Equiv.swap a b*Ο) then | |
| w (Equiv.swap a b*Ο)*realSign (Equiv.swap a b*Ο) else 0)= | |
| -(β Ο : Equiv.Perm Ξ©, if P Ο then w Ο*realSign Ο else 0) := by | |
| rw [β Finset.sum_neg_distrib] | |
| apply Finset.sum_congr rfl | |
| intro Ο _ | |
| rw [hP,hw,map_mul,hs] | |
| split_ifs <;> ring | |
| change (β Ο : Equiv.Perm Ξ©, if P (Equiv.swap a b*Ο) then | |
| w (Equiv.swap a b*Ο)*realSign (Equiv.swap a b*Ο) else 0)=_ at he | |
| linarith [hn,he] | |
| lemma sum_uniform_realSign [Nontrivial Ξ©] : | |
| (β Ο : Equiv.Perm Ξ©, FiniteLaw.uniform _ Ο*realSign Ο)=0 := by | |
| obtain β¨a,b,habβ© := exists_pair_ne Ξ© | |
| simpa only [ite_true] using signed_sum_zero_of_swap (FiniteLaw.uniform _) (fun _ => True) | |
| a b hab (fun _ => rfl) (fun _ => Iff.rfl) | |
| omit [DecidableEq Ξ©] in | |
| lemma sum_map_mul (ΞΌ : FiniteLaw Ξ©) {X : Type*} [Fintype X] (f : Ξ© β X) (v : X β β) : | |
| (β y : X, (ΞΌ.map f) y*v y)=β x : Ξ©, ΞΌ x*v (f x) := by | |
| simp only [FiniteLaw.map_apply,Finset.sum_mul] | |
| rw [Finset.sum_comm] | |
| apply Finset.sum_congr rfl | |
| intro x _ | |
| simp [ite_mul] | |
| lemma sum_binary_realSign {d : β} (hd : 0 < d) : | |
| (β Ο : Equiv.Perm (Cube d), binaryLaw d Ο*realSign Ο)=0 := by | |
| rw [binaryLaw,sum_map_mul] | |
| simp only [FiniteLaw.uniform_apply,β Finset.mul_sum,sum_sign_binarySweep hd,mul_zero] | |
| lemma sum_lineLaw_realSign {d : β} (hd : 0 < d) {z : β} (hz : 0 β€ z) (hz' : z β€ 1) : | |
| (β Ο : Equiv.Perm (Cube d), lineLaw d z hz hz' Ο*realSign Ο)=0 := by | |
| let : NeZero d := β¨hd.ne'β© | |
| change (β Ο : Equiv.Perm (Cube d), ((1-z)*FiniteLaw.uniform _ Ο+z*binaryLaw d Ο)*realSign Ο)=0 | |
| simp only [add_mul,mul_assoc,Finset.sum_add_distrib,β Finset.mul_sum, | |
| sum_uniform_realSign,sum_binary_realSign hd,mul_zero,add_zero] | |
| lemma uniform_signed_assignments_zero {I : Type*} | |
| (x y : I β Ξ©) (a b : Ξ©) (hab : a β b) (ha : β i, y i β a) (hb : β i, y i β b) : | |
| (β Ο : Equiv.Perm Ξ©, if β i, Ο (x i)=y i then FiniteLaw.uniform _ Ο*realSign Ο else 0)=0 := by | |
| apply signed_sum_zero_of_swap (FiniteLaw.uniform _) _ a b hab (fun _ => rfl) | |
| have hs (i : I) : Equiv.swap a b (y i)=y i := Equiv.swap_apply_of_ne_of_ne (ha i) (hb i) | |
| intro Ο | |
| constructor | |
| Β· intro h i | |
| apply (Equiv.swap a b).injective | |
| exact (h i).trans (hs i).symm | |
| Β· intro h i | |
| change Equiv.swap a b (Ο (x i))=y i | |
| rw [h i,hs] | |
| namespace Grid | |
| lemma realSign_fiberPerm {A B : Type*} [Fintype A] [Fintype B] [DecidableEq A] [DecidableEq B] | |
| (g : B β Equiv.Perm A) : realSign (fiberPerm g)=β b, realSign (g b) := by | |
| have he : fiberPerm g=Equiv.prodCongrLeft g := rfl | |
| rw [he] | |
| change (((Equiv.Perm.sign (Equiv.prodCongrLeft g) : β€):β))=_ | |
| rw [Equiv.Perm.sign_prodCongrLeft] | |
| change (((Units.coeHom β€) (β b, Equiv.Perm.sign (g b))):β)=_ | |
| rw [map_prod,Int.cast_prod] | |
| rfl | |
| lemma realSign_stage (G : Grid) (Ο : G.Choices) (j : Fin G.b) : | |
| realSign (G.stage Ο j)=β L, realSign (Ο j L) := by | |
| have he : realSign (G.stage Ο j)=realSign (fiberPerm (Ο j)) := by | |
| change (((Equiv.Perm.sign (_)) : β€) : β) = _ | |
| rw [stage,Equiv.Perm.sign_trans_trans] | |
| simp [realSign] | |
| exact he.trans (realSign_fiberPerm (Ο j)) | |
| lemma realSign_sweep (G : Grid) (Ο : G.Choices) : | |
| realSign (G.sweep Ο)=β j, β L, realSign (Ο j L) := by | |
| unfold sweep boundary | |
| have ht := List.take_length (l := List.ofFn (G.stage Ο)) | |
| simp only [List.length_ofFn] at ht | |
| rw [ht] | |
| rw [map_list_prod] | |
| simp only [List.map_reverse,List.map_ofFn,List.prod_reverse,List.prod_ofFn,Function.comp_apply,realSign_stage] | |
| lemma signed_line_factorization (G : Grid) | |
| (ΞΌ : β j : Fin G.b, FiniteLaw (Equiv.Perm (Cube (G.bits j)))) | |
| (P : β j : Fin G.b, G.Line j β Equiv.Perm (Cube (G.bits j)) β Prop) : | |
| (β Ο : G.Choices, if β j L, P j L (Ο j L) then G.productLineMass ΞΌ Ο*realSign (G.sweep Ο) else 0)= | |
| β j, β L, β Ο, if P j L Ο then ΞΌ j Ο*realSign Ο else 0 := by | |
| simp only [realSign_sweep,productLineMass,β Finset.prod_mul_distrib] | |
| calc | |
| _ = β j, β Ο : G.Line j β Equiv.Perm (Cube (G.bits j)), | |
| if β L, P j L (Ο L) then β L, ΞΌ j (Ο L)*realSign (Ο L) else 0 := by | |
| convert sum_prod_ite_all | |
| (fun j (Ο : G.Line j β Equiv.Perm (Cube (G.bits j))) => β L, ΞΌ j (Ο L)*realSign (Ο L)) | |
| (fun j (Ο : G.Line j β Equiv.Perm (Cube (G.bits j))) => β L, P j L (Ο L)) using 1 <;> | |
| congr! | |
| _ = _ := by | |
| apply Finset.prod_congr rfl | |
| intro j _ | |
| exact sum_prod_ite_all (fun _ Ο => ΞΌ j Ο*realSign Ο) (P j) | |
| end Grid | |
| end CoordinateSweeps | |
| namespace CoordinateSweeps.Grid.Holes | |
| variable {G : Grid} {h k : β} (H : G.Holes h) | |
| def jointLineEvent (x y : Fin k β G.Slot) (A : Finset (Fin k)) | |
| (j : Fin G.b) (L : G.Line j) (Ο : Equiv.Perm (Cube (G.bits j))) : Prop := | |
| H.LineCompatible j L Ο β§ G.extraLineEvent x y A j L Ο | |
| lemma signed_endpoint_factorization (x y : Fin k β G.Slot) (A : Finset (Fin k)) | |
| (ΞΌ : β j, FiniteLaw (Equiv.Perm (Cube (G.bits j)))) : | |
| (β Ο : G.Choices, if H.Compatible Ο β§ G.endpointEvent x y A Ο then | |
| G.productLineMass ΞΌ Ο*realSign (G.sweep Ο) else 0)= | |
| β j, β L, β Ο, if H.jointLineEvent x y A j L Ο then ΞΌ j Ο*realSign Ο else 0 := by | |
| have he (Ο : G.Choices) : H.Compatible Ο β§ G.endpointEvent x y A Ο β | |
| β j L, H.jointLineEvent x y A j L (Ο j L) := by | |
| rw [H.compatible_iff_lines,G.endpointEvent_iff_lines] | |
| exact β¨fun hh j L => β¨hh.1 j L,hh.2 j Lβ©, | |
| fun hh => β¨fun j L => (hh j L).1,fun j L => (hh j L).2β©β© | |
| simp_rw [he] | |
| exact G.signed_line_factorization ΞΌ (H.jointLineEvent x y A) | |
| lemma signed_endpoint_zero_of_unused (x y : Fin k β G.Slot) (A : Finset (Fin k)) | |
| {z : β} (hz : 0 β€ z) (hz' : z β€ 1) (j : Fin G.b) (hj : 0 < G.bits j) | |
| (L : G.Line j) (hholes : β i : Fin h, Β¬ H.OnLine j L i) | |
| (hpaths : β i β A, G.pathLine (x i) (y i) j β L) : | |
| (β Ο : G.Choices, if H.Compatible Ο β§ G.endpointEvent x y A Ο then | |
| G.choiceWeight z Ο*realSign (G.sweep Ο) else 0)=0 := by | |
| change (β Ο : G.Choices, if H.Compatible Ο β§ G.endpointEvent x y A Ο then | |
| G.productLineMass (fun j => lineLaw (G.bits j) z hz hz') Ο*realSign (G.sweep Ο) else 0)=0 | |
| rw [H.signed_endpoint_factorization] | |
| apply Finset.prod_eq_zero (Finset.mem_univ j) | |
| apply Finset.prod_eq_zero (Finset.mem_univ L) | |
| have he (Ο : Equiv.Perm (Cube (G.bits j))) : H.jointLineEvent x y A j L Ο := by | |
| constructor | |
| Β· intro i | |
| exact False.elim (hholes i.val i.property) | |
| Β· intro i hi hL | |
| exact False.elim (hpaths i hi hL) | |
| simp only [ite_eq_left (he _)] | |
| exact sum_lineLaw_realSign hj hz hz' | |
| lemma exists_unused_line (x y : Fin k β G.Slot) (j : Fin G.b) | |
| (hj : h+k < Fintype.card (G.Line j)) : | |
| β L : G.Line j, (β i : Fin h, Β¬ H.OnLine j L i) β§ | |
| β i : Fin k, G.pathLine (x i) (y i) j β L := by | |
| let f : Fin h β Fin k β G.Line j := Sum.elim | |
| (fun i => fun t => H.path i j.castSucc t) (fun i => G.pathLine (x i) (y i) j) | |
| have hn : Β¬ Function.Surjective f := by | |
| intro hs | |
| have hc := Fintype.card_le_of_surjective f hs | |
| simp only [Fintype.card_sum,Fintype.card_fin] at hc | |
| omega | |
| obtain β¨L,hLβ© := not_forall.mp hn | |
| refine β¨L,?_,?_β© | |
| Β· intro i hi | |
| exact hL β¨Sum.inl i,hiβ© | |
| Β· intro i hi | |
| exact hL β¨Sum.inr i,hiβ© | |
| /- Literal many-coordinate column cancellation; no complex conditioning. -/ | |
| theorem signed_endpoint_zero_many (x y : Fin k β G.Slot) {z : β} | |
| (hz : 0 β€ z) (hz' : z β€ 1) (j : Fin G.b) (hj : 0 < G.bits j) | |
| (hsize : h+k < Fintype.card (G.Line j)) : | |
| (β Ο : G.Choices, if H.Compatible Ο β§ G.endpointEvent x y Finset.univ Ο then | |
| G.choiceWeight z Ο*realSign (G.sweep Ο) else 0)=0 := by | |
| obtain β¨L,hH,hPβ© := H.exists_unused_line x y j hsize | |
| exact H.signed_endpoint_zero_of_unused x y Finset.univ hz hz' j hj L hH (fun i _ => hP i) | |
| end CoordinateSweeps.Grid.Holes | |
| namespace CoordinateSweeps | |
| /- More than one unassigned slot per line on average forces two free slots | |
| on a common line. Assignments need not be injective for this counting step. -/ | |
| lemma exists_two_unassigned {I U V : Type*} [Fintype I] [Fintype U] [Fintype V] | |
| [DecidableEq U] [DecidableEq V] (f : I β U Γ V) | |
| (hh : Fintype.card I+Fintype.card V < Fintype.card (U Γ V)) : | |
| β a b : U, β v : V, a β b β§ (β i, f i β (a,v)) β§ β i, f i β (b,v) := by | |
| classical | |
| let S := (Finset.univ : Finset (U Γ V)) \ Finset.univ.image f | |
| have hc : Fintype.card V < S.card := by | |
| dsimp [S] | |
| rw [Finset.card_sdiff_of_subset (Finset.subset_univ _),Finset.card_univ] | |
| have hi : (Finset.univ.image f).card β€ Fintype.card I := by | |
| simpa using Finset.card_image_le (s := Finset.univ) (f := f) | |
| omega | |
| have hn : Β¬ Function.Injective (fun u : S => u.val.2) := by | |
| intro hi | |
| have ht := Fintype.card_le_of_injective _ hi | |
| exact (not_le.mpr hc) (by simpa only [Fintype.card_coe] using ht) | |
| simp only [Function.Injective] at hn | |
| push Not at hn | |
| obtain β¨a,b,hv,habβ© := hn | |
| refine β¨a.val.1,b.val.1,a.val.2,?_,?_,?_β© | |
| Β· intro he | |
| apply hab | |
| exact Subtype.ext (Prod.ext he hv) | |
| Β· intro i hi | |
| have ha := (Finset.mem_sdiff.mp a.property).2 | |
| exact ha (Finset.mem_image.mpr β¨i,Finset.mem_univ _,hiβ©) | |
| Β· intro i hi | |
| have hb := (Finset.mem_sdiff.mp b.property).2 | |
| apply hb | |
| refine Finset.mem_image.mpr β¨i,Finset.mem_univ _,?_β© | |
| exact hi.trans (Prod.ext rfl hv) | |
| end CoordinateSweeps | |
| namespace CoordinateSweeps.Grid.Holes | |
| variable {G : Grid} {h k : β} (H : G.Holes h) | |
| lemma uniform_signed_joint_zero (x y : Fin k β G.Slot) (j : Fin G.b) | |
| (L : G.Line j) (a b : Cube (G.bits j)) (hab : a β b) | |
| (haH : β i : Fin h, H.OnLine j L i β H.path i j.succ j β a) | |
| (hbH : β i : Fin h, H.OnLine j L i β H.path i j.succ j β b) | |
| (haP : β i, G.pathLine (x i) (y i) j=L β y i j β a) | |
| (hbP : β i, G.pathLine (x i) (y i) j=L β y i j β b) : | |
| (β Ο, if H.jointLineEvent x y Finset.univ j L Ο then | |
| FiniteLaw.uniform _ Ο*realSign Ο else 0)=0 := by | |
| apply signed_sum_zero_of_swap (FiniteLaw.uniform _) _ a b hab (fun _ => rfl) | |
| have he (u v : Cube (G.bits j)) (hv : v β a) (hv' : v β b) (Ο : Equiv.Perm (Cube (G.bits j))) : | |
| (Equiv.swap a b*Ο) u=v β Ο u=v := by | |
| have hs := Equiv.swap_apply_of_ne_of_ne hv hv' | |
| constructor | |
| Β· intro hh | |
| apply (Equiv.swap a b).injective | |
| exact hh.trans hs.symm | |
| Β· intro hh | |
| change Equiv.swap a b (Ο u)=v | |
| rw [hh,hs] | |
| intro Ο | |
| unfold jointLineEvent LineCompatible extraLineEvent | |
| constructor | |
| Β· intro hh | |
| constructor | |
| Β· intro i | |
| exact (he _ _ (haH i i.property) (hbH i i.property) Ο).mp (hh.1 i) | |
| Β· intro i hi hL | |
| exact (he _ _ (haP i hL) (hbP i hL) Ο).mp (hh.2 i hi hL) | |
| Β· intro hh | |
| constructor | |
| Β· intro i | |
| exact (he _ _ (haH i i.property) (hbH i i.property) Ο).mpr (hh.1 i) | |
| Β· intro i hi hL | |
| exact (he _ _ (haP i hL) (hbP i hL) Ο).mpr (hh.2 i hi hL) | |
| /- Exact zero at the real uniform law, including bounded coordinate counts. -/ | |
| theorem signed_endpoint_zero_uniform (x y : Fin k β G.Slot) (j : Fin G.b) | |
| (hsize : h+k+Fintype.card (G.Line j) < G.size) : | |
| (β Ο : G.Choices, if H.Compatible Ο β§ G.endpointEvent x y Finset.univ Ο then | |
| G.choiceWeight 0 Ο*realSign (G.sweep Ο) else 0)=0 := by | |
| let f : Fin h β Fin k β Cube (G.bits j) Γ G.Line j := Sum.elim | |
| (fun i => (H.path i j.succ j,fun t => H.path i j.castSucc t)) | |
| (fun i => (y i j,G.pathLine (x i) (y i) j)) | |
| have hf : Fintype.card (Fin h β Fin k)+Fintype.card (G.Line j) < | |
| Fintype.card (Cube (G.bits j) Γ G.Line j) := by | |
| rw [β Fintype.card_congr (Equiv.piSplitAt j (fun t => Cube (G.bits t))),G.card_slot] | |
| simpa using hsize | |
| obtain β¨a,b,L,hab,ha,hbβ© := exists_two_unassigned f hf | |
| have hmass : β Ο : G.Choices, G.choiceWeight 0 Ο= | |
| G.productLineMass (fun j => FiniteLaw.uniform _) Ο := by | |
| intro Ο | |
| simp [choiceWeight,productLineMass] | |
| simp_rw [hmass] | |
| rw [H.signed_endpoint_factorization] | |
| apply Finset.prod_eq_zero (Finset.mem_univ j) | |
| apply Finset.prod_eq_zero (Finset.mem_univ L) | |
| apply H.uniform_signed_joint_zero x y j L a b hab | |
| Β· intro i hL he | |
| exact ha (Sum.inl i) (Prod.ext he hL) | |
| Β· intro i hL he | |
| exact hb (Sum.inl i) (Prod.ext he hL) | |
| Β· intro i hL he | |
| exact ha (Sum.inr i) (Prod.ext he hL) | |
| Β· intro i hL he | |
| exact hb (Sum.inr i) (Prod.ext he hL) | |
| end CoordinateSweeps.Grid.Holes | |
| namespace CoordinateSweeps.UnitaryIrrep | |
| open SparseDimension | |
| variable {Ξ© : Type*} [Fintype Ξ©] [DecidableEq Ξ©] | |
| def signTwist (Ο : UnitaryIrrep (Equiv.Perm Ξ©)) : UnitaryIrrep (Equiv.Perm Ξ©) where | |
| dimension := Ο.dimension | |
| positive := Ο.positive | |
| matrix := { | |
| toFun g := signScalar g β’ Ο.matrix g | |
| map_one' := by simp | |
| map_mul' g h := by simp only [map_mul,smul_mul_smul_comm] } | |
| unitary g := by | |
| change (signScalar g β’ Ο.matrix g).conjTranspose*(signScalar g β’ Ο.matrix g)=1 | |
| simp only [Matrix.conjTranspose_smul,Matrix.smul_mul,Matrix.mul_smul,smul_smul] | |
| rw [show star (signScalar g)=signScalar g by simp [signScalar_apply],signScalar_mul_self,one_smul,Ο.unitary] | |
| irreducible S hS := Ο.irreducible S (by | |
| intro g v hv | |
| have hh := S.smul_mem (signScalar g) (hS g v hv) | |
| change signScalar g β’ ((signScalar g β’ Ο.matrix g).mulVec v) β S at hh | |
| simpa only [Matrix.smul_mulVec,smul_smul,signScalar_mul_self,one_smul] using hh) | |
| @[simp] lemma signTwist_rep (Ο : UnitaryIrrep (Equiv.Perm Ξ©)) : | |
| Ο.signTwist.asRepresentation=SparseDimension.signTwist Ο.asRepresentation := by | |
| apply MonoidHom.ext | |
| intro g | |
| apply LinearMap.ext | |
| intro v | |
| change (signScalar g β’ Ο.matrix g).mulVec v=signScalar g β’ (Ο.matrix g).mulVec v | |
| exact Matrix.smul_mulVec _ _ _ | |
| end CoordinateSweeps.UnitaryIrrep | |
| namespace CoordinateSweeps.PlacementOccurrence | |
| open scoped Matrix.Norms.L2Operator | |
| variable {I Ξ© : Type*} [Fintype I] [DecidableEq I] [Fintype Ξ©] [DecidableEq Ξ©] | |
| /- Vanishing on placements transfers to any actually occurring constituent. | |
| No minimum-level condition is needed in the sign-zero branch. -/ | |
| omit [DecidableEq I] in | |
| theorem average_zero_of_placement_zero (Ο : UnitaryIrrep (Equiv.Perm Ξ©)) | |
| (u : Fin Ο.dimension β β) (hu : u β 0) (xβ : I βͺ Ξ©) | |
| (hfixed : β g : Equiv.Perm Ξ©, (β i, g (xβ i)=xβ i) β Ο.asRepresentation g u=u) | |
| {W : Type*} [Fintype W] (w : W β β) (g : W β Equiv.Perm Ξ©) | |
| (hz : (β a : W, w a β’ actionMatrix (X := I βͺ Ξ©) (g a))=0) : | |
| (β a : W, w a β’ Ο.matrix (g a))=0 := by | |
| let B : Matrix (Fin Ο.dimension) (I βͺ Ξ©) β := synthesisMatrix Ο u xβ | |
| have hne : B β 0 := synthesisMatrix_ne_zero Ο u hu xβ (by | |
| intro Ο hΟ | |
| exact hfixed Ο (fun i => congrArg (fun x : I βͺ Ξ© => x i) hΟ)) | |
| have hn := Ο.norm_le_compression (actionMatrix (X := I βͺ Ξ©)) actionMatrix_unitary B hne | |
| (synthesisMatrix_covariant Ο u xβ) (β a : W, w a β’ Ο.matrix (g a)) | |
| (β a : W, w a β’ actionMatrix (X := I βͺ Ξ©) (g a)) (by | |
| rw [Matrix.sum_mul,Matrix.mul_sum] | |
| apply Finset.sum_congr rfl | |
| intro a _ | |
| rw [Matrix.smul_mul,Matrix.mul_smul] | |
| congr 1 | |
| exact Ο.adjoint_intertwines _ actionMatrix_unitary B (synthesisMatrix_covariant Ο u xβ) (g a)) | |
| rw [hz,norm_zero] at hn | |
| exact norm_eq_zero.mp (le_antisymm hn (norm_nonneg _)) | |
| end CoordinateSweeps.PlacementOccurrence | |
| namespace CoordinateSweeps.Grid.Holes | |
| open SparseDimension UnitaryIrrep PlacementOccurrence | |
| variable {G : Grid} {h k : β} (H : G.Holes h) | |
| lemma realSign_freePerm (g : H.stabilizer) : | |
| realSign (H.stabilizerFreeEquiv g)=realSign g.val := by | |
| have he : Equiv.Perm.ofSubtype (H.stabilizerFreeEquiv g)=g.val := by | |
| apply Equiv.ext | |
| intro x | |
| by_cases hx : β i, x β H.path i 0 | |
| Β· rw [Equiv.Perm.ofSubtype_apply_of_mem _ hx] | |
| rfl | |
| Β· rw [Equiv.Perm.ofSubtype_apply_of_not_mem _ hx] | |
| push Not at hx | |
| obtain β¨i,rflβ© := hx | |
| exact (g.property i).symm | |
| rw [β he] | |
| simp [realSign,Equiv.Perm.sign_ofSubtype] | |
| lemma realSign_residualFree (hf : H.Feasible) (Ο : {Ο : G.Choices // H.Compatible Ο}) : | |
| realSign (H.residualFree hf Ο)=realSign (G.sweep (H.reference hf))β»ΒΉ*realSign (G.sweep Ο.val) := by | |
| rw [residualFree,H.realSign_freePerm] | |
| change realSign ((G.sweep (H.reference hf))β»ΒΉ*G.sweep Ο.val)=_ | |
| rw [map_mul] | |
| lemma signed_reference_entry_zero (hf : H.Feasible) (z : β) | |
| (hzero : β x y : Fin k β G.Slot, | |
| (β Ο : G.Choices, if H.Compatible Ο β§ G.endpointEvent x y Finset.univ Ο then | |
| G.choiceWeight z Ο*realSign (G.sweep Ο) else 0)=0) | |
| (x y : Fin k βͺ H.FreeAt 0) : | |
| (β Ο : {Ο : G.Choices // H.Compatible Ο}, | |
| if H.residualFree hf Ο β’ x=y then | |
| (G.choiceWeight z Ο.val/H.probability z)*realSign (H.residualFree hf Ο) else 0)=0 := by | |
| have hz := hzero (H.inputPlacementEquiv x).val (H.outputPlacementEquiv hf y).val | |
| have hs : (β Ο : {Ο : G.Choices // H.Compatible Ο}, | |
| if H.residualFree hf Ο β’ x=y then G.choiceWeight z Ο.val*realSign (G.sweep Ο.val) else 0)=0 := by | |
| calc | |
| _ = β Ο : {Ο : G.Choices // H.Compatible Ο}, | |
| if G.endpointEvent (H.inputPlacementEquiv x).val (H.outputPlacementEquiv hf y).val Finset.univ Ο.val then | |
| G.choiceWeight z Ο.val*realSign (G.sweep Ο.val) else 0 := by | |
| apply Finset.sum_congr rfl | |
| intro Ο _ | |
| rw [H.endpointEvent_residualFree] | |
| split_ifs <;> rfl | |
| _ = β Ο : G.Choices, if H.Compatible Ο β§ | |
| G.endpointEvent (H.inputPlacementEquiv x).val (H.outputPlacementEquiv hf y).val Finset.univ Ο then | |
| G.choiceWeight z Ο*realSign (G.sweep Ο) else 0 := by | |
| rw [sum_subtype_eq_sum_ite_of_iff (fun _ => Iff.rfl) | |
| (fun Ο : G.Choices => if G.endpointEvent (H.inputPlacementEquiv x).val | |
| (H.outputPlacementEquiv hf y).val Finset.univ Ο then | |
| G.choiceWeight z Ο*realSign (G.sweep Ο) else 0)] | |
| apply Finset.sum_congr rfl | |
| intro Ο _ | |
| split_ifs <;> simp_all | |
| _ = 0 := hz | |
| calc | |
| _ = (realSign (G.sweep (H.reference hf))β»ΒΉ/H.probability z)* | |
| (β Ο : {Ο : G.Choices // H.Compatible Ο}, if H.residualFree hf Ο β’ x=y then | |
| G.choiceWeight z Ο.val*realSign (G.sweep Ο.val) else 0) := by | |
| rw [Finset.mul_sum] | |
| apply Finset.sum_congr rfl | |
| intro Ο _ | |
| rw [H.realSign_residualFree] | |
| split_ifs <;> ring | |
| _ = 0 := by rw [hs,mul_zero] | |
| /- Column cancellation is now on the faithful conditional average, not just | |
| on raw signed endpoint numerators. -/ | |
| theorem conditional_zero_of_signed_endpoints (hf : H.Feasible) (z : β) | |
| (Ο : UnitaryIrrep (Equiv.Perm (H.FreeAt 0))) | |
| (u : Fin Ο.dimension β β) (hu : u β 0) (xβ : Fin k βͺ H.FreeAt 0) | |
| (hfixed : β g : Equiv.Perm (H.FreeAt 0), (β i, g (xβ i)=xβ i) β | |
| (SparseDimension.signTwist Ο.asRepresentation) g u=u) | |
| (hzero : β x y : Fin k β G.Slot, | |
| (β Ο : G.Choices, if H.Compatible Ο β§ G.endpointEvent x y Finset.univ Ο then | |
| G.choiceWeight z Ο*realSign (G.sweep Ο) else 0)=0) : | |
| H.conditionalAverage hf z (Ο.pullback H.stabilizerFreeEquiv)=0 := by | |
| let w := fun Ο : {Ο : G.Choices // H.Compatible Ο} => | |
| (((G.choiceWeight z Ο.val/H.probability z)*realSign (H.residualFree hf Ο) : β) : β) | |
| have he : (β Ο : {Ο : G.Choices // H.Compatible Ο}, | |
| w Ο β’ actionMatrix (X := Fin k βͺ H.FreeAt 0) ((H.residualFree hf Ο)β»ΒΉ))=0 := by | |
| ext x y | |
| simp only [Matrix.sum_apply,Matrix.smul_apply,smul_eq_mul,actionMatrix_entry,inv_inv,Matrix.zero_apply] | |
| have hs := H.signed_reference_entry_zero hf z hzero x y | |
| have hc := congrArg (fun t : β => (t : β)) hs | |
| simpa only [Complex.ofReal_sum,Complex.ofReal_zero,apply_ite,mul_ite,mul_one,mul_zero] using hc | |
| have hh := average_zero_of_placement_zero Ο.signTwist u hu xβ | |
| (by intro g hg; rw [signTwist_rep]; exact hfixed g hg) w | |
| (fun Ο => (H.residualFree hf Ο)β»ΒΉ) he | |
| have hid : (β Ο : {Ο : G.Choices // H.Compatible Ο}, | |
| w Ο β’ Ο.signTwist.matrix ((H.residualFree hf Ο)β»ΒΉ))= | |
| (H.conditionalAverage hf z (Ο.pullback H.stabilizerFreeEquiv)).conjTranspose := by | |
| rw [H.conditionalAverage_eq_sum,Matrix.conjTranspose_sum] | |
| apply Finset.sum_congr rfl | |
| intro Ο _ | |
| change w Ο β’ (signScalar ((H.residualFree hf Ο)β»ΒΉ) β’ Ο.matrix ((H.residualFree hf Ο)β»ΒΉ))=_ | |
| rw [smul_smul,Matrix.conjTranspose_smul,Complex.star_def,Complex.conj_ofReal,Ο.matrix_inv] | |
| congr 1 | |
| dsimp [w] | |
| rw [Complex.ofReal_mul] | |
| have hs : ((realSign (H.residualFree hf Ο) : β):β)=signScalar (H.residualFree hf Ο) := by | |
| simp [realSign,signScalar_apply] | |
| rw [hs,mul_assoc] | |
| change ((G.choiceWeight z Ο.val/H.probability z : β):β)* | |
| (signScalar (H.residualFree hf Ο)*signScalar ((H.residualFree hf Ο)β»ΒΉ))=_ | |
| rw [β map_mul,mul_inv_cancel,map_one,mul_one] | |
| rw [hid] at hh | |
| have heq := congrArg Matrix.conjTranspose hh | |
| simp only [Matrix.conjTranspose_conjTranspose] at heq | |
| exact heq.trans (show (0 : Matrix (Fin Ο.dimension) (Fin Ο.dimension) β).conjTranspose=0 from Matrix.conjTranspose_zero) | |
| end CoordinateSweeps.Grid.Holes | |
| namespace CoordinateSweeps.Grid.Holes | |
| open UnitaryIrrep | |
| variable {G : Grid} {h k : β} (H : G.Holes h) | |
| theorem conditional_column_zero_many (hf : H.Feasible) {z : β} (hz : 0 β€ z) (hz' : z β€ 1) | |
| (Ο : UnitaryIrrep (Equiv.Perm (H.FreeAt 0))) (u : Fin Ο.dimension β β) (hu : u β 0) | |
| (xβ : Fin k βͺ H.FreeAt 0) | |
| (hfixed : β g : Equiv.Perm (H.FreeAt 0), (β i, g (xβ i)=xβ i) β | |
| (SparseDimension.signTwist Ο.asRepresentation) g u=u) | |
| (j : Fin G.b) (hj : 0 < G.bits j) (hsize : h+k < Fintype.card (G.Line j)) : | |
| H.conditionalAverage hf z (Ο.pullback H.stabilizerFreeEquiv)=0 := | |
| H.conditional_zero_of_signed_endpoints hf z Ο u hu xβ hfixed | |
| (fun x y => H.signed_endpoint_zero_many x y hz hz' j hj hsize) | |
| theorem conditional_column_zero_uniform (hf : H.Feasible) | |
| (Ο : UnitaryIrrep (Equiv.Perm (H.FreeAt 0))) (u : Fin Ο.dimension β β) (hu : u β 0) | |
| (xβ : Fin k βͺ H.FreeAt 0) | |
| (hfixed : β g : Equiv.Perm (H.FreeAt 0), (β i, g (xβ i)=xβ i) β | |
| (SparseDimension.signTwist Ο.asRepresentation) g u=u) | |
| (j : Fin G.b) (hsize : h+k+Fintype.card (G.Line j) < G.size) : | |
| H.conditionalAverage hf 0 (Ο.pullback H.stabilizerFreeEquiv)=0 := | |
| H.conditional_zero_of_signed_endpoints hf 0 Ο u hu xβ hfixed | |
| (fun x y => H.signed_endpoint_zero_uniform x y j hsize) | |
| end CoordinateSweeps.Grid.Holes | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| open scoped Matrix.Norms.L2Operator | |
| end OAI | |