Download data/lean/OAI/RepresentationTheory/RowColumn/Occupied.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 13.2 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/RepresentationTheory/RowColumn/Occupied.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/RepresentationTheory/RowColumn/Occupied.lean
-
curl -L -o Occupied.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/RepresentationTheory/RowColumn/Occupied.lean
13.2 kB
| import OAI.RepresentationTheory.RowColumn.OverlapBound | |
| import OAI.Probability.CubeShuffle.FourierBound | |
| namespace OAI | |
| section | |
| noncomputable section | |
| open scoped BigOperators Classical | |
| namespace RowColumn | |
| /-- Absorption of the exact polynomial loss into the absolute occupied-board | |
| constant. This is used for both halves of the min. -/ | |
| lemma occupied_numeric_absorb (m n h s : β) (hh : 1 β€ h) (hs : s β€ m*n) : | |
| 16 * ((s : β)+1)^((16*(m+n)+8)*h^2) * Real.exp ((m*n-s : β) : β) β€ | |
| Real.exp (128 * (((m+n+1 : β) : β)*(h : β)^2 * Real.log ((m*n : β)+2) + | |
| (m*n-s : β))) := by | |
| let N : β := (m*n : β)+2 | |
| let E : β := (16*(m+n)+8)*h^2 | |
| have hN : 2 β€ N := by dsimp [N]; have := (Nat.cast_nonneg (m*n) : (0 : β) β€ (m*n : β)); linarith | |
| have hNp : 0 < N := lt_of_lt_of_le (by norm_num) hN | |
| have hb : 0 β€ (s : β)+1 := by positivity | |
| have hbs : (s : β)+1 β€ N := by dsimp [N]; exact_mod_cast (by omega : s+1 β€ m*n+2) | |
| have h16 : (16 : β) β€ N^4 := by | |
| calc 16 = (2 : β)^4 := by norm_num | |
| _ β€ N^4 := pow_le_pow_leftβ (by norm_num) hN _ | |
| have hp : 16 * ((s : β)+1)^E β€ N^(E+4) := by | |
| calc _ β€ N^4 * N^E := mul_le_mul h16 (pow_le_pow_leftβ hb hbs _) (by positivity) (by positivity) | |
| _ = N^(E+4) := by rw [pow_add]; ring | |
| have hh2 : (1 : β) β€ (h : β)^2 := by exact_mod_cast (Nat.one_le_pow 2 h hh) | |
| have he : ((E+4 : β) : β) β€ 128*((m+n+1 : β) : β)*(h : β)^2 := by | |
| dsimp [E] | |
| push_cast | |
| nlinarith [sq_nonneg (h : β), mul_nonneg (show 0 β€ (m:β)+(n:β) by positivity) (sq_nonneg (h:β))] | |
| have hl : 0 β€ Real.log N := Real.log_nonneg (by linarith) | |
| have ht : (0 : β) β€ (m*n-s : β) := Nat.cast_nonneg _ | |
| have hexp : N^(E+4) = Real.exp (((E+4 : β) : β)*Real.log N) := by | |
| rw [Real.exp_nat_mul, Real.exp_log hNp] | |
| change 16 * ((s : β)+1)^E * Real.exp ((m*n-s : β) : β) β€ _ | |
| calc | |
| _ β€ N^(E+4) * Real.exp ((m*n-s : β) : β) := mul_le_mul_of_nonneg_right hp (Real.exp_pos _).le | |
| _ = Real.exp (((E+4 : β) : β)*Real.log N + (m*n-s : β)) := by rw [hexp, Real.exp_add] | |
| _ β€ _ := by | |
| apply Real.exp_le_exp.mpr | |
| change ((E+4 : β) : β)*Real.log N + (m*n-s : β) β€ | |
| 128 * (((m+n+1 : β) : β)*(h : β)^2 * Real.log N + (m*n-s : β)) | |
| nlinarith [mul_le_mul_of_nonneg_right he hl] | |
| end RowColumn | |
| end | |
| end | |
| section | |
| noncomputable section | |
| open scoped BigOperators Classical | |
| namespace RowColumn | |
| lemma occupied_factor_bound (s m n h u v D : β) (t : β) | |
| (hu : u β€ (s+1)^(4*m*h^2)) (hv : v β€ (s+1)^(4*n*h^2)) | |
| (hD : D β€ (s+1)^(4*h^2)) : | |
| 16 * ((s+1 : β) : β)^(4*m*h^2*3) * ((s+1 : β) : β)^(4*n*h^2*3) * | |
| (D : β)^2 * Real.exp t * u * v β€ | |
| 16 * ((s : β)+1)^((16*(m+n)+8)*h^2) * Real.exp t := by | |
| have hu' : (u : β) β€ ((s : β)+1)^(4*m*h^2) := by exact_mod_cast hu | |
| have hv' : (v : β) β€ ((s : β)+1)^(4*n*h^2) := by exact_mod_cast hv | |
| have hD' : (D : β) β€ ((s : β)+1)^(4*h^2) := by exact_mod_cast hD | |
| calc | |
| _ β€ 16 * ((s : β)+1)^(4*m*h^2*3) * ((s : β)+1)^(4*n*h^2*3) * | |
| (((s : β)+1)^(4*h^2))^2 * Real.exp t * ((s : β)+1)^(4*m*h^2) * | |
| ((s : β)+1)^(4*n*h^2) := by | |
| push_cast | |
| gcongr | |
| _ = _ := by | |
| rw [show (16*(m+n)+8)*h^2 = 4*m*h^2*3 + 4*n*h^2*3 + (4*h^2)*2 + 4*m*h^2 + 4*n*h^2 by ring] | |
| simp only [pow_add, pow_mul] | |
| ring | |
| lemma occupied_count_bound (s m n h u v : β) (t : β) (ht : 0 β€ t) | |
| (hu : u β€ (s+1)^(4*m*h^2)) (hv : v β€ (s+1)^(4*n*h^2)) : | |
| (u : β)*v β€ 16 * ((s : β)+1)^((16*(m+n)+8)*h^2) * Real.exp t := by | |
| have huv : (u : β)*v β€ ((s : β)+1)^(4*(m+n)*h^2) := by | |
| have hu' : (u : β) β€ ((s : β)+1)^(4*m*h^2) := by exact_mod_cast hu | |
| have hv' : (v : β) β€ ((s : β)+1)^(4*n*h^2) := by exact_mod_cast hv | |
| calc _ β€ ((s : β)+1)^(4*m*h^2) * ((s : β)+1)^(4*n*h^2) := | |
| mul_le_mul hu' hv' (by positivity) (by positivity) | |
| _ = _ := by rw [β pow_add]; congr 1; ring | |
| have he : 4*(m+n)*h^2 β€ (16*(m+n)+8)*h^2 := Nat.mul_le_mul_right _ (by omega) | |
| have hb : 1 β€ (s : β)+1 := by have := Nat.cast_nonneg (Ξ± := β) s; linarith | |
| have hp := pow_le_pow_rightβ hb he | |
| have hx : 1 β€ Real.exp t := Real.one_le_exp_iff.mpr ht | |
| have hbase : 0 β€ ((s : β)+1)^((16*(m+n)+8)*h^2) := by positivity | |
| calc _ β€ ((s : β)+1)^((16*(m+n)+8)*h^2) := huv.trans hp | |
| _ β€ _ := by nlinarith [mul_le_mul_of_nonneg_left hx hbase] | |
| end RowColumn | |
| end | |
| end | |
| section | |
| noncomputable section | |
| open scoped BigOperators Classical | |
| namespace RowColumn | |
| open CubeShuffle.Specht Signed MatrixState | |
| lemma irreducible_nontrivial {G V : Type*} [Group G] [AddCommGroup V] [Module β V] | |
| (Ο : Representation β G V) [Representation.IsIrreducible Ο] : Nontrivial V := by | |
| let := IsSimpleModule.nontrivial (MonoidAlgebra β G) Ο.asModule | |
| exact Ο.asModuleEquiv.symm.toEquiv.nontrivial | |
| lemma empty_hook_dimension_le (a : YoungDiagram) (h : β) (H : InHook a h) | |
| (ha : Fintype.card (Cell a)=0) : Module.finrank β (space a) β€ 1 := by | |
| have hi := LinearMap.finrank_le_finrank_of_injective (HookModel.hookEmbedding_injective a h H) | |
| change Module.finrank β (space a) β€ | |
| Module.finrank β (EuclideanSpace β (Words (S := Cell a) (HookModel.IsOdd (h := h)) (HookModel.oddCount a h H))) at hi | |
| rw [finrank_euclideanSpace] at hi | |
| calc _ β€ Fintype.card (Words (S := Cell a) (HookModel.IsOdd (h := h)) (HookModel.oddCount a h H)) := hi | |
| _ β€ Fintype.card (Cell a β HookModel.Color h) := Fintype.card_subtype_le _ | |
| _ = 1 := by rw [Fintype.card_fun, ha, pow_zero] | |
| lemma hook_lineCost {S L : Type*} [Fintype S] [Fintype L] (h : β) : | |
| lineCost (S := S) (C := HookModel.Color h) (L := L) = | |
| (Fintype.card S+1)^(4*Fintype.card L*h^2) := by | |
| simp only [lineCost, HookModel.Color, Fintype.card_sum, Fintype.card_fin] | |
| congr 1 | |
| ring | |
| lemma hook_sectorAlgebra_bound {S : Type*} [Fintype S] [DecidableEq S] (h k : β) : | |
| Module.finrank β (sectorAlgebra (S := S) (HookModel.IsOdd (h := h)) k) β€ | |
| (Fintype.card S+1)^(4*h^2) := by | |
| have hh := sectorAlgebra_finrank (S := S) (HookModel.IsOdd (h := h)) k | |
| simpa only [HookModel.Color, Fintype.card_sum, Fintype.card_fin, show (h+h)^2=4*h^2 by ring] using hh | |
| end RowColumn | |
| end | |
| end | |
| section | |
| noncomputable section | |
| open scoped BigOperators Classical | |
| namespace RowColumn | |
| open CubeShuffle.Specht CubeShuffle.UnitaryFinite Signed MatrixState | |
| /-- The dimension-ratio half of the occupied main, now for the literal occupied | |
| subset and all prescribed row and column embeddings. -/ | |
| theorem occupied_dimension_ratio (m n : β) (Ξ© : Finset (Board m n)) [Nonempty Ξ©] | |
| (a : YoungDiagram) (e : Ξ© β Cell a) (h : β) (hh : 1 β€ h) (H : InHook a h) | |
| (r c u v : β) | |
| (Ο : Representation β (rowGroup Ξ©) (EuclideanSpace β (Fin r))) | |
| (Ο : Representation β (columnGroup Ξ©) (EuclideanSpace β (Fin c))) | |
| (hΟ : IsUnitary Ο) (hΟ : IsUnitary Ο) | |
| (I : Fin u β EuclideanSpace β (Fin r) ββα΅’[β] hilbertSpace a) | |
| (J : Fin v β EuclideanSpace β (Fin c) ββα΅’[β] hilbertSpace a) | |
| (hI : β i, Intertwines (V := EuclideanSpace β (Fin r)) (W := hilbertSpace a) | |
| Ο ((relabelledUnitary a e).comp (rowGroup Ξ©).subtype) (I i).toLinearMap) | |
| (hJ : β i, Intertwines (V := EuclideanSpace β (Fin c)) (W := hilbertSpace a) | |
| Ο ((relabelledUnitary a e).comp (columnGroup Ξ©).subtype) (J i).toLinearMap) | |
| (hu : u β€ (Ξ©.card+1)^(4*m*h^2)) (hv : v β€ (Ξ©.card+1)^(4*n*h^2)) : | |
| allCopyOverlap (V := EuclideanSpace β (Fin r)) (W := EuclideanSpace β (Fin c)) | |
| (X := hilbertSpace a) I J β€ | |
| (16 * ((Ξ©.card : β)+1)^((16*(m+n)+8)*h^2) * Real.exp ((m*n-Ξ©.card : β) : β)) * | |
| ((r : β)*c / Module.finrank β (space a)) := by | |
| let board : Ξ© βͺ Fin m Γ Fin n := β¨Subtype.val, Subtype.val_injectiveβ© | |
| let cβ : HookModel.Color h := Sum.inl β¨0, by omegaβ© | |
| have ha := actual_copy_overlap_bound (V := EuclideanSpace β (Fin r)) | |
| (W := EuclideanSpace β (Fin c)) board a e h H cβ Ο Ο hΟ hΟ I J hI hJ | |
| have hc : Fintype.card (Cell a) = Ξ©.card := (Fintype.card_congr e).symm.trans (Fintype.card_coe Ξ©) | |
| have hD := hook_sectorAlgebra_bound (S := Cell a) h (HookModel.oddCount a h H) | |
| rw [hc] at hD | |
| let D := Module.finrank β (sectorAlgebra (S := Cell a) (HookModel.IsOdd (h := h)) (HookModel.oddCount a h H)) | |
| have hp := occupied_factor_bound Ξ©.card m n h u v D ((m*n-Ξ©.card : β) : β) hu hv hD | |
| have hratio : 0 β€ (r : β)*c / (Module.finrank β (space a) : β) := by positivity | |
| have hmul := mul_le_mul_of_nonneg_right hp hratio | |
| simp only [hook_lineCost, hc, Fintype.card_fin, Fintype.card_coe, finrank_euclideanSpace, | |
| Nat.cast_mul, Nat.cast_pow, β pow_mul] at ha | |
| apply ha.trans | |
| convert hmul using 1; dsimp [D]; ring | |
| end RowColumn | |
| end | |
| end | |
| section | |
| noncomputable section | |
| open scoped BigOperators Classical | |
| namespace RowColumn | |
| open CubeShuffle.Specht CubeShuffle.UnitaryFinite Signed MatrixState | |
| /-- `thm:occupied` (weighted.tex:76β84), including the empty occupied subset, | |
| arbitrary deletion layout and every orthogonal multiplicity copy. The absolute | |
| constant is 128; dimensions, unnormalized trace and operator norm are literal. -/ | |
| theorem occupied_overlap_endpoint : OccupiedOverlapEndpoint := by | |
| refine β¨128, by norm_num, ?_β© | |
| intro m n Ξ© a e h hh hN H r c u v Ο Ο hirΟ hirΟ hΟ hΟ I J hI hJ | |
| let : Representation.IsIrreducible Ο := hirΟ | |
| let : Representation.IsIrreducible Ο := hirΟ | |
| let : Nontrivial (EuclideanSpace β (Fin r)) := irreducible_nontrivial Ο | |
| let : Nontrivial (EuclideanSpace β (Fin c)) := irreducible_nontrivial Ο | |
| have hu : u β€ (Ξ©.card+1)^(4*m*h^2) := by | |
| simpa only [Fintype.card_coe, Fintype.card_fin] using | |
| hook_line_copy_count (V := EuclideanSpace β (Fin r)) (fun x : Ξ© => x.1.1) a e h H Ο hΟ I hI | |
| have hv : v β€ (Ξ©.card+1)^(4*n*h^2) := by | |
| simpa only [Fintype.card_coe, Fintype.card_fin] using | |
| hook_line_copy_count (V := EuclideanSpace β (Fin c)) (fun x : Ξ© => x.1.2) a e h H Ο hΟ J hJ | |
| let loss : β := 16 * ((Ξ©.card : β)+1)^((16*(m+n)+8)*h^2) * Real.exp ((m*n-Ξ©.card : β) : β) | |
| let ratio : β := (r : β)*c / Module.finrank β (space a) | |
| have hloss : 0 β€ loss := by dsimp [loss]; positivity | |
| have hratio : 0 β€ ratio := by dsimp [ratio]; positivity | |
| have hplain : allCopyOverlap (V := EuclideanSpace β (Fin r)) (W := EuclideanSpace β (Fin c)) | |
| (X := hilbertSpace a) I J β€ loss := | |
| (@allCopyOverlap_le_count (EuclideanSpace β (Fin r)) (EuclideanSpace β (Fin c)) | |
| (hilbertSpace a) inferInstance inferInstance inferInstance | |
| inferInstance inferInstance inferInstance inferInstance inferInstance inferInstance u v I J).trans | |
| (occupied_count_bound Ξ©.card m n h u v ((m*n-Ξ©.card : β) : β) (Nat.cast_nonneg _) hu hv) | |
| have hdim : allCopyOverlap (V := EuclideanSpace β (Fin r)) (W := EuclideanSpace β (Fin c)) | |
| (X := hilbertSpace a) I J β€ loss * ratio := by | |
| by_cases hΞ© : Ξ©.Nonempty | |
| Β· obtain β¨x,hxβ© := hΞ© | |
| let : Nonempty Ξ© := β¨β¨x,hxβ©β© | |
| exact occupied_dimension_ratio m n Ξ© a e h hh H r c u v Ο Ο hΟ hΟ I J hI.1 hJ.1 hu hv | |
| Β· have hempty : Ξ©=β := Finset.not_nonempty_iff_eq_empty.mp hΞ© | |
| have ha : Fintype.card (Cell a)=0 := by | |
| rw [β Fintype.card_congr e, Fintype.card_coe, hempty, Finset.card_empty] | |
| have hd : (Module.finrank β (space a) : β) β€ 1 := by exact_mod_cast empty_hook_dimension_le a h H ha | |
| have hdpos : (0 : β) < Module.finrank β (space a) := by exact_mod_cast dimension_pos a | |
| have hr : (1 : β) β€ r := by | |
| have hh : 0 < Module.finrank β (EuclideanSpace β (Fin r)) := Module.finrank_pos | |
| simp only [finrank_euclideanSpace, Fintype.card_fin] at hh | |
| exact_mod_cast hh | |
| have hc : (1 : β) β€ c := by | |
| have hh : 0 < Module.finrank β (EuclideanSpace β (Fin c)) := Module.finrank_pos | |
| simp only [finrank_euclideanSpace, Fintype.card_fin] at hh | |
| exact_mod_cast hh | |
| have hrc : 1 β€ ratio := by | |
| dsimp [ratio] | |
| apply (le_div_iffβ hdpos).mpr | |
| simp only [one_mul] | |
| exact hd.trans (one_le_mul_of_one_le_of_one_le hr hc) | |
| exact hplain.trans (by simpa using mul_le_mul_of_nonneg_left hrc hloss) | |
| have hmin : allCopyOverlap (V := EuclideanSpace β (Fin r)) (W := EuclideanSpace β (Fin c)) | |
| (X := hilbertSpace a) I J β€ loss * min 1 ratio := by | |
| by_cases hx : ratio β€ 1 | |
| Β· rw [min_eq_right hx]; exact hdim | |
| Β· rw [min_eq_left (le_of_not_ge hx), mul_one]; exact hplain | |
| have hs : Ξ©.card β€ m*n := by | |
| simpa only [Fintype.card_prod, Fintype.card_fin] using Finset.card_le_univ Ξ© | |
| have hbound := occupied_numeric_absorb m n h Ξ©.card hh hs | |
| exact hmin.trans (mul_le_mul_of_nonneg_right hbound (le_min (by norm_num) hratio)) | |
| end RowColumn | |
| end | |
| end | |
| /-- The occupied row-column overlap bound. -/ | |
| theorem RowColumn.occupied_overlap : RowColumn.OccupiedOverlapEndpoint := | |
| RowColumn.occupied_overlap_endpoint | |
| end OAI | |