Download data/lean/OAI/Geometry/LatticeCovering/Completion.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 32.9 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Geometry/LatticeCovering/Completion.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Geometry/LatticeCovering/Completion.lean
-
curl -L -o Completion.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Geometry/LatticeCovering/Completion.lean
32.9 kB
| import OAI.Geometry.LatticeCovering.Shears | |
| namespace OAI | |
| section | |
| section | |
| namespace SingleLatticeCovering.Completion | |
| open MeasureTheory MeasureTheory.Measure Set Module | |
| open scoped Pointwise ENNReal | |
| lemma projection_mem_image_iff {n : β} | |
| (Ξ : Submodule β€ (RealSpace n)) (Ο : RealSpace n β+ Torus n) | |
| (hker : β x, Ο x = 0 β x β Ξ) (K : Set (RealSpace n)) (x : RealSpace n) : | |
| Ο x β Ο '' K β x β K+(Ξ : Set (RealSpace n)) := by | |
| constructor | |
| Β· rintro β¨a,ha,haxβ© | |
| refine β¨a,ha,x-a,?_,by abel_nfβ© | |
| apply (hker _).mp | |
| simp [map_sub,hax] | |
| Β· rintro β¨a,ha,z,hz,rflβ© | |
| refine β¨a,ha,?_β© | |
| simp [map_add,(hker z).mpr hz] | |
| lemma projection_image_eq_univ {n : β} | |
| (Ξ : Submodule β€ (RealSpace n)) (Ο : RealSpace n β+ Torus n) | |
| (hsurj : Function.Surjective Ο) (hker : β x, Ο x = 0 β x β Ξ) | |
| (K : Set (RealSpace n)) : Ο '' K = univ β K+(Ξ : Set (RealSpace n)) = univ := by | |
| constructor | |
| Β· intro h | |
| apply Set.eq_univ_of_forall | |
| intro x | |
| apply (projection_mem_image_iff Ξ Ο hker K x).mp | |
| rw [h]; trivial | |
| Β· intro h | |
| apply Set.eq_univ_of_forall | |
| intro t | |
| obtain β¨x,rflβ© := hsurj t | |
| apply (projection_mem_image_iff Ξ Ο hker K x).mpr | |
| rw [h]; trivial | |
| lemma projection_scalar_image {n : β} (Ο : RealSpace n β+ Torus n) | |
| (K : Set (RealSpace n)) (k : β) (hk : k β 0) : | |
| (fun t : Torus n => k β’ t) '' (Ο '' ((k : β)β»ΒΉ β’ K)) = Ο '' K := by | |
| have heq (x : RealSpace n) : k β’ Ο ((k : β)β»ΒΉ β’ x) = Ο x := by | |
| rw [β map_nsmul] | |
| congr 1 | |
| rw [β Nat.cast_smul_eq_nsmul β,smul_smul,mul_inv_cancelβ (Nat.cast_ne_zero.mpr hk),one_smul] | |
| rw [βSet.image_smul,Set.image_image,Set.image_image] | |
| simp only [heq] | |
| theorem completion_with_projection {n : β} | |
| (Ξ : Submodule β€ (RealSpace n)) (Ο : RealSpace n ββ+ Torus n) | |
| (hsurj : Function.Surjective Ο) (hker : β x, Ο x = 0 β x β Ξ) | |
| (K : Set (RealSpace n)) (hK : IsCompact K) (hconv : Convex β K) | |
| (k : β) (hk : 0 < k) | |
| (hhole : 1-(torusMeasure n).real (Ο '' K) < | |
| (torusMeasure n).real (Ο '' K)/(k : β)^n) : | |
| ((1+(k : β)β»ΒΉ) β’ K)+(Ξ : Set (RealSpace n)) = univ := by | |
| let A := Ο '' K | |
| let B := Ο '' ((k : β)β»ΒΉ β’ K) | |
| have hB : IsCompact B := (hK.smul _).image Ο.continuous | |
| have hm : (torusMeasure n).real A β€ (k : β)^n*(torusMeasure n).real B := by | |
| have h := torus_measure_image_nsmul n k hk.ne' hB | |
| change (torusMeasure n).real ((fun t : Torus n => k β’ t) '' | |
| (Ο.toAddMonoidHom '' ((k : β)β»ΒΉ β’ K))) β€ _ at h | |
| rw [projection_scalar_image Ο.toAddMonoidHom K k hk.ne'] at h | |
| exact h | |
| have hkpow : 0 < (k : β)^n := pow_pos (Nat.cast_pos.mpr hk) n | |
| have hlow : 1-(torusMeasure n).real A < (torusMeasure n).real B := by | |
| have hh := (lt_div_iffβ hkpow).mp hhole | |
| exact (mul_lt_mul_iff_rightβ hkpow).mp (by dsimp [A] at *; nlinarith) | |
| have hsum : A+B = univ := add_eq_univ_of_measure_sum (torusMeasure n) hB.measurableSet | |
| (by linarith) | |
| apply (projection_image_eq_univ Ξ Ο.toAddMonoidHom hsurj hker _).mp | |
| rw [hconv.add_smul (show (0 : β) β€ 1 by norm_num) (inv_nonneg.mpr (Nat.cast_nonneg k)), | |
| one_smul,Set.image_add] | |
| exact hsum | |
| theorem complete_almost_cover_projection {n : β} (hn : 2 β€ n) | |
| (Ξ : Submodule β€ (RealSpace n)) [DiscreteTopology Ξ] [IsZLattice β Ξ] | |
| (Ο : RealSpace n ββ+ Torus n) (hsurj : Function.Surjective Ο) | |
| (hker : β x, Ο x = 0 β x β Ξ) | |
| (K : Set (RealSpace n)) (hK : IsCompact K) (hconv : Convex β K) | |
| (hhole : 1-(torusMeasure n).real (Ο '' K) β€ 1/(n : β)^(2*n)) : | |
| β (L' : Submodule β€ (RealSpace n)) (_ : DiscreteTopology L'), | |
| IsZLattice β L' β§ K+(L' : Set (RealSpace n)) = univ β§ | |
| (volume K).toReal / ZLattice.covolume L' β€ | |
| Real.exp 1*((volume K).toReal / ZLattice.covolume Ξ) := by | |
| have hnβ : 0 < n := by omega | |
| let a := 1+(n : β)β»ΒΉ | |
| have ha : 0 < a := by dsimp [a]; positivity | |
| let L' := contractLattice Ξ a ha.ne' | |
| refine β¨L',inferInstance,inferInstance,?_,?_β© | |
| Β· apply cover_contractLattice Ξ K a ha.ne' | |
| apply completion_with_projection Ξ Ο hsurj hker K hK hconv n hnβ | |
| have h := small_hole_strict hn hhole | |
| simpa only [sub_sub_cancel] using h | |
| Β· have heq : (volume K).toReal / ZLattice.covolume L' = | |
| a^n*((volume K).toReal / ZLattice.covolume Ξ) := by | |
| rw [contractLattice_covolume Ξ a ha,inv_pow,div_mul_eq_div_div,div_inv_eq_mul] | |
| ring | |
| rw [heq] | |
| exact mul_le_mul_of_nonneg_right (one_add_inv_pow_le_exp n hnβ.ne') | |
| (div_nonneg ENNReal.toReal_nonneg (ZLattice.covolume_pos Ξ).le) | |
| end SingleLatticeCovering.Completion | |
| namespace SingleLatticeCovering.Shear | |
| open MeasureTheory | |
| open scoped BigOperators ENNReal | |
| lemma source_pattern_mono {Ξ± : Type*} {q : β} | |
| {s t : Finset ((Fin q β β) Γ Ξ±)} (hs : SourcePattern s) | |
| (ht : t.Nonempty) (hts : t β s) : SourcePattern t := by | |
| refine β¨ht,fun l hl r hr he => hs.2.1 l (hts hl) r (hts hr) he,?_β© | |
| intro j y | |
| obtain β¨v,hvβ© := hs.2.2 j y | |
| exact β¨v,fun l hl hy => hv l (hts hl) hyβ© | |
| lemma retained_load {A : Type*} (s : Finset A) (u : A β β) (Ο : β) (hΟ : 0 β€ Ο) : | |
| (β x β s, u x) - (s.card : β)*Ο β€ β x β s.filter (fun x => Ο β€ u x), u x := by | |
| classical | |
| have hdrop : β x β s.filter (fun x => Β¬Ο β€ u x), u x β€ (s.card : β)*Ο := by | |
| calc | |
| _ β€ β x β s.filter (fun x => Β¬Ο β€ u x), Ο := by | |
| apply Finset.sum_le_sum | |
| intro x hx | |
| exact (lt_of_not_ge (Finset.mem_filter.mp hx).2).le | |
| _ = ((s.filter (fun x => Β¬Ο β€ u x)).card : β)*Ο := by simp | |
| _ β€ (s.card : β)*Ο := mul_le_mul_of_nonneg_right (by exact_mod_cast Finset.card_filter_le s _) hΟ | |
| have hsum := Finset.sum_filter_add_sum_filter_not s (fun x => Ο β€ u x) u | |
| linarith | |
| lemma retain_source_pattern {Ξ± : Type*} {q : β} | |
| (s : Finset ((Fin q β β) Γ Ξ±)) (hs : SourcePattern s) | |
| (u : Ξ± β β) (Ο A : β) (hΟ : 0 β€ Ο) (hA : 0 < A) | |
| (hload : A+(2^q : β)*Ο β€ β l β s, u l.2) : | |
| β t : Finset ((Fin q β β) Γ Ξ±), t β s β§ SourcePattern t β§ | |
| (β l β t, Ο β€ u l.2) β§ A β€ β l β t, u l.2 := by | |
| classical | |
| let t := s.filter (fun l => Ο β€ u l.2) | |
| have hc : (s.card : β) β€ (2^q : β) := by exact_mod_cast source_card_le_two_pow hs | |
| have htload : A β€ β l β t, u l.2 := by | |
| have hd := retained_load s (fun l => u l.2) Ο hΟ | |
| have hm := mul_le_mul_of_nonneg_right hc hΟ | |
| change A β€ β l β s.filter (fun l => Ο β€ u l.2), u l.2 | |
| linarith | |
| have hn : t.Nonempty := by | |
| by_contra he | |
| rw [Finset.not_nonempty_iff_eq_empty.mp he,Finset.sum_empty] at htload | |
| exact (not_le_of_gt hA) htload | |
| refine β¨t,Finset.filter_subset _ _,source_pattern_mono hs hn (Finset.filter_subset _ _),?_,htloadβ© | |
| exact fun l hl => (Finset.mem_filter.mp hl).2 | |
| lemma finite_weight_load_bounds {A : Type*} (s : Finset A) (w u : A β β) | |
| (ΞΊ Ο c C Ξ΅ : β) (hΟ : 0 β€ Ο) (hc : 0 β€ c) (hC : 0 β€ C) | |
| (hweight : ΞΊ β€ β x β s, w x) | |
| (hlo : β x β s, c*Ο*w x β€ u x) | |
| (hup : β x β s, u x β€ C*Ο*w x) | |
| (hcap : β x β s, w x β€ Ξ΅) : | |
| c*ΞΊ*Ο β€ β x β s, u x β§ β x β s, u x β€ C*Ο*Ξ΅ := by | |
| constructor | |
| Β· have hs := Finset.sum_le_sum hlo | |
| rw [βFinset.mul_sum] at hs | |
| have hm := mul_le_mul_of_nonneg_left hweight (mul_nonneg hc hΟ) | |
| nlinarith | |
| Β· intro x hx | |
| exact (hup x hx).trans (mul_le_mul_of_nonneg_left (hcap x hx) (mul_nonneg hC hΟ)) | |
| lemma exponential_pattern_bound {Ξ± : Type*} {q : β} | |
| (s : Finset ((Fin q β β) Γ Ξ±)) (hs : SourcePattern s) | |
| (u : Ξ± β β) (L A : β) (hL : 1 β€ L) (hA : A β€ β l β s, u l.2) : | |
| ENNReal.ofReal L^(s.card-1) * (β l β s, ENNReal.ofReal (Real.exp (-u l.2/2))) β€ | |
| ENNReal.ofReal (Real.exp ((2^q : β)*Real.log L-A/2)) := by | |
| have hL0 : 0 < L := lt_of_lt_of_le zero_lt_one hL | |
| have hp : (β l β s, ENNReal.ofReal (Real.exp (-u l.2/2))) = | |
| ENNReal.ofReal (Real.exp (-(β l β s, u l.2)/2)) := by | |
| rw [βENNReal.ofReal_prod_of_nonneg (fun _ _ => (Real.exp_pos _).le),βReal.exp_sum] | |
| congr 2 | |
| rw [βFinset.sum_div,Finset.sum_neg_distrib] | |
| rw [hp,βENNReal.ofReal_pow hL0.le,βENNReal.ofReal_mul (pow_nonneg hL0.le _)] | |
| have hpow : L^(s.card-1)=Real.exp ((s.card-1 : β)*Real.log L) := by | |
| rw [Real.exp_nat_mul,Real.exp_log hL0] | |
| rw [hpow,βReal.exp_add] | |
| apply ENNReal.ofReal_le_ofReal | |
| apply Real.exp_le_exp.mpr | |
| have hc : ((s.card-1 : β) : β) β€ (2^q : β) := by | |
| exact_mod_cast (Nat.sub_le s.card 1).trans (source_card_le_two_pow hs) | |
| have hm := mul_le_mul_of_nonneg_right hc (Real.log_nonneg hL) | |
| linarith | |
| end SingleLatticeCovering.Shear | |
| namespace SingleLatticeCovering.Vertical | |
| open scoped BigOperators | |
| noncomputable def labelPattern {Ξ± : Type*} {D : β} | |
| (P : Finset (Fin D β β)) (a : (Fin D β β) β Ξ±) : | |
| Finset ((Fin D β β) Γ Ξ±) := by | |
| classical | |
| exact P.image (fun l => (l,a l)) | |
| lemma mem_labelPattern {Ξ± : Type*} {D : β} (P : Finset (Fin D β β)) | |
| (a : (Fin D β β) β Ξ±) (l : (Fin D β β) Γ Ξ±) : | |
| l β labelPattern P a β l.1 β P β§ l.2=a l.1 := by | |
| classical | |
| simp [labelPattern,Prod.ext_iff,eq_comm] | |
| lemma labelPattern_source {Ξ± : Type*} {D : β} (P : Finset (Fin D β β)) | |
| (a : (Fin D β β) β Ξ±) (hP : P.Nonempty) (hPb : SuffixBinary P) : | |
| Shear.SourcePattern (labelPattern P a) := by | |
| classical | |
| refine β¨Finset.Nonempty.image hP _,?_,?_β© | |
| Β· intro l hl r hr he | |
| obtain β¨_,hlβ© := (mem_labelPattern P a l).mp hl | |
| obtain β¨_,hrβ© := (mem_labelPattern P a r).mp hr | |
| rw [hl,hr,he] | |
| Β· intro j y | |
| obtain β¨v,hvβ© := hPb j y | |
| exact β¨v,fun l hl hy => hv l.1 ((mem_labelPattern P a l).mp hl).1 hyβ© | |
| lemma sum_labelPattern {Ξ± : Type*} {D : β} (P : Finset (Fin D β β)) | |
| (a : (Fin D β β) β Ξ±) (f : ((Fin D β β) Γ Ξ±) β β) : | |
| β l β labelPattern P a, f l = β l β P, f (l,a l) := by | |
| classical | |
| apply Finset.sum_image | |
| intro x hx y hy he | |
| exact congrArg Prod.fst he | |
| lemma labelPattern_card {Ξ± : Type*} {D : β} (P : Finset (Fin D β β)) | |
| (a : (Fin D β β) β Ξ±) : (labelPattern P a).card=P.card := by | |
| classical | |
| apply Finset.card_image_of_injective | |
| intro x y he | |
| exact congrArg Prod.fst he | |
| lemma suffix_card_le {D : β} (P : Finset (Fin D β β)) (hPb : SuffixBinary P) : | |
| P.card β€ 2^D := by | |
| classical | |
| by_cases hP : P.Nonempty | |
| Β· have hc := Shear.source_card_le_two_pow (labelPattern_source P (fun _ => ()) hP hPb) | |
| simpa only [labelPattern_card] using hc | |
| Β· simp [Finset.not_nonempty_iff_eq_empty.mp hP] | |
| lemma labelPattern_mem_all {Ξ± : Type*} {D : β} | |
| (A : β β Finset β) (labels : Finset Ξ±) (P : Finset (Fin D β β)) | |
| (a : (Fin D β β) β Ξ±) (hP : P.Nonempty) (hPb : SuffixBinary P) | |
| (ha : β l β P, a l β labels) (hA : β l β P, β j : Fin D, l j β A j.val) : | |
| labelPattern P a β Shear.allPatterns A labels D := by | |
| apply (Shear.mem_allPatterns A labels D _).mpr | |
| refine β¨?_,labelPattern_source P a hP hPbβ© | |
| intro l hl | |
| obtain β¨hl,heβ© := (mem_labelPattern P a l).mp hl | |
| apply (Shear.mem_alphabetPoints A labels D l).mpr | |
| exact β¨hA l.1 hl,he βΈ ha l.1 hlβ© | |
| lemma retained_mem_all {Ξ± : Type*} {D : β} | |
| (A : β β Finset β) (labels : Finset Ξ±) | |
| (s t : Finset ((Fin D β β) Γ Ξ±)) (hs : s β Shear.allPatterns A labels D) | |
| (hts : t β s) (ht : t.Nonempty) : t β Shear.allPatterns A labels D := by | |
| obtain β¨hsub,hsourceβ© := (Shear.mem_allPatterns A labels D s).mp hs | |
| exact (Shear.mem_allPatterns A labels D t).mpr | |
| β¨hts.trans hsub,Shear.source_pattern_mono hsource ht htsβ© | |
| end SingleLatticeCovering.Vertical | |
| namespace SingleLatticeCovering.Vertical | |
| open MeasureTheory Folded | |
| open scoped BigOperators | |
| theorem section_labeled_retained {Ξ± : Type*} [Fintype Ξ±] {m D : β} | |
| (P : Finset (Fin D β β)) (hP : P.Nonempty) (hPb : SuffixBinary P) | |
| (N : Submodule β€ (Fin D β β)) (hraw : β l β P, l β N) | |
| (M : (Fin D β β) ββ[β] (Fin D β β)) (y : Fin D β β) | |
| (K : Set (Fin (m+D) β β)) (J : Ξ± β Set (Fin m β β)) | |
| (u : Ξ± β β) (w : (Fin D β β) β β) (ΞΊ Ο c C Ξ΅ Ο A : β) | |
| (hΟ : 0 β€ Ο) (hc : 0 β€ c) (hC : 0 β€ C) (hΟ : 0 β€ Ο) (hA : 0 < A) | |
| (hweight : ΞΊ β€ β l β P, w l) (hcap : β l β P, w l β€ Ξ΅) | |
| (hsection : β l β P, β a : Ξ±, | |
| (β j β J a, Fin.append j (y-M l) β K) β§ c*Ο*w l β€ u a β§ u a β€ C*Ο*w l) | |
| (hload : A+(2^D : β)*Ο β€ c*ΞΊ*Ο) | |
| (alphabet : β β Finset β) (halph : β l β P, β j : Fin D, l j β alphabet j.val) : | |
| β s : Finset ((Fin D β β) Γ Ξ±), | |
| s β Shear.allPatterns alphabet (Finset.univ.filter (fun a => Ο β€ u a β§ u a β€ C*Ο*Ξ΅)) D β§ | |
| (β l β s, l.1 β N) β§ | |
| (β l β s, β j β J l.2, Fin.append j (y-M l.1) β K) β§ | |
| A β€ β l β s, u l.2 := by | |
| classical | |
| obtain β¨lβ,hlββ© := hP | |
| obtain β¨aβ,haββ© := hsection lβ hlβ | |
| have hex : β l : Fin D β β, β a : Ξ±, l β P β | |
| (β j β J a, Fin.append j (y-M l) β K) β§ c*Ο*w l β€ u a β§ u a β€ C*Ο*w l := by | |
| intro l | |
| by_cases hl : l β P | |
| Β· obtain β¨a,haβ© := hsection l hl | |
| exact β¨a,fun _ => haβ© | |
| Β· exact β¨aβ,fun h => (hl h).elimβ© | |
| choose a ha using hex | |
| have hbnds := Shear.finite_weight_load_bounds P w (fun l => u (a l)) ΞΊ Ο c C Ξ΅ hΟ hc hC | |
| hweight (fun l hl => (ha l hl).2.1) (fun l hl => (ha l hl).2.2) hcap | |
| let sβ := labelPattern P a | |
| have hsβ : Shear.SourcePattern sβ := labelPattern_source P a β¨lβ,hlββ© hPb | |
| have hloadβ : A+(2^D : β)*Ο β€ β l β sβ, u l.2 := by | |
| rw [sum_labelPattern] | |
| exact hload.trans hbnds.1 | |
| obtain β¨s,hsub,hsource,hthreshold,hsumβ© := | |
| Shear.retain_source_pattern sβ hsβ u Ο A hΟ hA hloadβ | |
| refine β¨s,?_,?_,?_,hsumβ© | |
| Β· apply (Shear.mem_allPatterns _ _ _ _).mpr | |
| refine β¨?_,hsourceβ© | |
| intro l hl | |
| have hmem := hsub hl | |
| obtain β¨hlP,hlAβ© := (mem_labelPattern P a l).mp hmem | |
| apply (Shear.mem_alphabetPoints _ _ _ _).mpr | |
| refine β¨halph l.1 hlP,Finset.mem_filter.mpr β¨Finset.mem_univ _,hthreshold l hl,?_β©β© | |
| rw [hlA] | |
| exact hbnds.2 l.1 hlP | |
| Β· intro l hl | |
| exact hraw l.1 ((mem_labelPattern P a l).mp (hsub hl)).1 | |
| Β· intro l hl | |
| obtain β¨hlP,hlAβ© := (mem_labelPattern P a l).mp (hsub hl) | |
| rw [hlA] | |
| exact (ha l.1 hlP).1 | |
| end SingleLatticeCovering.Vertical | |
| noncomputable section | |
| namespace SingleLatticeCovering.CoverGeometry | |
| open MeasureTheory LatticeGeometry Completion | |
| open scoped BigOperators Pointwise ENNReal | |
| def columnMap {m D : β} (Z : Fin D β (Fin m β β)) : | |
| (Fin D β β) ββ[β] (Fin m β β) where | |
| toFun l := β j, l j β’ Z j | |
| map_add' l r := by simp [add_smul,Finset.sum_add_distrib] | |
| map_smul' a l := by simp [Finset.smul_sum,smul_smul] | |
| @[simp] lemma columnMap_apply {m D : β} (Z : Fin D β (Fin m β β)) (l : Fin D β β) : | |
| columnMap Z l = Shear.Pattern.linearShift Z l := rfl | |
| abbrev joinedLattice {m D : β} (L : Submodule β€ (Fin m β β)) | |
| (N : Submodule β€ (Fin D β β)) (M : (Fin D β β) ββ[β] (Fin D β β)) | |
| (Z : Fin D β (Fin m β β)) : Submodule β€ (Fin (m+D) β β) := | |
| image (finProduct L N) (triangular (LinearEquiv.refl β _) M (columnMap Z)) | |
| lemma joined_point_mem {m D : β} (L : Submodule β€ (Fin m β β)) | |
| (N : Submodule β€ (Fin D β β)) (M : (Fin D β β) ββ[β] (Fin D β β)) | |
| (Z : Fin D β (Fin m β β)) {h : Fin m β β} {l : Fin D β β} | |
| (hh : h β L) (hl : l β N) : | |
| Fin.append (h+columnMap Z l) (M l) β joinedLattice L N M Z := by | |
| apply (mem_image _ _ _).mpr | |
| refine β¨Fin.append h l,?_,?_β© | |
| Β· simpa only [mem_finProduct,Fin.append_left,Fin.append_right] using β¨hh,hlβ© | |
| Β· exact triangular_append _ _ _ h l | |
| lemma joined_covolume {m D : β} (L : Submodule β€ (Fin m β β)) | |
| (N : Submodule β€ (Fin D β β)) [DiscreteTopology L] [DiscreteTopology N] | |
| [IsZLattice β L] [IsZLattice β N] | |
| (M : (Fin D β β) ββ[β] (Fin D β β)) (Z : Fin D β (Fin m β β)) : | |
| ZLattice.covolume (joinedLattice L N M Z) = | |
| ZLattice.covolume L * ZLattice.covolume (image N M) := by | |
| rw [joinedLattice,triangular_lattice_covolume,image_covolume] | |
| simp | |
| def horizontalHole {m D : β} (L : Submodule β€ (Fin m β β)) | |
| [DiscreteTopology L] [IsZLattice β L] | |
| (K : Set (Fin (m+D) β β)) (Ξ : Submodule β€ (Fin (m+D) β β)) | |
| (y : Fin D β β) : Set (Torus m) := | |
| latticeProjection L '' {x | Fin.append x y β K+(Ξ : Set (Fin (m+D) β β))} | |
| lemma covered_of_section {m D : β} (L : Submodule β€ (Fin m β β)) | |
| [DiscreteTopology L] [IsZLattice β L] | |
| (N : Submodule β€ (Fin D β β)) (M : (Fin D β β) ββ[β] (Fin D β β)) | |
| (Z : Fin D β (Fin m β β)) (K : Set (Fin (m+D) β β)) | |
| (x : Fin m β β) (y l : Fin D β β) (hl : l β N) | |
| (J : Set (Fin m β β)) (hJ : β j β J, Fin.append j (y-M l) β K) | |
| (hx : latticeProjection L (x-columnMap Z l) β latticeProjection L '' J) : | |
| Fin.append x y β K+(joinedLattice L N M Z : Set (Fin (m+D) β β)) := by | |
| obtain β¨j,hj,hjxβ© := hx | |
| let h := x-columnMap Z l-j | |
| have hh : h β L := by | |
| apply (latticeProjection_eq_zero_iff L h).mp | |
| dsimp [h] | |
| rw [map_sub] | |
| simpa only [columnMap_apply] using sub_eq_zero.mpr hjx.symm | |
| refine β¨Fin.append j (y-M l),hJ j hj,Fin.append (h+columnMap Z l) (M l), | |
| joined_point_mem L N M Z hh hl,?_β© | |
| ext i | |
| refine Fin.addCases ?_ ?_ i <;> intro k <;> | |
| simp only [Pi.add_apply,Fin.append_left,Fin.append_right,Pi.sub_apply,h] <;> ring | |
| lemma horizontal_hole_subset {Ξ± : Type*} {m D : β} | |
| (L : Submodule β€ (Fin m β β)) [DiscreteTopology L] [IsZLattice β L] | |
| (N : Submodule β€ (Fin D β β)) (M : (Fin D β β) ββ[β] (Fin D β β)) | |
| (Z : Fin D β (Fin m β β)) (K : Set (Fin (m+D) β β)) | |
| (J : Ξ± β Set (Fin m β β)) (y : Fin D β β) | |
| (s : Finset ((Fin D β β) Γ Ξ±)) | |
| (hraw : β l β s, l.1 β N) | |
| (hsection : β l β s, β j β J l.2, Fin.append j (y-M l.1) β K) : | |
| horizontalHole L K (joinedLattice L N M Z) y β | |
| β l β s, Shear.translate ((latticeProjection L '' J l.2)αΆ) | |
| (latticeProjection L (Shear.Pattern.linearShift Z l.1)) := by | |
| rintro t β¨x,hx,rflβ© | |
| simp only [Set.mem_iInter] | |
| intro l hl | |
| change latticeProjection L x-latticeProjection L (columnMap Z l.1) β latticeProjection L '' J l.2 | |
| rw [βmap_sub] | |
| intro hc | |
| exact hx (covered_of_section L N M Z K x y l.1 (hraw l hl) (J l.2) (hsection l hl) hc) | |
| end SingleLatticeCovering.CoverGeometry | |
| namespace SingleLatticeCovering.CoverGeometry | |
| open MeasureTheory LatticeGeometry Completion Shear | |
| open scoped BigOperators Pointwise ENNReal | |
| instance torusMeasure_neg (n : β) : (torusMeasure n).IsNegInvariant := | |
| inferInstanceAs ((Measure.addHaarMeasure β€ : Measure (Torus n)).IsNegInvariant) | |
| theorem finite_family_lattice_shear {Ξ± : Type*} [Fintype Ξ±] {m D : β} | |
| (L : Submodule β€ (Fin m β β)) [DiscreteTopology L] [IsZLattice β L] | |
| (N : Submodule β€ (Fin D β β)) (M : (Fin D β β) ββ[β] (Fin D β β)) | |
| (K : Set (Fin (m+D) β β)) (J : Ξ± β Set (Fin m β β)) | |
| (hJ : β a, IsCompact (J a)) (u : Ξ± β β) (labels : Finset Ξ±) | |
| (hhole : β a β labels, torusMeasure m ((latticeProjection L '' J a)αΆ) β€ | |
| ENNReal.ofReal (Real.exp (-u a/2))) | |
| (alphabet : β β Finset β) (Lstar : β) (hLstar : 1 β€ Lstar) | |
| (hcost : ((β q β Finset.range (D+1), | |
| (allPatterns alphabet labels q).card : β) : β) < Lstar) : | |
| β Z : Fin D β (Fin m β β), β (y : Fin D β β) | |
| (s : Finset ((Fin D β β) Γ Ξ±)), s β allPatterns alphabet labels D β | |
| (β l β s, l.1 β N) β | |
| (β l β s, β j β J l.2, Fin.append j (y-M l.1) β K) β | |
| β A : β, A β€ β l β s, u l.2 β | |
| torusMeasure m (horizontalHole L K (joinedLattice L N M Z) y) β€ | |
| ENNReal.ofReal (Real.exp ((2^D : β)*Real.log Lstar-A/2)) := by | |
| classical | |
| let U : Ξ± β Set (Torus m) := fun a => (latticeProjection L '' J a)αΆ | |
| have hU : β a, MeasurableSet (U a) := fun a => | |
| ((hJ a).image (latticeProjection L).continuous).isClosed.measurableSet.compl | |
| let Ξ· : Ξ± β ββ₯0β := fun a => if a β labels then ENNReal.ofReal (Real.exp (-u a/2)) else 1 | |
| have hΞ·0 : β a, Ξ· a β 0 := by | |
| intro a; dsimp [Ξ·]; split | |
| Β· exact (ENNReal.ofReal_pos.mpr (Real.exp_pos _)).ne' | |
| Β· exact one_ne_zero | |
| have hΞ·t : β a, Ξ· a β β := by | |
| intro a; dsimp [Ξ·]; split <;> simp | |
| have hUΞ· : β a, torusMeasure m (U a) β€ Ξ· a := by | |
| intro a; dsimp [Ξ·]; split | |
| Β· exact hhole a (by assumption) | |
| Β· exact prob_le_one | |
| have hL0 : 0 < Lstar := lt_of_lt_of_le zero_lt_one hLstar | |
| have hQ : (β q β Finset.range (D+1), | |
| ((allPatterns alphabet labels q).card : ββ₯0β)) < ENNReal.ofReal Lstar := by | |
| rw [βNat.cast_sum] | |
| exact ENNReal.natCast_lt_ofReal.mpr hcost | |
| obtain β¨Z,hZβ© := source_simultaneous_shear (torusMeasure m) | |
| (latticeProjection L).toAddMonoidHom (latticeProjection_surjective L) U hU | |
| Ξ· hΞ·0 hΞ·t hUΞ· | |
| (ENNReal.ofReal Lstar) (ENNReal.ofReal_pos.mpr hL0).ne' ENNReal.ofReal_ne_top D | |
| (allPatterns alphabet labels) | |
| (fun q _ s hs => ((mem_allPatterns alphabet labels q s).mp hs).2) | |
| (allPatterns_sliceClosed alphabet labels D) hQ | |
| refine β¨Z,fun y s hs hraw hsection A hload => ?_β© | |
| have hmain := hZ D le_rfl s hs | |
| simp only [restrictColumns_self] at hmain | |
| have hp : (β l β s, Ξ· l.2) = β l β s, ENNReal.ofReal (Real.exp (-u l.2/2)) := by | |
| apply Finset.prod_congr rfl | |
| intro l hl | |
| have hm := ((mem_allPatterns alphabet labels D s).mp hs).1 hl | |
| have ha := ((mem_alphabetPoints alphabet labels D l).mp hm).2 | |
| simp only [Ξ·,ite_eq_left ha] | |
| rw [hp] at hmain | |
| apply le_trans (measure_mono (horizontal_hole_subset L N M Z K J y s hraw hsection)) | |
| apply hmain.trans | |
| exact exponential_pattern_bound s ((mem_allPatterns alphabet labels D s).mp hs).2 | |
| u Lstar A hLstar hload | |
| end SingleLatticeCovering.CoverGeometry | |
| namespace SingleLatticeCovering.CoverGeometry | |
| open MeasureTheory Completion LatticeGeometry | |
| open scoped Pointwise ENNReal | |
| lemma add_lattice_cover_iff {E : Type*} [AddCommGroup E] [Module β€ E] | |
| (Ξ : Submodule β€ E) (K : Set E) (x z : E) (hz : z β Ξ) : | |
| x+z β K+(Ξ : Set E) β x β K+(Ξ : Set E) := by | |
| constructor | |
| Β· rintro β¨a,ha,b,hb,habβ© | |
| change a+b = x+z at hab | |
| refine β¨a,ha,b-z,Ξ.sub_mem hb hz,?_β© | |
| calc a+(b-z) = (a+b)-z := by abel | |
| _ = x := by rw [hab]; abel | |
| Β· rintro β¨a,ha,b,hb,habβ© | |
| refine β¨a,ha,b+z,Ξ.add_mem hb hz,?_β© | |
| change a+b=x at hab | |
| change a+(b+z)=x+z | |
| rw [βadd_assoc,hab] | |
| lemma horizontalHole_reduce {m D : β} | |
| (L : Submodule β€ (Fin m β β)) [DiscreteTopology L] [IsZLattice β L] | |
| (N : Submodule β€ (Fin D β β)) (M : (Fin D β β) ββ[β] (Fin D β β)) | |
| (Z : Fin D β (Fin m β β)) (K : Set (Fin (m+D) β β)) | |
| (yβ k : Fin D β β) (hk : k β N) : | |
| horizontalHole L K (joinedLattice L N M Z) (yβ+M k) β | |
| Shear.translate (horizontalHole L K (joinedLattice L N M Z) yβ) | |
| (latticeProjection L (columnMap Z k)) := by | |
| rintro t β¨x,hx,rflβ© | |
| change latticeProjection L x-latticeProjection L (columnMap Z k) β | |
| horizontalHole L K (joinedLattice L N M Z) yβ | |
| rw [βmap_sub] | |
| refine β¨x-columnMap Z k,?_,rflβ© | |
| intro hc | |
| have hg : Fin.append (columnMap Z k) (M k) β joinedLattice L N M Z := by | |
| simpa only [zero_add] using joined_point_mem L N M Z L.zero_mem hk | |
| have h := (add_lattice_cover_iff (joinedLattice L N M Z) K | |
| (Fin.append (x-columnMap Z k) yβ) (Fin.append (columnMap Z k) (M k)) hg).mpr hc | |
| apply hx | |
| convert h using 1 | |
| ext i; refine Fin.addCases ?_ ?_ i <;> intro j <;> | |
| simp only [Pi.add_apply,Pi.sub_apply,Fin.append_left,Fin.append_right] ; abel | |
| theorem all_height_hole_bound {m D : β} | |
| (L : Submodule β€ (Fin m β β)) [DiscreteTopology L] [IsZLattice β L] | |
| (N : Submodule β€ (Fin D β β)) | |
| (hints : β k : Fin D β β€, (fun j => (k j : β)) β N) | |
| (M : (Fin D β β) ββ[β] (Fin D β β)) (Z : Fin D β (Fin m β β)) | |
| (K : Set (Fin (m+D) β β)) (Ξ΅ : ββ₯0β) | |
| (hcell : β z : Fin D β β, (β j, 0 β€ z j β§ z j < 1) β | |
| torusMeasure m (horizontalHole L K (joinedLattice L N M Z) (M z)) β€ Ξ΅) : | |
| β y : Fin D β β, torusMeasure m (horizontalHole L K (joinedLattice L N M Z) y) β€ Ξ΅ := by | |
| intro y | |
| let z := M.symm y | |
| let k : Fin D β β := fun j => (βz jβ : β€) | |
| let zβ : Fin D β β := fun j => Int.fract (z j) | |
| have hk : k β N := hints (fun j => βz jβ) | |
| have hy : y = M zβ+M k := by | |
| rw [βmap_add] | |
| have hz : zβ+k = z := by | |
| ext j | |
| exact Int.fract_add_floor (z j) | |
| rw [hz] | |
| exact (M.apply_symm_apply y).symm | |
| rw [hy] | |
| apply le_trans (measure_mono (horizontalHole_reduce L N M Z K (M zβ) k hk)) | |
| simp only [Shear.translate,sub_eq_add_neg,measure_preimage_add_right] | |
| exact hcell zβ (fun j => β¨Int.fract_nonneg _,Int.fract_lt_one _β©) | |
| end SingleLatticeCovering.CoverGeometry | |
| namespace SingleLatticeCovering.CoverGeometry | |
| open MeasureTheory Completion LatticeGeometry | |
| open scoped Pointwise ENNReal | |
| def appendTorus (m D : β) : (Torus m Γ Torus D) ββ+ Torus (m+D) where | |
| toFun t := Fin.append t.1 t.2 | |
| map_zero' := by ext i; refine Fin.addCases ?_ ?_ i <;> intro k <;> simp | |
| map_add' x y := by ext i; refine Fin.addCases ?_ ?_ i <;> intro k <;> simp | |
| continuous_toFun := by | |
| apply continuous_pi | |
| intro i | |
| refine Fin.addCases ?_ ?_ i <;> intro k | |
| Β· simp only [Fin.append_left] | |
| fun_prop | |
| Β· simp only [Fin.append_right] | |
| fun_prop | |
| lemma appendTorus_surjective (m D : β) : Function.Surjective (appendTorus m D) := | |
| (Fin.appendEquiv m D).surjective | |
| lemma appendTorus_measurePreserving (m D : β) : | |
| MeasurePreserving (appendTorus m D) ((torusMeasure m).prod (torusMeasure D)) | |
| (torusMeasure (m+D)) := | |
| by | |
| let : Measure.IsAddHaarMeasure ((torusMeasure m).prod (torusMeasure D)) := | |
| Measure.prod.instIsAddHaarMeasure (torusMeasure m) (torusMeasure D) | |
| exact AddMonoidHom.measurePreserving (appendTorus m D).continuous (appendTorus_surjective m D) | |
| (by simp) | |
| def productProjection {m D : β} (L : Submodule β€ (Fin m β β)) | |
| [DiscreteTopology L] [IsZLattice β L] (N : Submodule β€ (Fin D β β)) | |
| [DiscreteTopology N] [IsZLattice β N] : (Fin (m+D) β β) ββ+ Torus (m+D) where | |
| toFun x := Fin.append (latticeProjection L (fun j => x (Fin.castAdd D j))) | |
| (latticeProjection N (fun j => x (Fin.natAdd m j))) | |
| map_zero' := by | |
| change Fin.append (latticeProjection L 0) (latticeProjection N 0) = 0 | |
| rw [map_zero,map_zero] | |
| ext i; refine Fin.addCases ?_ ?_ i <;> intro k <;> simp | |
| map_add' x y := by | |
| ext i; refine Fin.addCases ?_ ?_ i <;> intro k | |
| Β· simp only [Pi.add_apply,Fin.append_left] | |
| change latticeProjection L ((fun j => x (Fin.castAdd D j))+ | |
| (fun j => y (Fin.castAdd D j))) k = _ | |
| simp | |
| Β· simp only [Pi.add_apply,Fin.append_right] | |
| change latticeProjection N ((fun j => x (Fin.natAdd m j))+ | |
| (fun j => y (Fin.natAdd m j))) k = _ | |
| simp | |
| continuous_toFun := by | |
| apply continuous_pi | |
| intro i | |
| refine Fin.addCases ?_ ?_ i <;> intro k | |
| Β· simp only [Fin.append_left] | |
| exact (continuous_apply k).comp ((latticeProjection L).continuous.comp | |
| (continuous_pi (fun j => continuous_apply _))) | |
| Β· simp only [Fin.append_right] | |
| exact (continuous_apply k).comp ((latticeProjection N).continuous.comp | |
| (continuous_pi (fun j => continuous_apply _))) | |
| @[simp] lemma productProjection_apply {m D : β} | |
| (L : Submodule β€ (Fin m β β)) [DiscreteTopology L] [IsZLattice β L] | |
| (N : Submodule β€ (Fin D β β)) [DiscreteTopology N] [IsZLattice β N] | |
| (x : Fin (m+D) β β) : productProjection L N x = | |
| Fin.append (latticeProjection L (fun j => x (Fin.castAdd D j))) | |
| (latticeProjection N (fun j => x (Fin.natAdd m j))) := rfl | |
| @[simp] lemma productProjection_append {m D : β} | |
| (L : Submodule β€ (Fin m β β)) [DiscreteTopology L] [IsZLattice β L] | |
| (N : Submodule β€ (Fin D β β)) [DiscreteTopology N] [IsZLattice β N] | |
| (x : Fin m β β) (z : Fin D β β) : | |
| productProjection L N (Fin.append x z) = | |
| Fin.append (latticeProjection L x) (latticeProjection N z) := by | |
| simp only [productProjection_apply,Fin.append_left,Fin.append_right] | |
| lemma productProjection_surjective {m D : β} | |
| (L : Submodule β€ (Fin m β β)) [DiscreteTopology L] [IsZLattice β L] | |
| (N : Submodule β€ (Fin D β β)) [DiscreteTopology N] [IsZLattice β N] : | |
| Function.Surjective (productProjection L N) := by | |
| intro t | |
| obtain β¨x,hxβ© := latticeProjection_surjective L (fun j => t (Fin.castAdd D j)) | |
| obtain β¨z,hzβ© := latticeProjection_surjective N (fun j => t (Fin.natAdd m j)) | |
| refine β¨Fin.append x z,?_β© | |
| rw [productProjection_append,hx,hz] | |
| exact (Fin.appendEquiv m D).apply_symm_apply t | |
| lemma productProjection_eq_zero_iff {m D : β} | |
| (L : Submodule β€ (Fin m β β)) [DiscreteTopology L] [IsZLattice β L] | |
| (N : Submodule β€ (Fin D β β)) [DiscreteTopology N] [IsZLattice β N] | |
| (x : Fin (m+D) β β) : productProjection L N x = 0 β x β finProduct L N := by | |
| rw [mem_finProduct,βlatticeProjection_eq_zero_iff L,βlatticeProjection_eq_zero_iff N] | |
| constructor | |
| Β· intro h | |
| constructor | |
| Β· ext j; simpa only [productProjection_apply,Fin.append_left,Pi.zero_apply] using congr_fun h (Fin.castAdd D j) | |
| Β· ext j; simpa only [productProjection_apply,Fin.append_right,Pi.zero_apply] using congr_fun h (Fin.natAdd m j) | |
| Β· rintro β¨hL,hNβ© | |
| ext i; refine Fin.addCases ?_ ?_ i <;> intro k | |
| Β· simpa only [productProjection_apply,Pi.zero_apply,Fin.append_left] using congr_fun hL k | |
| Β· simpa only [productProjection_apply,Pi.zero_apply,Fin.append_right] using congr_fun hN k | |
| def joinedProjection {m D : β} | |
| (L : Submodule β€ (Fin m β β)) [DiscreteTopology L] [IsZLattice β L] | |
| (N : Submodule β€ (Fin D β β)) [DiscreteTopology N] [IsZLattice β N] | |
| (M : (Fin D β β) ββ[β] (Fin D β β)) (Z : Fin D β (Fin m β β)) : | |
| (Fin (m+D) β β) ββ+ Torus (m+D) := | |
| (productProjection L N).comp | |
| ((triangular (LinearEquiv.refl β _) M (columnMap Z)).symm.toContinuousLinearEquiv : | |
| (Fin (m+D) β β) ββ+ (Fin (m+D) β β)) | |
| lemma joinedProjection_surjective {m D : β} | |
| (L : Submodule β€ (Fin m β β)) [DiscreteTopology L] [IsZLattice β L] | |
| (N : Submodule β€ (Fin D β β)) [DiscreteTopology N] [IsZLattice β N] | |
| (M : (Fin D β β) ββ[β] (Fin D β β)) (Z : Fin D β (Fin m β β)) : | |
| Function.Surjective (joinedProjection L N M Z) := | |
| (productProjection_surjective L N).comp (triangular (LinearEquiv.refl β _) M (columnMap Z)).symm.surjective | |
| lemma joinedProjection_eq_zero_iff {m D : β} | |
| (L : Submodule β€ (Fin m β β)) [DiscreteTopology L] [IsZLattice β L] | |
| (N : Submodule β€ (Fin D β β)) [DiscreteTopology N] [IsZLattice β N] | |
| (M : (Fin D β β) ββ[β] (Fin D β β)) (Z : Fin D β (Fin m β β)) | |
| (x : Fin (m+D) β β) : joinedProjection L N M Z x = 0 β x β joinedLattice L N M Z := | |
| productProjection_eq_zero_iff L N _ | |
| @[simp] lemma joinedProjection_append {m D : β} | |
| (L : Submodule β€ (Fin m β β)) [DiscreteTopology L] [IsZLattice β L] | |
| (N : Submodule β€ (Fin D β β)) [DiscreteTopology N] [IsZLattice β N] | |
| (M : (Fin D β β) ββ[β] (Fin D β β)) (Z : Fin D β (Fin m β β)) | |
| (x : Fin m β β) (z : Fin D β β) : | |
| joinedProjection L N M Z (Fin.append x (M z)) = | |
| Fin.append (latticeProjection L (x-columnMap Z z)) (latticeProjection N z) := by | |
| change productProjection L N | |
| ((triangular (LinearEquiv.refl β _) M (columnMap Z)).symm (Fin.append x (M z))) = _ | |
| simp only [triangular,LinearEquiv.coe_symm_mk,Fin.append_left,Fin.append_right, | |
| LinearEquiv.symm_apply_apply,LinearEquiv.refl_symm,LinearEquiv.refl_apply] | |
| exact productProjection_append L N _ _ | |
| end SingleLatticeCovering.CoverGeometry | |
| end | |
| end | |
| end | |
| end OAI | |