Download data/lean/OAI/Probability/BinarySweep/GridBounds/GridProjectedMoment.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 9.35 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/BinarySweep/GridBounds/GridProjectedMoment.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Probability/BinarySweep/GridBounds/GridProjectedMoment.lean
-
curl -L -o GridProjectedMoment.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/BinarySweep/GridBounds/GridProjectedMoment.lean
9.35 kB
| import Mathlib | |
| import OAI.Probability.BinarySweep.GridBounds.ProjectionSplitting | |
| import OAI.Probability.BinarySweep.GridBounds.GroupedLogBounds | |
| import OAI.Probability.BinarySweep.GridBounds.GridBoardAverage | |
| import OAI.Probability.BinarySweep.FiniteLaws.SampleMoment | |
| namespace OAI | |
| noncomputable section | |
| section | |
| open scoped BigOperators Classical | |
| namespace BinaryCoordinateSweeps.GridSplit | |
| open Irrep Representation Signed TraceHolder Density | |
| variable {m n h : β} (bits : Fin (m+n) β β) (H : PathFamily bits h) | |
| {A : Type*} [Fintype A] [DecidableEq A] | |
| local instance : LinearOrder (GridSlot (rightBits bits)) := rowOrder bits | |
| local instance : LinearOrder (GridSlot (leftBits bits)) := columnOrder bits | |
| def junctionAverage (p : A β Bool) (z : β) := | |
| sampleMatrix p (fun a => (conditionalGroupLaw H z a:β)) (inputToJunction bits H).permCongr | |
| def junctionFrame (p : A β Bool) := | |
| actionMatrix p ((inputToJunction bits H).permCongr (framePermutation bits H)) | |
| lemma junctionAverage_linear (p : A β Bool) (z : β) : | |
| (junctionAverage bits H p z).toEuclideanLin= | |
| groupAverage (junctionTensorRep bits H p) (fun a => (conditionalGroupLaw H z a:β)) := by | |
| exact sampleMatrix_linear p _ _ | |
| lemma junctionAverage_split (p : A β Bool) (z : β) : | |
| junctionAverage bits H p z=junctionFrame bits H p*columnMatrix bits H p z*rowMatrix bits H p z := by | |
| apply Matrix.toEuclideanLin.injective | |
| rw [junctionAverage_linear,groupAverage_split,rowAverage_matrix,columnAverage_matrix] | |
| simp only [Matrix.toLpLin_mul_same,βModule.mul_eq_comp,junctionFrame,actionMatrix_linear] | |
| rfl | |
| variable {V : Type*} [NormedAddCommGroup V] [InnerProductSpace β V] [FiniteDimensional β V] | |
| (Ο : Representation β (Equiv.Perm (Fin (junctionSize bits H))) V) | |
| omit [FiniteDimensional β V] in | |
| lemma projection_commutes_column (p : A β Bool) (z : β) : | |
| isotypicProjection p Ο*columnMatrix bits H p z=columnMatrix bits H p z*isotypicProjection p Ο := by | |
| unfold columnMatrix | |
| rw [groupedAverage_law] | |
| simp only [Finset.mul_sum,Finset.sum_mul,mul_smul_comm,smul_mul_assoc,typeProjection_commutes_action] | |
| omit [FiniteDimensional β V] in | |
| lemma junction_projected_moment (p : A β Bool) (z : β) (q : β) : | |
| matrixMoment q (isotypicProjection p Ο*junctionAverage bits H p z)= | |
| matrixMoment q (columnMatrix bits H p z*isotypicProjection p Ο*rowMatrix bits H p z) := by | |
| rw [junctionAverage_split,βmul_assoc,βmul_assoc] | |
| have hu : isotypicProjection p Ο*junctionFrame bits H p= | |
| junctionFrame bits H p*isotypicProjection p Ο := typeProjection_commutes_action p Ο _ | |
| rw [hu,mul_assoc (junctionFrame bits H p),projection_commutes_column, | |
| mul_assoc (junctionFrame bits H p)] | |
| rw [matrixMoment_linear,matrixMoment_linear,Matrix.toLpLin_mul_same, | |
| βModule.mul_eq_comp] | |
| apply evenMoment_unitary_left | |
| change (Matrix.toEuclideanLin (junctionFrame bits H p)).adjoint* | |
| Matrix.toEuclideanLin (junctionFrame bits H p)=1 | |
| unfold junctionFrame | |
| rw [actionMatrix_linear,unitary_rep_adjoint _ (hilbertTensorRep_unitary p),βmap_mul, | |
| inv_mul_cancel,map_one] | |
| theorem conditional_le_junction [Ο.IsIrreducible] | |
| (hΟ : βg v, βΟ g vβ=βvβ) (p : A β Bool) | |
| (hocc : 0<Module.finrank β (IntertwiningMap Ο (hilbertTensorRep p (junctionSize bits H)))) | |
| (z : β) {q : β} (hq : 0<q) : | |
| evenMoment q (groupAverage (Ο.comp (inputToJunction bits H).permCongrHom.toMonoidHom) | |
| (fun a => (conditionalGroupLaw H z a:β)))β€ | |
| matrixMoment q (columnMatrix bits H p z*isotypicProjection p Ο*rowMatrix bits H p z) := by | |
| rw [βjunction_projected_moment bits H Ο p z q] | |
| exact sampleMoment_le_projected p Ο hΟ hocc _ _ hq | |
| end BinaryCoordinateSweeps.GridSplit | |
| end | |
| open scoped BigOperators Classical Matrix.Norms.L2Operator | |
| namespace BinaryCoordinateSweeps.Signed | |
| open Irrep Representation TraceHolder | |
| variable {A I J : Type*} [Fintype A] [DecidableEq A] [Nonempty A] | |
| [Fintype I] [LinearOrder I] [Nonempty I] [Fintype J] [LinearOrder J] | |
| {n : I β β} {m : J β β} {N : β} | |
| def typeF {n : β} (Ξ± : n.Partition) : β := Real.log (Module.finrank β (Young.PartitionHilbert Ξ±):β) | |
| def blockLogSize {I : Type*} [Fintype I] (n : I β β) : β := βi, Real.log (n i+1:β) | |
| omit [Nonempty A] [Nonempty I] in | |
| lemma blockActive_card_exp (p : A β Bool) : | |
| (Fintype.card (βi, ActiveType p (n i)):β)β€ | |
| Real.exp ((Fintype.card A:β)^2*blockLogSize n) := by | |
| have hc : (Fintype.card (βi, ActiveType p (n i)):β)β€βi,(n i+1:β)^((Fintype.card A)^2) := by | |
| exact_mod_cast blockActive_card (n:=n) p | |
| refine hc.trans_eq ?_ | |
| rw [blockLogSize,Finset.mul_sum,Real.exp_sum] | |
| apply Finset.prod_congr rfl | |
| intro i _ | |
| exact_mod_cast natShift_pow_exp (n i) ((Fintype.card A)^2) | |
| theorem grouped_dense_bound | |
| {W : Type*} [NormedAddCommGroup W] [InnerProductSpace β W] [FiniteDimensional β W] | |
| (board : Fin N βͺ I Γ J) (p : A β Bool) | |
| (eR : (Ξ£β i, Fin (n i)) βo Fin N) (eC : (Ξ£β j, Fin (m j)) βo Fin N) | |
| (gR gC : Equiv.Perm (Fin N)) | |
| (hR : βt, groupOf eR gR t=(board t).1) (hC : βt, groupOf eC gC t=(board t).2) | |
| (Ο : Representation β (Equiv.Perm (Fin N)) W) [Ο.IsIrreducible] | |
| (wR : βi, Equiv.Perm (Fin (n i)) β β) (wC : βj, Equiv.Perm (Fin (m j)) β β) | |
| {q : β} (hq : 0<q) (c : β) (hc : 0β€c) (hcq : cβ€q) | |
| (ER : I β β) (EC : J β β) | |
| (hchildR : βi (a : ActiveType p (n i)), | |
| evenMoment q (groupAverage (Young.partitionHilbertRep a.val) (wR i))β€Real.exp (-c*typeF a.val+ER i)) | |
| (hchildC : βj (a : ActiveType p (m j)), | |
| evenMoment q (groupAverage (Young.partitionHilbertRep a.val) (wC j))β€Real.exp (-c*typeF a.val+EC j)) : | |
| matrixMoment q (groupedAverage eC gC p wC*isotypicProjection p Ο*groupedAverage eR gR p wR) β€ | |
| Real.exp (-c*Real.log (Module.finrank β W:β)+(βi, ER i)+(βj, EC j)+ | |
| c*(Fintype.card I*Fintype.card J-(N:β))+ | |
| (1+4*c+2*(q:β))*(Fintype.card A:β)^2*(blockLogSize n+blockLogSize m)) := by | |
| let R := fun a : βi, ActiveType p (n i) => | |
| groupedProjection eR gR p (fun i => Young.partitionHilbertRep (a i).val) | |
| let C := fun a : βj, ActiveType p (m j) => | |
| groupedProjection eC gC p (fun j => Young.partitionHilbertRep (a j).val) | |
| let FR := fun a : βi, ActiveType p (n i) => βi, typeF (a i).val | |
| let FC := fun a : βj, ActiveType p (m j) => βj, typeF (a j).val | |
| let L := blockLogSize n+blockLogSize m | |
| let D : β := (Fintype.card A:β)^2 | |
| let E := (βi, ER i)+(βj, EC j)+D*L | |
| have hchild (a : βi, ActiveType p (n i)) (b : βj, ActiveType p (m j)) : | |
| matrixMoment q (groupedAverage eC gC p wC*C b)* | |
| matrixMoment q (R a*groupedAverage eR gR p wR)β€Real.exp (-c*(FR a+FC b)+E) := by | |
| have hr := grouped_projected_exp_bound eR gR p | |
| (fun i => Young.partitionHilbertRep (a i).val) | |
| (fun i => Young.partitionHilbertRep_unitary (a i).val) wR hq | |
| (fun i => -c*typeF (a i).val+ER i) (fun i => hchildR i (a i)) | |
| have ht := grouped_projected_exp_bound eC gC p | |
| (fun j => Young.partitionHilbertRep (b j).val) | |
| (fun j => Young.partitionHilbertRep_unitary (b j).val) wC hq | |
| (fun j => -c*typeF (b j).val+EC j) (fun j => hchildC j (b j)) | |
| rw [groupedProjection_commutes_average] at ht | |
| refine (mul_le_mul ht hr (matrixMoment_nonneg _ _) (Real.exp_pos _).le).trans_eq ?_ | |
| rw [βReal.exp_add] | |
| congr 1 | |
| simp only [FR,FC,E,D,L,blockLogSize,Finset.sum_add_distrib, | |
| βFinset.mul_sum,Nat.cast_pow] | |
| ring | |
| have ho (a : βi, ActiveType p (n i)) (b : βj, ActiveType p (m j)) : | |
| βC b*isotypicProjection p Ο*R aβ^2β€Real.exp | |
| (FR a+FC b-Real.log (Module.finrank β W:β)+ | |
| (Fintype.card I*Fintype.card J-(N:β))+4*D*L) := by | |
| exact actual_board_overlap_exp board p eR eC gR gC hR hC Ο | |
| (fun i => Young.partitionHilbertRep (a i).val) (fun j => Young.partitionHilbertRep (b j).val) | |
| have hk (a : βi, ActiveType p (n i)) (b : βj, ActiveType p (m j)) : | |
| βC b*isotypicProjection p Ο*R aββ€1 := | |
| groupedProjection_overlap_contract eR eC gR gC p Ο | |
| (fun i => Young.partitionHilbertRep (a i).val) (fun j => Young.partitionHilbertRep (b j).val) | |
| have hb := matrixMoment_dense_exponential hq (groupedAverage eR gR p wR) | |
| (groupedAverage eC gC p wC) (isotypicProjection p Ο) R C | |
| (fun a => groupedProjection_idempotent eR gR p _) (fun b => groupedProjection_idempotent eC gC p _) | |
| (groupedActive_projection_sum eR gR p) (groupedActive_projection_sum eC gC p) | |
| FR FC c (Real.log (Module.finrank β W:β)) (Fintype.card I*Fintype.card J-(N:β)) | |
| E (4*D*L) hc hcq hchild ho hk | |
| have hn : ((Fintype.card (βi, ActiveType p (n i))*Fintype.card (βj, ActiveType p (m j)):β):β) β€ | |
| Real.exp (D*L) := by | |
| rw [Nat.cast_mul] | |
| refine (mul_le_mul (blockActive_card_exp (n:=n) p) (blockActive_card_exp (n:=m) p) | |
| (by positivity) (Real.exp_pos _).le).trans_eq ?_ | |
| rw [βReal.exp_add] | |
| congr 1 | |
| dsimp [D,L] | |
| ring | |
| refine hb.trans ((mul_le_mul_of_nonneg_right (pow_le_pow_leftβ (by positivity) hn (2*q)) | |
| (Real.exp_pos _).le).trans_eq ?_) | |
| rw [βReal.exp_nat_mul,βReal.exp_add] | |
| congr 1 | |
| dsimp [E,D,L] | |
| push_cast | |
| ring | |
| end BinaryCoordinateSweeps.Signed | |
| end | |
| end OAI | |