Download data/lean/OAI/Probability/CoordinateSweeps/Decomposition.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 30.2 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/CoordinateSweeps/Decomposition.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Probability/CoordinateSweeps/Decomposition.lean
-
curl -L -o Decomposition.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/CoordinateSweeps/Decomposition.lean
30.2 kB
| import Mathlib | |
| import OAI.Probability.CoordinateSweeps.Conditioning | |
| import OAI.RepresentationTheory.SignedTensor.Blocks | |
| namespace OAI | |
| noncomputable section | |
| open scoped BigOperators Matrix.Norms.L2Operator ComplexOrder | |
| attribute [local instance] Classical.propDecidable | |
| noncomputable section | |
| open scoped BigOperators ComplexConjugate Matrix.Norms.L2Operator | |
| attribute [local instance] Classical.propDecidable | |
| noncomputable section | |
| open scoped BigOperators ComplexOrder MatrixOrder | |
| attribute [local instance] Classical.propDecidable | |
| noncomputable section | |
| open scoped BigOperators ENNReal | |
| open MeasureTheory | |
| noncomputable section | |
| open scoped BigOperators Matrix.Norms.L2Operator ComplexOrder | |
| noncomputable section | |
| open scoped BigOperators | |
| attribute [local instance] Classical.propDecidable | |
| noncomputable section | |
| open scoped BigOperators Matrix.Norms.L2Operator ComplexOrder | |
| attribute [local instance] Classical.propDecidable | |
| noncomputable section | |
| attribute [local instance] Classical.propDecidable | |
| namespace CoordinateSweeps | |
| lemma schattenMoment_unitary_left {d : β} (q : β) (A U : Matrix (Fin d) (Fin d) β) | |
| (hU : U.conjTranspose*U=1) : schattenMoment q (U*A)=schattenMoment q A := by | |
| unfold schattenMoment | |
| rw [Matrix.conjTranspose_mul] | |
| have hh : A.conjTranspose*U.conjTranspose*(U*A)=A.conjTranspose*A := by | |
| calc | |
| _ = A.conjTranspose*(U.conjTranspose*U)*A := by noncomm_ring | |
| _ = _ := by rw [hU,mul_one] | |
| rw [hh] | |
| namespace Grid.Holes | |
| variable {G : Grid} {h : β} (H : G.Holes h) | |
| def residualWithReference (Ο0 : {Ο : G.Choices // H.Compatible Ο}) | |
| (Ο : {Ο : G.Choices // H.Compatible Ο}) : H.stabilizer := | |
| β¨(G.sweep Ο0.val)β»ΒΉ*G.sweep Ο.val,by | |
| intro i | |
| change (G.sweep Ο0.val).symm (G.sweep Ο.val (H.path i 0))=_ | |
| apply (Equiv.symm_apply_eq _).mpr | |
| exact (Ο.property i (Fin.last _)).trans (Ο0.property i (Fin.last _)).symmβ© | |
| lemma residualWithReference_eq (hf : H.Feasible) | |
| (Ο0 Ο : {Ο : G.Choices // H.Compatible Ο}) : | |
| H.residualWithReference Ο0 Ο=H.residualWithReference Ο0 β¨H.reference hf,H.reference_compatible hfβ©* | |
| H.residual hf Ο := by | |
| apply Subtype.ext | |
| change (G.sweep Ο0.val)β»ΒΉ*G.sweep Ο.val= | |
| ((G.sweep Ο0.val)β»ΒΉ*G.sweep (H.reference hf))* | |
| ((G.sweep (H.reference hf))β»ΒΉ*G.sweep Ο.val) | |
| group | |
| def averageWithReference (Ο0 : {Ο : G.Choices // H.Compatible Ο}) (z : β) | |
| (Ο : UnitaryIrrep H.stabilizer) : Matrix (Fin Ο.dimension) (Fin Ο.dimension) β := | |
| β Ο : {Ο : G.Choices // H.Compatible Ο}, ((G.choiceWeight z Ο.val/H.probability z : β) : β) β’ | |
| Ο.matrix (H.residualWithReference Ο0 Ο) | |
| /- Arbitrary feasible reference choices preserve the literal, unnormalized moment. -/ | |
| theorem averageWithReference_moment (hf : H.Feasible) | |
| (Ο0 : {Ο : G.Choices // H.Compatible Ο}) (z : β) (Ο : UnitaryIrrep H.stabilizer) (q : β) : | |
| schattenMoment q (H.averageWithReference Ο0 z Ο)=schattenMoment q (H.conditionalAverage hf z Ο) := by | |
| have he : H.averageWithReference Ο0 z Ο= | |
| Ο.matrix (H.residualWithReference Ο0 β¨H.reference hf,H.reference_compatible hfβ©)* | |
| H.conditionalAverage hf z Ο := by | |
| rw [H.conditionalAverage_eq_sum] | |
| unfold averageWithReference | |
| rw [Matrix.mul_sum] | |
| apply Finset.sum_congr rfl | |
| intro Ο _ | |
| rw [H.residualWithReference_eq hf Ο0 Ο,map_mul,Matrix.mul_smul] | |
| rw [he] | |
| exact schattenMoment_unitary_left q _ _ (Ο.unitary _) | |
| end Grid.Holes | |
| namespace Grid.Holes | |
| variable {A B : Grid} {h : β} (H : (concat A B).Holes h) | |
| def junctionIrrep (hf : H.Feasible) (Ο : UnitaryIrrep H.stabilizer) : UnitaryIrrep H.JunctionFix := | |
| Ο.pullback (H.junctionEquiv hf).symm | |
| /- Attachment of the checked law-level factorization to the exact main target. -/ | |
| theorem conditionalAverage_eq_junction (hf : H.Feasible) (z : β) | |
| (Ο : UnitaryIrrep H.stabilizer) : | |
| H.conditionalAverage hf z Ο=H.columnAverage hf z (H.junctionIrrep hf Ο).matrix* | |
| H.rowAverage hf z (H.junctionIrrep hf Ο).matrix := by | |
| rw [H.conditionalAverage_eq_sum] | |
| have hh := H.junction_average_split hf z (H.junctionIrrep hf Ο).matrix | |
| refine Eq.trans ?_ hh | |
| apply Finset.sum_congr rfl | |
| intro Ο _ | |
| congr 1 | |
| change Ο.matrix (H.residual hf Ο)=Ο.matrix ((H.junctionEquiv hf).symm | |
| (H.junctionEquiv hf (H.residual hf Ο))) | |
| rw [MulEquiv.symm_apply_apply] | |
| end Grid.Holes | |
| end CoordinateSweeps | |
| namespace CoordinateSweeps.Grid.Holes | |
| variable {A B : Grid} {h : β} (H : (concat A B).Holes h) | |
| abbrev JunctionFree := H.FreeAt (suffixTime A B 0) | |
| def rowLabel (x : H.JunctionFree) : B.Slot := (splitSlots A B x.val).2 | |
| def columnLabel (x : H.JunctionFree) : A.Slot := (splitSlots A B x.val).1 | |
| lemma junctionTime : prefixTime A B (Fin.last A.b)=suffixTime A B 0 := by apply Fin.ext; simp [prefixTime,suffixTime] | |
| /- The actual free row at the split layer is the child's terminal free set. -/ | |
| def freeRow (y : B.Slot) : {x : H.JunctionFree // H.rowLabel x=y} β | |
| (H.rowHoles y).FreeAt (Fin.last A.b) where | |
| toFun x := β¨(splitSlots A B x.val.val).1,by | |
| intro i hi | |
| apply x.val.property (H.rowCards y i).val | |
| apply (splitSlots A B).injective | |
| apply Prod.ext | |
| Β· simpa only [rowHoles,junctionTime] using hi | |
| Β· change H.rowLabel x.val=_ | |
| rw [x.property] | |
| exact ((H.rowCards y i).property).symm.trans (H.row_constant _ (Fin.last A.b)).symmβ© | |
| invFun x := β¨β¨(splitSlots A B).symm (x.val,y),by | |
| intro i hi | |
| have hh := congrArg (splitSlots A B) hi | |
| simp only [Equiv.apply_symm_apply] at hh | |
| have hy : H.rowOf i=y := (H.row_constant i (Fin.last A.b)).symm.trans (congrArg Prod.snd hh).symm | |
| let j := (H.rowCards y).symm β¨i,hyβ© | |
| have hj : (H.rowCards y j).val=i := congrArg Subtype.val ((H.rowCards y).apply_symm_apply β¨i,hyβ©) | |
| apply x.property j | |
| change x.val=(splitSlots A B (H.path (H.rowCards y j).val (prefixTime A B (Fin.last A.b)))).1 | |
| rw [hj,junctionTime] | |
| exact congrArg Prod.fst hhβ©,by simp [rowLabel]β© | |
| left_inv x := by | |
| apply Subtype.ext | |
| apply Subtype.ext | |
| apply (splitSlots A B).injective | |
| simp only [Equiv.apply_symm_apply] | |
| exact Prod.ext rfl x.property.symm | |
| right_inv x := by apply Subtype.ext; simp | |
| /- The actual free column at the split layer is the child's initial free set. -/ | |
| def freeColumn (x : A.Slot) : {y : H.JunctionFree // H.columnLabel y=x} β | |
| (H.columnHoles x).FreeAt 0 where | |
| toFun y := β¨(splitSlots A B y.val.val).2,by | |
| intro i hi | |
| apply y.val.property (H.columnCards x i).val | |
| apply (splitSlots A B).injective | |
| apply Prod.ext | |
| Β· change H.columnLabel y.val=_ | |
| exact y.property.trans (H.columnCards x i).property.symm | |
| Β· exact hiβ© | |
| invFun y := β¨β¨(splitSlots A B).symm (x,y.val),by | |
| intro i hi | |
| have hh := congrArg (splitSlots A B) hi | |
| simp only [Equiv.apply_symm_apply] at hh | |
| have hx : H.columnOf i=x := (congrArg Prod.fst hh).symm | |
| let j := (H.columnCards x).symm β¨i,hxβ© | |
| have hj : (H.columnCards x j).val=i := congrArg Subtype.val ((H.columnCards x).apply_symm_apply β¨i,hxβ©) | |
| apply y.property j | |
| change y.val=(splitSlots A B (H.path (H.columnCards x j).val (suffixTime A B 0))).2 | |
| rw [hj] | |
| exact congrArg Prod.snd hhβ©,by simp [columnLabel]β© | |
| left_inv y := by | |
| apply Subtype.ext | |
| apply Subtype.ext | |
| apply (splitSlots A B).injective | |
| simp only [Equiv.apply_symm_apply] | |
| exact Prod.ext y.property.symm rfl | |
| right_inv y := by apply Subtype.ext; simp | |
| lemma card_freeRow (y : B.Slot) : | |
| Fintype.card {x : H.JunctionFree // H.rowLabel x=y}=A.size-H.rowCount y := | |
| (Fintype.card_congr (H.freeRow y)).trans ((H.rowHoles y).card_freeAt _) | |
| lemma card_freeColumn (x : A.Slot) : | |
| Fintype.card {y : H.JunctionFree // H.columnLabel y=x}=B.size-H.columnCount x := | |
| (Fintype.card_congr (H.freeColumn x)).trans ((H.columnHoles x).card_freeAt _) | |
| end CoordinateSweeps.Grid.Holes | |
| namespace CoordinateSweeps.Grid | |
| lemma rowSweep_inv_apply (A B : Grid) (Ο : B.Slot β A.Choices) (x : (concat A B).Slot) : | |
| splitSlots A B ((rowSweep A B Ο)β»ΒΉ x)= | |
| ((A.sweep (Ο (splitSlots A B x).2))β»ΒΉ (splitSlots A B x).1,(splitSlots A B x).2) := by | |
| change splitSlots A B ((splitSlots A B).symm | |
| ((A.sweep (Ο (splitSlots A B x).2)).symm (splitSlots A B x).1,(splitSlots A B x).2))=_ | |
| rw [Equiv.apply_symm_apply] | |
| rfl | |
| lemma columnSweep_inv_apply (A B : Grid) (Ο : A.Slot β B.Choices) (x : (concat A B).Slot) : | |
| splitSlots A B ((columnSweep A B Ο)β»ΒΉ x)= | |
| ((splitSlots A B x).1,(B.sweep (Ο (splitSlots A B x).1))β»ΒΉ (splitSlots A B x).2) := by | |
| change splitSlots A B ((splitSlots A B).symm | |
| ((splitSlots A B x).1,(B.sweep (Ο (splitSlots A B x).1)).symm (splitSlots A B x).2))=_ | |
| rw [Equiv.apply_symm_apply] | |
| rfl | |
| end CoordinateSweeps.Grid | |
| namespace CoordinateSweeps.Grid.Holes | |
| variable {G : Grid} {h : β} (J : G.Holes h) | |
| def outputStabilizerEquiv (Οβ : {Ο : G.Choices // J.Compatible Ο}) : | |
| J.stabilizer β* Equiv.Perm (J.FreeAt (Fin.last G.b)) := | |
| J.stabilizerFreeEquiv.trans (J.freeBoundary Οβ (Fin.last _)).permCongrHom | |
| lemma outputStabilizer_residual (Οβ Ο : {Ο : G.Choices // J.Compatible Ο}) | |
| (x : J.FreeAt (Fin.last G.b)) : | |
| (J.outputStabilizerEquiv Οβ (J.residualWithReference Οβ Ο) x).val= | |
| G.sweep Ο.val ((G.sweep Οβ.val)β»ΒΉ x.val) := by | |
| change G.sweep Οβ.val (((G.sweep Οβ.val)β»ΒΉ*G.sweep Ο.val) ((G.sweep Οβ.val)β»ΒΉ x.val))=_ | |
| simp only [Equiv.Perm.mul_apply,Equiv.Perm.coe_inv,Equiv.apply_symm_apply] | |
| variable {A B : Grid} (H : (concat A B).Holes h) | |
| def junctionFreeEquiv : H.JunctionFix β* Equiv.Perm H.JunctionFree := | |
| Marked.freePermEquiv (fun i => H.path i (suffixTime A B 0)) | |
| lemma rowResidual_split (hf : H.Feasible) (Ο : H.RowChoices) (x : (concat A B).Slot) : | |
| splitSlots A B ((H.rowResidual hf Ο).val x)= | |
| (A.sweep (Ο (splitSlots A B x).2).val | |
| ((A.sweep ((H.refPair hf).1 (splitSlots A B x).2).val)β»ΒΉ (splitSlots A B x).1), | |
| (splitSlots A B x).2) := by | |
| change splitSlots A B (H.rowAction Ο ((H.rowAction (H.refPair hf).1)β»ΒΉ x))=_ | |
| rw [rowAction,rowSweep_apply] | |
| rw [rowAction,rowSweep_inv_apply] | |
| lemma columnResidual_split (hf : H.Feasible) (Ο : H.ColumnChoices) (x : (concat A B).Slot) : | |
| splitSlots A B ((H.columnResidual hf Ο).val x)= | |
| ((splitSlots A B x).1,(B.sweep ((H.refPair hf).2 (splitSlots A B x).1).val)β»ΒΉ | |
| (B.sweep (Ο (splitSlots A B x).1).val (splitSlots A B x).2)) := by | |
| change splitSlots A B ((H.columnAction (H.refPair hf).2)β»ΒΉ (H.columnAction Ο x))=_ | |
| rw [columnAction,columnSweep_inv_apply,columnAction,columnSweep_apply] | |
| lemma rowResidual_label (hf : H.Feasible) (Ο : H.RowChoices) (x : H.JunctionFree) : | |
| H.rowLabel (H.junctionFreeEquiv (H.rowResidual hf Ο) x)=H.rowLabel x := by | |
| have hh := congrArg Prod.snd (H.rowResidual_split hf Ο x.val) | |
| exact hh | |
| lemma columnResidual_label (hf : H.Feasible) (Ο : H.ColumnChoices) (x : H.JunctionFree) : | |
| H.columnLabel (H.junctionFreeEquiv (H.columnResidual hf Ο) x)=H.columnLabel x := by | |
| have hh := congrArg Prod.fst (H.columnResidual_split hf Ο x.val) | |
| exact hh | |
| /- Literal row-fiber permutation and the child's compatible residual agree in | |
| its output frame. -/ | |
| theorem rowResidual_fiber (hf : H.Feasible) (Ο : H.RowChoices) (y : B.Slot) | |
| (x : {x : H.JunctionFree // H.rowLabel x=y}) : | |
| H.freeRow y β¨H.junctionFreeEquiv (H.rowResidual hf Ο) x.val, | |
| (H.rowResidual_label hf Ο x.val).trans x.propertyβ©= | |
| (H.rowHoles y).outputStabilizerEquiv ((H.refPair hf).1 y) | |
| ((H.rowHoles y).residualWithReference ((H.refPair hf).1 y) (Ο y)) (H.freeRow y x) := by | |
| apply Subtype.ext | |
| rw [outputStabilizer_residual] | |
| change (splitSlots A B ((H.rowResidual hf Ο).val x.val.val)).1=_ | |
| rw [H.rowResidual_split] | |
| change A.sweep (Ο (H.rowLabel x.val)).val | |
| ((A.sweep ((H.refPair hf).1 (H.rowLabel x.val)).val)β»ΒΉ (splitSlots A B x.val.val).1)=_ | |
| rw [x.property] | |
| rfl | |
| /- Literal column-fiber permutation and the child's residual agree in its | |
| input frame; this is where the row/column orientations differ. -/ | |
| theorem columnResidual_fiber (hf : H.Feasible) (Ο : H.ColumnChoices) (y : A.Slot) | |
| (x : {x : H.JunctionFree // H.columnLabel x=y}) : | |
| H.freeColumn y β¨H.junctionFreeEquiv (H.columnResidual hf Ο) x.val, | |
| (H.columnResidual_label hf Ο x.val).trans x.propertyβ©= | |
| (H.columnHoles y).stabilizerFreeEquiv | |
| ((H.columnHoles y).residualWithReference ((H.refPair hf).2 y) (Ο y)) (H.freeColumn y x) := by | |
| apply Subtype.ext | |
| change (splitSlots A B ((H.columnResidual hf Ο).val x.val.val)).2=_ | |
| rw [H.columnResidual_split] | |
| change (B.sweep ((H.refPair hf).2 (H.columnLabel x.val)).val)β»ΒΉ | |
| (B.sweep (Ο (H.columnLabel x.val)).val (splitSlots A B x.val.val).2)=_ | |
| rw [x.property] | |
| rfl | |
| end CoordinateSweeps.Grid.Holes | |
| namespace CoordinateSweeps.Grid.Holes | |
| open FiberBlocks | |
| variable {A B : Grid} {h : β} (H : (concat A B).Holes h) | |
| def rowIndex (x : H.JunctionFree) : Fin (Fintype.card B.Slot) := Fintype.equivFin B.Slot (H.rowLabel x) | |
| def columnIndex (x : H.JunctionFree) : Fin (Fintype.card A.Slot) := Fintype.equivFin A.Slot (H.columnLabel x) | |
| def rowSite (_ : (concat A B).Holes h) (i : Fin (Fintype.card B.Slot)) : B.Slot := (Fintype.equivFin B.Slot).symm i | |
| def columnSite (_ : (concat A B).Holes h) (i : Fin (Fintype.card A.Slot)) : A.Slot := (Fintype.equivFin A.Slot).symm i | |
| def rowLocalChart (i : Fin (Fintype.card B.Slot)) : Fin (FiberBlocks.size H.rowIndex i) β | |
| (H.rowHoles (H.rowSite i)).FreeAt (Fin.last A.b) := | |
| (cards H.rowIndex i).trans ((Equiv.subtypeEquivRight (fun x => by | |
| exact (Fintype.equivFin B.Slot).eq_symm_apply.symm)).trans (H.freeRow (H.rowSite i))) | |
| def columnLocalChart (i : Fin (Fintype.card A.Slot)) : Fin (FiberBlocks.size H.columnIndex i) β | |
| (H.columnHoles (H.columnSite i)).FreeAt 0 := | |
| (cards H.columnIndex i).trans ((Equiv.subtypeEquivRight (fun x => by | |
| exact (Fintype.equivFin A.Slot).eq_symm_apply.symm)).trans (H.freeColumn (H.columnSite i))) | |
| def rowChildEquiv (hf : H.Feasible) (i : Fin (Fintype.card B.Slot)) : | |
| (H.rowHoles (H.rowSite i)).stabilizer β* Equiv.Perm (Fin (FiberBlocks.size H.rowIndex i)) := | |
| ((H.rowHoles (H.rowSite i)).outputStabilizerEquiv ((H.refPair hf).1 (H.rowSite i))).trans | |
| (H.rowLocalChart i).symm.permCongrHom | |
| def columnChildEquiv (i : Fin (Fintype.card A.Slot)) : | |
| (H.columnHoles (H.columnSite i)).stabilizer β* Equiv.Perm (Fin (FiberBlocks.size H.columnIndex i)) := | |
| (H.columnHoles (H.columnSite i)).stabilizerFreeEquiv.trans (H.columnLocalChart i).symm.permCongrHom | |
| lemma rowResidual_index (hf : H.Feasible) (Ο : H.RowChoices) (x : H.JunctionFree) : | |
| H.rowIndex (H.junctionFreeEquiv (H.rowResidual hf Ο) x)=H.rowIndex x := | |
| congrArg (Fintype.equivFin B.Slot) (H.rowResidual_label hf Ο x) | |
| lemma columnResidual_index (hf : H.Feasible) (Ο : H.ColumnChoices) (x : H.JunctionFree) : | |
| H.columnIndex (H.junctionFreeEquiv (H.columnResidual hf Ο) x)=H.columnIndex x := | |
| congrArg (Fintype.equivFin A.Slot) (H.columnResidual_label hf Ο x) | |
| theorem row_restrict_eq (hf : H.Feasible) (Ο : H.RowChoices) (i : Fin (Fintype.card B.Slot)) : | |
| restrict H.rowIndex (H.junctionFreeEquiv (H.rowResidual hf Ο)) (H.rowResidual_index hf Ο) i= | |
| H.rowChildEquiv hf i ((H.rowHoles (H.rowSite i)).residualWithReference | |
| ((H.refPair hf).1 (H.rowSite i)) (Ο (H.rowSite i))) := by | |
| apply Equiv.ext | |
| intro j | |
| apply (H.rowLocalChart i).injective | |
| have hh := H.rowResidual_fiber hf Ο (H.rowSite i) | |
| β¨(cards H.rowIndex i j).val,(Fintype.equivFin B.Slot).eq_symm_apply.mpr (cards H.rowIndex i j).propertyβ© | |
| change H.rowLocalChart i (restrict H.rowIndex _ _ i j)= | |
| H.rowLocalChart i ((H.rowLocalChart i).symm | |
| ((H.rowHoles (H.rowSite i)).outputStabilizerEquiv ((H.refPair hf).1 (H.rowSite i)) | |
| ((H.rowHoles (H.rowSite i)).residualWithReference ((H.refPair hf).1 (H.rowSite i)) (Ο (H.rowSite i))) | |
| (H.rowLocalChart i j))) | |
| rw [Equiv.apply_symm_apply] | |
| apply Subtype.ext | |
| have he := congrArg Subtype.val hh | |
| change (splitSlots A B (cards H.rowIndex i (restrict H.rowIndex _ _ i j)).val.val).1=_ | |
| rw [restrict_apply] | |
| exact he | |
| theorem column_restrict_eq (hf : H.Feasible) (Ο : H.ColumnChoices) (i : Fin (Fintype.card A.Slot)) : | |
| restrict H.columnIndex (H.junctionFreeEquiv (H.columnResidual hf Ο)) (H.columnResidual_index hf Ο) i= | |
| H.columnChildEquiv i ((H.columnHoles (H.columnSite i)).residualWithReference | |
| ((H.refPair hf).2 (H.columnSite i)) (Ο (H.columnSite i))) := by | |
| apply Equiv.ext | |
| intro j | |
| apply (H.columnLocalChart i).injective | |
| have hh := H.columnResidual_fiber hf Ο (H.columnSite i) | |
| β¨(cards H.columnIndex i j).val,(Fintype.equivFin A.Slot).eq_symm_apply.mpr (cards H.columnIndex i j).propertyβ© | |
| change H.columnLocalChart i (restrict H.columnIndex _ _ i j)= | |
| H.columnLocalChart i ((H.columnLocalChart i).symm | |
| ((H.columnHoles (H.columnSite i)).stabilizerFreeEquiv | |
| ((H.columnHoles (H.columnSite i)).residualWithReference ((H.refPair hf).2 (H.columnSite i)) (Ο (H.columnSite i))) | |
| (H.columnLocalChart i j))) | |
| rw [Equiv.apply_symm_apply] | |
| apply Subtype.ext | |
| have he := congrArg Subtype.val hh | |
| change (splitSlots A B (cards H.columnIndex i (restrict H.columnIndex _ _ i j)).val.val).2=_ | |
| rw [restrict_apply] | |
| exact he | |
| lemma rowResidual_as_fibers (hf : H.Feasible) (Ο : H.RowChoices) : | |
| H.junctionFreeEquiv (H.rowResidual hf Ο)=action H.rowIndex (fun i => | |
| H.rowChildEquiv hf i ((H.rowHoles (H.rowSite i)).residualWithReference | |
| ((H.refPair hf).1 (H.rowSite i)) (Ο (H.rowSite i)))) := by | |
| rw [β action_restrict H.rowIndex _ (H.rowResidual_index hf Ο)] | |
| congr 1 | |
| funext i | |
| exact H.row_restrict_eq hf Ο i | |
| lemma columnResidual_as_fibers (hf : H.Feasible) (Ο : H.ColumnChoices) : | |
| H.junctionFreeEquiv (H.columnResidual hf Ο)=action H.columnIndex (fun i => | |
| H.columnChildEquiv i ((H.columnHoles (H.columnSite i)).residualWithReference | |
| ((H.refPair hf).2 (H.columnSite i)) (Ο (H.columnSite i)))) := by | |
| rw [β action_restrict H.columnIndex _ (H.columnResidual_index hf Ο)] | |
| congr 1 | |
| funext i | |
| exact H.column_restrict_eq hf Ο i | |
| end CoordinateSweeps.Grid.Holes | |
| namespace CoordinateSweeps.Grid.Holes | |
| open FiberBlocks SignedTensor UnitaryIrrep | |
| variable {A B : Grid} {h : β} (H : (concat A B).Holes h) | |
| abbrev RowLocalChoices (i : Fin (Fintype.card B.Slot)) := | |
| {Ο : A.Choices // (H.rowHoles (H.rowSite i)).Compatible Ο} | |
| abbrev ColumnLocalChoices (i : Fin (Fintype.card A.Slot)) := | |
| {Ο : B.Choices // (H.columnHoles (H.columnSite i)).Compatible Ο} | |
| instance (i : Fin (Fintype.card B.Slot)) : Fintype (H.RowLocalChoices i) := Subtype.fintype _ | |
| instance (i : Fin (Fintype.card A.Slot)) : Fintype (H.ColumnLocalChoices i) := Subtype.fintype _ | |
| def rowChoiceFinEquiv : H.RowChoices β (β i, H.RowLocalChoices i) := | |
| (Equiv.piCongrLeft (fun y => {Ο : A.Choices // (H.rowHoles y).Compatible Ο}) | |
| (Fintype.equivFin B.Slot).symm).symm | |
| def columnChoiceFinEquiv : H.ColumnChoices β (β i, H.ColumnLocalChoices i) := | |
| (Equiv.piCongrLeft (fun x => {Ο : B.Choices // (H.columnHoles x).Compatible Ο}) | |
| (Fintype.equivFin A.Slot).symm).symm | |
| def rowLocalWeight (z : β) (i : Fin (Fintype.card B.Slot)) (Ο : H.RowLocalChoices i) : β := | |
| ((A.choiceWeight z Ο.val/(H.rowHoles (H.rowSite i)).probability z : β) : β) | |
| def columnLocalWeight (z : β) (i : Fin (Fintype.card A.Slot)) (Ο : H.ColumnLocalChoices i) : β := | |
| ((B.choiceWeight z Ο.val/(H.columnHoles (H.columnSite i)).probability z : β) : β) | |
| def rowLocalPerm (hf : H.Feasible) (i : Fin (Fintype.card B.Slot)) (Ο : H.RowLocalChoices i) := | |
| H.rowChildEquiv hf i ((H.rowHoles (H.rowSite i)).residualWithReference ((H.refPair hf).1 (H.rowSite i)) Ο) | |
| def columnLocalPerm (hf : H.Feasible) (i : Fin (Fintype.card A.Slot)) (Ο : H.ColumnLocalChoices i) := | |
| H.columnChildEquiv i ((H.columnHoles (H.columnSite i)).residualWithReference ((H.refPair hf).2 (H.columnSite i)) Ο) | |
| def junctionTensorAction (p : β) (e : Fin (Fintype.card H.JunctionFree) β H.JunctionFree) : | |
| H.JunctionFix β* Matrix (Word p (Fintype.card H.JunctionFree)) (Word p (Fintype.card H.JunctionFree)) β := | |
| (SignedTensor.action p _).comp (e.symm.permCongrHom.toMonoidHom.comp H.junctionFreeEquiv.toMonoidHom) | |
| theorem rowAverage_eq_ambient (p : β) (e : Fin (Fintype.card H.JunctionFree) β H.JunctionFree) | |
| (hf : H.Feasible) (z : β) : | |
| H.rowAverage hf z (H.junctionTensorAction p e)= | |
| ambientAverage (p := p) (FiberBlocks.size H.rowIndex) (total H.rowIndex) | |
| (regroup H.rowIndex e) (H.rowLocalWeight z) (H.rowLocalPerm hf) := by | |
| unfold rowAverage ambientAverage averageMatrix | |
| apply Fintype.sum_equiv H.rowChoiceFinEquiv | |
| intro Ο | |
| congr 1 | |
| Β· rw [Complex.ofReal_prod] | |
| exact ((Fintype.equivFin B.Slot).symm.prod_comp | |
| (fun y => ((A.choiceWeight z (Ο y).val/(H.rowHoles y).probability z : β) : β))).symm | |
| Β· change matrix (Equiv.permCongr e.symm (H.junctionFreeEquiv (H.rowResidual hf Ο)))=_ | |
| rw [H.rowResidual_as_fibers,ambient_action] | |
| rfl | |
| theorem columnAverage_eq_ambient (p : β) (e : Fin (Fintype.card H.JunctionFree) β H.JunctionFree) | |
| (hf : H.Feasible) (z : β) : | |
| H.columnAverage hf z (H.junctionTensorAction p e)= | |
| ambientAverage (p := p) (FiberBlocks.size H.columnIndex) (total H.columnIndex) | |
| (regroup H.columnIndex e) (H.columnLocalWeight z) (H.columnLocalPerm hf) := by | |
| unfold columnAverage ambientAverage averageMatrix | |
| apply Fintype.sum_equiv H.columnChoiceFinEquiv | |
| intro Ο | |
| congr 1 | |
| Β· rw [Complex.ofReal_prod] | |
| exact ((Fintype.equivFin A.Slot).symm.prod_comp | |
| (fun x => ((B.choiceWeight z (Ο x).val/(H.columnHoles x).probability z : β) : β))).symm | |
| Β· change matrix (Equiv.permCongr e.symm (H.junctionFreeEquiv (H.columnResidual hf Ο)))=_ | |
| rw [H.columnResidual_as_fibers,ambient_action] | |
| rfl | |
| theorem rowLocalMoment (hf : H.Feasible) (z : β) (q : β) (i : Fin (Fintype.card B.Slot)) | |
| (Ο : UnitaryIrrep (Equiv.Perm (Fin (FiberBlocks.size H.rowIndex i)))) : | |
| (Matrix.trace (((averageMatrix Ο.matrix (H.rowLocalWeight z i) (H.rowLocalPerm hf i)).conjTranspose* | |
| averageMatrix Ο.matrix (H.rowLocalWeight z i) (H.rowLocalPerm hf i))^q)).re= | |
| schattenMoment q ((H.rowHoles (H.rowSite i)).conditionalAverage | |
| (H.rowHoles (H.rowSite i)).feasible_of_disjoint z (Ο.pullback (H.rowChildEquiv hf i))) := by | |
| exact (H.rowHoles (H.rowSite i)).averageWithReference_moment | |
| (H.rowHoles (H.rowSite i)).feasible_of_disjoint ((H.refPair hf).1 (H.rowSite i)) z (Ο.pullback (H.rowChildEquiv hf i)) q | |
| theorem columnLocalMoment (hf : H.Feasible) (z : β) (q : β) (i : Fin (Fintype.card A.Slot)) | |
| (Ο : UnitaryIrrep (Equiv.Perm (Fin (FiberBlocks.size H.columnIndex i)))) : | |
| (Matrix.trace (((averageMatrix Ο.matrix (H.columnLocalWeight z i) (H.columnLocalPerm hf i)).conjTranspose* | |
| averageMatrix Ο.matrix (H.columnLocalWeight z i) (H.columnLocalPerm hf i))^q)).re= | |
| schattenMoment q ((H.columnHoles (H.columnSite i)).conditionalAverage | |
| (H.columnHoles (H.columnSite i)).feasible_of_disjoint z (Ο.pullback (H.columnChildEquiv i))) := by | |
| exact (H.columnHoles (H.columnSite i)).averageWithReference_moment | |
| (H.columnHoles (H.columnSite i)).feasible_of_disjoint ((H.refPair hf).2 (H.columnSite i)) z (Ο.pullback (H.columnChildEquiv i)) q | |
| end CoordinateSweeps.Grid.Holes | |
| namespace CoordinateSweeps | |
| open scoped ComplexOrder | |
| lemma evenTrace_real {n : Type*} [Fintype n] [DecidableEq n] | |
| (K : Matrix n n β) (q : β) : | |
| Matrix.trace ((K.conjTranspose*K)^q)=((Matrix.trace ((K.conjTranspose*K)^q)).re : β) := by | |
| have ht := ((Matrix.posSemidef_conjTranspose_mul_self K).pow q).trace_nonneg | |
| apply Complex.ext | |
| Β· rfl | |
| Β· simpa using ht.2.symm | |
| end CoordinateSweeps | |
| namespace CoordinateSweeps.Grid.Holes | |
| open FiberBlocks SignedTensor UnitaryIrrep | |
| variable {A B : Grid} {h : β} (H : (concat A B).Holes h) | |
| theorem row_projected_moment (p : β) (e : Fin (Fintype.card H.JunctionFree) β H.JunctionFree) | |
| (hf : H.Feasible) (z : β) {q : β} (hq : q β 0) | |
| (Ο : β i, UnitaryIrrep (Equiv.Perm (Fin (FiberBlocks.size H.rowIndex i)))) : | |
| let P := ambientProjector (p := p) (FiberBlocks.size H.rowIndex) (total H.rowIndex) (regroup H.rowIndex e) Ο | |
| let X := H.rowAverage hf z (H.junctionTensorAction p e) | |
| (Matrix.trace (((P*X).conjTranspose*(P*X))^q)).re= | |
| β i, (Module.finrank β ((Ο i).asRepresentation.IntertwiningMap | |
| (matrixRepresentation (SignedTensor.action p (FiberBlocks.size H.rowIndex i)))) : β)* | |
| schattenMoment q ((H.rowHoles (H.rowSite i)).conditionalAverage | |
| (H.rowHoles (H.rowSite i)).feasible_of_disjoint z ((Ο i).pullback (H.rowChildEquiv hf i))) := by | |
| dsimp only | |
| rw [H.rowAverage_eq_ambient,ambient_projected_moment _ _ _ _ _ _ hq] | |
| have he (i : Fin (Fintype.card B.Slot)) : | |
| Matrix.trace (((averageMatrix (Ο i).matrix (H.rowLocalWeight z i) (H.rowLocalPerm hf i)).conjTranspose* | |
| averageMatrix (Ο i).matrix (H.rowLocalWeight z i) (H.rowLocalPerm hf i))^q)= | |
| (schattenMoment q ((H.rowHoles (H.rowSite i)).conditionalAverage | |
| (H.rowHoles (H.rowSite i)).feasible_of_disjoint z ((Ο i).pullback (H.rowChildEquiv hf i))) : β) := by | |
| rw [evenTrace_real,H.rowLocalMoment] | |
| simp only [he,β Complex.ofReal_natCast,β Complex.ofReal_mul,β Complex.ofReal_prod,Complex.ofReal_re] | |
| theorem column_projected_moment (p : β) (e : Fin (Fintype.card H.JunctionFree) β H.JunctionFree) | |
| (hf : H.Feasible) (z : β) {q : β} (hq : q β 0) | |
| (Ο : β i, UnitaryIrrep (Equiv.Perm (Fin (FiberBlocks.size H.columnIndex i)))) : | |
| let P := ambientProjector (p := p) (FiberBlocks.size H.columnIndex) (total H.columnIndex) (regroup H.columnIndex e) Ο | |
| let Y := H.columnAverage hf z (H.junctionTensorAction p e) | |
| (Matrix.trace (((P*Y).conjTranspose*(P*Y))^q)).re= | |
| β i, (Module.finrank β ((Ο i).asRepresentation.IntertwiningMap | |
| (matrixRepresentation (SignedTensor.action p (FiberBlocks.size H.columnIndex i)))) : β)* | |
| schattenMoment q ((H.columnHoles (H.columnSite i)).conditionalAverage | |
| (H.columnHoles (H.columnSite i)).feasible_of_disjoint z ((Ο i).pullback (H.columnChildEquiv i))) := by | |
| dsimp only | |
| rw [H.columnAverage_eq_ambient,ambient_projected_moment _ _ _ _ _ _ hq] | |
| have he (i : Fin (Fintype.card A.Slot)) : | |
| Matrix.trace (((averageMatrix (Ο i).matrix (H.columnLocalWeight z i) (H.columnLocalPerm hf i)).conjTranspose* | |
| averageMatrix (Ο i).matrix (H.columnLocalWeight z i) (H.columnLocalPerm hf i))^q)= | |
| (schattenMoment q ((H.columnHoles (H.columnSite i)).conditionalAverage | |
| (H.columnHoles (H.columnSite i)).feasible_of_disjoint z ((Ο i).pullback (H.columnChildEquiv i))) : β) := by | |
| rw [evenTrace_real,H.columnLocalMoment] | |
| simp only [he,β Complex.ofReal_natCast,β Complex.ofReal_mul,β Complex.ofReal_prod,Complex.ofReal_re] | |
| end CoordinateSweeps.Grid.Holes | |
| namespace CoordinateSweeps.Grid.Holes | |
| open FiberBlocks SignedTensor UnitaryIrrep | |
| variable {A B : Grid} {h : β} (H : (concat A B).Holes h) | |
| lemma row_size_le (i : Fin (Fintype.card B.Slot)) : FiberBlocks.size H.rowIndex i β€ A.size := by | |
| have hc := Fintype.card_congr (H.rowLocalChart i) | |
| rw [Fintype.card_fin,(H.rowHoles (H.rowSite i)).card_freeAt] at hc | |
| rw [hc] | |
| exact Nat.sub_le _ _ | |
| lemma column_size_le (i : Fin (Fintype.card A.Slot)) : FiberBlocks.size H.columnIndex i β€ B.size := by | |
| have hc := Fintype.card_congr (H.columnLocalChart i) | |
| rw [Fintype.card_fin,(H.columnHoles (H.columnSite i)).card_freeAt] at hc | |
| rw [hc] | |
| exact Nat.sub_le _ _ | |
| theorem row_moment_bound (p : β) (e : Fin (Fintype.card H.JunctionFree) β H.JunctionFree) | |
| (hf : H.Feasible) (z : β) {q : β} (hq : q β 0) | |
| (Ο : β i, UnitaryIrrep (Equiv.Perm (Fin (FiberBlocks.size H.rowIndex i)))) | |
| (E : Fin (Fintype.card B.Slot) β β) | |
| (hE : β i, schattenMoment q ((H.rowHoles (H.rowSite i)).conditionalAverage | |
| (H.rowHoles (H.rowSite i)).feasible_of_disjoint z ((Ο i).pullback (H.rowChildEquiv hf i))) β€ Real.exp (E i)) : | |
| let P := ambientProjector (p := p) (FiberBlocks.size H.rowIndex) (total H.rowIndex) (regroup H.rowIndex e) Ο | |
| let X := H.rowAverage hf z (H.junctionTensorAction p e) | |
| (Matrix.trace (((P*X).conjTranspose*(P*X))^q)).re β€ | |
| ((A.size+1 : β) : β)^(B.size*((2*p)*(2*p)))*Real.exp (β i, E i) := by | |
| dsimp only | |
| rw [H.row_projected_moment p e hf z hq Ο] | |
| simpa only [card_slot] using child_product_bound (FiberBlocks.size H.rowIndex) A.size | |
| H.row_size_le Ο _ E (fun i => (H.rowHoles (H.rowSite i)).conditionalMoment_nonneg _ _ _ _) hE | |
| theorem column_moment_bound (p : β) (e : Fin (Fintype.card H.JunctionFree) β H.JunctionFree) | |
| (hf : H.Feasible) (z : β) {q : β} (hq : q β 0) | |
| (Ο : β i, UnitaryIrrep (Equiv.Perm (Fin (FiberBlocks.size H.columnIndex i)))) | |
| (E : Fin (Fintype.card A.Slot) β β) | |
| (hE : β i, schattenMoment q ((H.columnHoles (H.columnSite i)).conditionalAverage | |
| (H.columnHoles (H.columnSite i)).feasible_of_disjoint z ((Ο i).pullback (H.columnChildEquiv i))) β€ Real.exp (E i)) : | |
| let P := ambientProjector (p := p) (FiberBlocks.size H.columnIndex) (total H.columnIndex) (regroup H.columnIndex e) Ο | |
| let Y := H.columnAverage hf z (H.junctionTensorAction p e) | |
| (Matrix.trace (((Y*P).conjTranspose*(Y*P))^q)).re β€ | |
| ((B.size+1 : β) : β)^(A.size*((2*p)*(2*p)))*Real.exp (β i, E i) := by | |
| dsimp only | |
| have hc : _*_=_*_ := ambientProjector_commute_average (p := p) (FiberBlocks.size H.columnIndex) | |
| (total H.columnIndex) (regroup H.columnIndex e) Ο (H.columnLocalWeight z) (H.columnLocalPerm hf) | |
| rw [β H.columnAverage_eq_ambient] at hc | |
| rw [β hc,H.column_projected_moment p e hf z hq Ο] | |
| simpa only [card_slot] using child_product_bound (FiberBlocks.size H.columnIndex) B.size | |
| H.column_size_le Ο _ E (fun i => (H.columnHoles (H.columnSite i)).conditionalMoment_nonneg _ _ _ _) hE | |
| end CoordinateSweeps.Grid.Holes | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| open scoped Matrix.Norms.L2Operator | |
| end OAI | |