Download data/lean/OAI/Geometry/LatticeCovering/Covering.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 28.6 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Geometry/LatticeCovering/Covering.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Geometry/LatticeCovering/Covering.lean
-
curl -L -o Covering.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Geometry/LatticeCovering/Covering.lean
28.6 kB
| import OAI.Geometry.LatticeCovering.Completion | |
| namespace OAI | |
| section | |
| section | |
| noncomputable section | |
| namespace SingleLatticeCovering.CoverGeometry | |
| open MeasureTheory Completion LatticeGeometry | |
| open scoped Pointwise ENNReal | |
| theorem quotient_hole_bound {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 β β)) | |
| (K : Set (Fin (m+D) β β)) (hK : IsCompact K) (Ξ΅ : ββ₯0β) | |
| (hhole : β y, torusMeasure m (horizontalHole L K (joinedLattice L N M Z) y) β€ Ξ΅) : | |
| torusMeasure (m+D) ((joinedProjection L N M Z '' K)αΆ) β€ Ξ΅ := by | |
| let Ο := joinedProjection L N M Z | |
| have hC : MeasurableSet ((Ο '' K)αΆ) := (hK.image Ο.continuous).measurableSet.compl | |
| rw [β(appendTorus_measurePreserving m D).measure_preimage hC.nullMeasurableSet] | |
| have hpre : MeasurableSet ((appendTorus m D) β»ΒΉ' (Ο '' K)αΆ) := | |
| (appendTorus m D).continuous.measurable hC | |
| rw [Measure.prod_apply_symm hpre] | |
| calc | |
| (β«β» v : Torus D, torusMeasure m ((fun t => (t,v)) β»ΒΉ' | |
| ((appendTorus m D) β»ΒΉ' (Ο '' K)αΆ)) β(torusMeasure D)) β€ | |
| (β«β» _v : Torus D, Ξ΅ β(torusMeasure D)) := by | |
| apply lintegral_mono | |
| intro v | |
| obtain β¨z,hzβ© := latticeProjection_surjective N v | |
| have hsub : (fun t => (t,v)) β»ΒΉ' ((appendTorus m D) β»ΒΉ' (Ο '' K)αΆ) β | |
| (fun t => t+latticeProjection L (columnMap Z z)) β»ΒΉ' | |
| horizontalHole L K (joinedLattice L N M Z) (M z) := by | |
| intro t ht | |
| obtain β¨x,hxβ© := latticeProjection_surjective L (t+latticeProjection L (columnMap Z z)) | |
| have hΟ : Ο (Fin.append x (M z)) = appendTorus m D (t,v) := by | |
| simp only [Ο,joinedProjection_append,map_sub,hx,hz,add_sub_cancel_right] | |
| rfl | |
| have hnot : Fin.append x (M z) β K+(joinedLattice L N M Z : Set (Fin (m+D) β β)) := by | |
| intro hc | |
| have hm := (projection_mem_image_iff (joinedLattice L N M Z) Ο.toAddMonoidHom | |
| (joinedProjection_eq_zero_iff L N M Z) K (Fin.append x (M z))).mpr hc | |
| change Ο (Fin.append x (M z)) β Ο '' K at hm | |
| rw [hΟ] at hm | |
| exact ht hm | |
| exact β¨x,hnot,hxβ© | |
| apply le_trans (measure_mono hsub) | |
| rw [measure_preimage_add_right] | |
| exact hhole (M z) | |
| _ = Ξ΅ := by simp | |
| lemma quotient_real_hole_bound {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 β β)) | |
| (K : Set (Fin (m+D) β β)) (hK : IsCompact K) (Ξ΅ : β) (hΞ΅ : 0 β€ Ξ΅) | |
| (hhole : β y, torusMeasure m (horizontalHole L K (joinedLattice L N M Z) y) β€ ENNReal.ofReal Ξ΅) : | |
| 1-(torusMeasure (m+D)).real (joinedProjection L N M Z '' K) β€ Ξ΅ := by | |
| have h := ENNReal.toReal_mono ENNReal.ofReal_ne_top | |
| (quotient_hole_bound L N M Z K hK (ENNReal.ofReal Ξ΅) hhole) | |
| rw [ENNReal.toReal_ofReal hΞ΅] at h | |
| have he := measureReal_compl (ΞΌ := torusMeasure (m+D)) | |
| (hK.image (joinedProjection L N M Z).continuous).measurableSet | |
| simpa using he.symm.trans_le h | |
| theorem joined_holes_to_cover {m D : β} (hn : 2 β€ 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 β β)) | |
| (K : Set (Fin (m+D) β β)) (hK : IsCompact K) (hconv : Convex β K) | |
| (hhole : β y, torusMeasure m (horizontalHole L K (joinedLattice L N M Z) y) β€ | |
| ENNReal.ofReal (1/((m+D : β) : β)^(2*(m+D)))) : | |
| β (Ξ : Submodule β€ (Fin (m+D) β β)) (_ : DiscreteTopology Ξ), | |
| IsZLattice β Ξ β§ K+(Ξ : Set (Fin (m+D) β β)) = Set.univ β§ | |
| (volume K).toReal / ZLattice.covolume Ξ β€ | |
| Real.exp 1*((volume K).toReal / | |
| (ZLattice.covolume L*ZLattice.covolume (image N M))) := by | |
| have hh := quotient_real_hole_bound L N M Z K hK | |
| (1/((m+D : β) : β)^(2*(m+D))) (by positivity) hhole | |
| obtain β¨Ξ,hd,hfull,hcover,hdensityβ© := complete_almost_cover_projection hn | |
| (joinedLattice L N M Z) (joinedProjection L N M Z) | |
| (joinedProjection_surjective L N M Z) (joinedProjection_eq_zero_iff L N M Z) | |
| K hK hconv hh | |
| exact β¨Ξ,hd,hfull,hcover,by simpa only [joined_covolume] using hdensityβ© | |
| end SingleLatticeCovering.CoverGeometry | |
| namespace SingleLatticeCovering.CoverGeometry | |
| open MeasureTheory LatticeGeometry Completion Shear | |
| open scoped BigOperators Pointwise ENNReal | |
| theorem finite_patterns_to_cover {Ξ± : Type*} [Fintype Ξ±] {m D : β} (hn : 2 β€ m+D) | |
| (L : Submodule β€ (Fin m β β)) [DiscreteTopology L] [IsZLattice β L] | |
| (N : Submodule β€ (Fin D β β)) [DiscreteTopology N] [IsZLattice β N] | |
| (hints : β k : Fin D β β€, (fun j => (k j : β)) β N) | |
| (M : (Fin D β β) ββ[β] (Fin D β β)) | |
| (K : Set (Fin (m+D) β β)) (hK : IsCompact K) (hconv : Convex β K) | |
| (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 A : β) (hLstar : 1 β€ Lstar) | |
| (hcost : ((β q β Finset.range (D+1), | |
| (allPatterns alphabet labels q).card : β) : β) < Lstar) | |
| (herror : Real.exp ((2^D : β)*Real.log Lstar-A/2) β€ 1/((m+D : β) : β)^(2*(m+D))) | |
| (hpatterns : β z : Fin D β β, (β j, 0 β€ z j β§ z j < 1) β | |
| β s : Finset ((Fin D β β) Γ Ξ±), s β allPatterns alphabet labels D β§ | |
| (β l β s, l.1 β N) β§ | |
| (β l β s, β j β J l.2, Fin.append j (M z-M l.1) β K) β§ | |
| A β€ β l β s, u l.2) : | |
| β (Ξ : Submodule β€ (Fin (m+D) β β)) (_ : DiscreteTopology Ξ), | |
| IsZLattice β Ξ β§ K+(Ξ : Set (Fin (m+D) β β)) = Set.univ β§ | |
| (volume K).toReal / ZLattice.covolume Ξ β€ | |
| Real.exp 1*((volume K).toReal / | |
| (ZLattice.covolume L*ZLattice.covolume (image N M))) := by | |
| obtain β¨Z,hZβ© := finite_family_lattice_shear L N M K J hJ u labels hhole alphabet Lstar hLstar hcost | |
| apply joined_holes_to_cover hn L N M Z K hK hconv | |
| apply all_height_hole_bound L N hints M Z K | |
| intro z hz | |
| obtain β¨s,hs,hraw,hsection,hloadβ© := hpatterns z hz | |
| exact (hZ (M z) s hs hraw hsection A hload).trans (ENNReal.ofReal_le_ofReal herror) | |
| end SingleLatticeCovering.CoverGeometry | |
| namespace SingleLatticeCovering.Vertical | |
| open ConstructionA LatticeGeometry | |
| lemma Block.integer_mem (B : Block) (k : Fin B.b β β€) : | |
| (fun j => (k j : β)) β B.lattice := by | |
| change β z : Fin B.b β β€, residue B.p z β Submodule.span (ZMod B.p) {B.direction} β§ | |
| (fun j => (z j : β)/(B.p : β)) = (fun j => (k j : β)) | |
| refine β¨fun j => B.p*k j,?_,?_β© | |
| Β· convert (Submodule.span (ZMod B.p) {B.direction}).zero_mem using 1 | |
| ext j | |
| simp [residue] | |
| Β· ext j | |
| push_cast | |
| field_simp [B.prime.ne_zero] | |
| namespace Chain | |
| variable {B : Block} | |
| lemma raw_integer_mem (c : Chain B) (k : Fin c.dim β β€) : | |
| (fun j => (k j : β)) β c.rawLattice := by | |
| induction c with | |
| | base B => exact B.integer_mem k | |
| | append c B w ih => | |
| exact β¨ih (fun j => k (Fin.castAdd B.b j)), | |
| B.integer_mem (fun j => k (Fin.natAdd c.dim j))β© | |
| lemma full_raw_integer_mem (c : Chain B) (k : Fin c.fullDim β β€) : | |
| (fun j => (k j : β)) β c.fullRaw := | |
| β¨c.raw_integer_mem (fun j => k (Fin.castAdd B.terminalDim j)), | |
| integer_mem _ (fun j => k (Fin.natAdd c.dim j))β© | |
| noncomputable def alphabetSeq (c : Chain B) (j : β) : Finset β := | |
| if h : j<c.fullDim then c.alphabets β¨j,hβ© else β | |
| @[simp] lemma alphabetSeq_fin (c : Chain B) (j : Fin c.fullDim) : | |
| c.alphabetSeq j.val=c.alphabets j := by | |
| simp [alphabetSeq,j.isLt] | |
| end Chain | |
| end SingleLatticeCovering.Vertical | |
| namespace SingleLatticeCovering.Vertical | |
| open MeasureTheory Folded LatticeGeometry Completion Shear CoverGeometry | |
| open scoped BigOperators Pointwise ENNReal | |
| theorem prepared_chain_to_cover {Ξ± : Type*} [Fintype Ξ±] {B : Block} (c : Chain B) | |
| {m : β} (hn : 2 β€ m+c.fullDim) | |
| (L : Submodule β€ (Fin m β β)) [DiscreteTopology L] [IsZLattice β L] | |
| (K : Set (Fin (m+c.fullDim) β β)) (hK : IsCompact K) (hconv : Convex β K) | |
| (J : Ξ± β Set (Fin m β β)) (hJ : β a, IsCompact (J a)) (u : Ξ± β β) | |
| (ΞΊ Ο csec Csec Ξ΅ Ο A Lstar : β) | |
| (hΟ : 0 β€ Ο) (hc : 0 β€ csec) (hC : 0 β€ Csec) (hΟ : 0 β€ Ο) (hA : 0 < A) | |
| (hpat : β y : c.FullVec, β P : Finset c.FullVec, | |
| P.Nonempty β§ SuffixBinary P β§ | |
| (β l β P, l β c.fullRaw β§ c.FullResidual y l β§ | |
| c.det*gamma (y-c.fullLinear l) β€ Ξ΅) β§ | |
| ΞΊ β€ β l β P, c.det*gamma (y-c.fullLinear l)) | |
| (hsection : β v : c.FullVec, (β j, (v j)^2) β€ c.radiusSq+(B.terminalDim : β) β | |
| β a : Ξ±, (β j β J a, Fin.append j v β K) β§ | |
| csec*Ο*(c.det*gamma v) β€ u a β§ u a β€ Csec*Ο*(c.det*gamma v)) | |
| (hhole : β a, Ο β€ u a β u a β€ Csec*Ο*Ξ΅ β | |
| torusMeasure m ((latticeProjection L '' J a)αΆ) β€ ENNReal.ofReal (Real.exp (-u a/2))) | |
| (hload : A+(2^c.fullDim : β)*Ο β€ csec*ΞΊ*Ο) | |
| (hLstar : 1 β€ Lstar) | |
| (hcost : ((β q β Finset.range (c.fullDim+1), | |
| (allPatterns c.alphabetSeq | |
| (Finset.univ.filter (fun a => Ο β€ u a β§ u a β€ Csec*Ο*Ξ΅)) q).card : β) : β) < Lstar) | |
| (herror : Real.exp ((2^c.fullDim : β)*Real.log Lstar-A/2) β€ | |
| 1/((m+c.fullDim : β) : β)^(2*(m+c.fullDim))) : | |
| β (Ξ : Submodule β€ (Fin (m+c.fullDim) β β)) (_ : DiscreteTopology Ξ), | |
| IsZLattice β Ξ β§ K+(Ξ : Set (Fin (m+c.fullDim) β β)) = Set.univ β§ | |
| (volume K).toReal / ZLattice.covolume Ξ β€ | |
| Real.exp 1*((volume K).toReal /(ZLattice.covolume L*c.det)) := by | |
| classical | |
| let labels := Finset.univ.filter (fun a => Ο β€ u a β§ u a β€ Csec*Ο*Ξ΅) | |
| have hs : β a β labels, torusMeasure m ((latticeProjection L '' J a)αΆ) β€ | |
| ENNReal.ofReal (Real.exp (-u a/2)) := by | |
| intro a ha | |
| exact hhole a (Finset.mem_filter.mp ha).2.1 (Finset.mem_filter.mp ha).2.2 | |
| obtain β¨Ξ,hd,hfull,hcover,hdensβ© := finite_patterns_to_cover hn L c.fullRaw | |
| c.full_raw_integer_mem c.fullLinear K hK hconv J hJ u labels hs | |
| c.alphabetSeq Lstar A hLstar hcost herror (by | |
| intro z hz | |
| obtain β¨P,hPn,hPb,hPl,hPwβ© := hpat (c.fullLinear z) | |
| exact section_labeled_retained P hPn hPb c.fullRaw (fun l hl => (hPl l hl).1) | |
| c.fullLinear (c.fullLinear z) K J u (fun l => c.det*gamma (c.fullLinear z-c.fullLinear l)) | |
| ΞΊ Ο csec Csec Ξ΅ Ο A hΟ hc hC hΟ hA hPw (fun l hl => (hPl l hl).2.2) | |
| (fun l hl => hsection _ (c.full_residual_square _ _ (hPl l hl).2.1)) | |
| hload c.alphabetSeq (by | |
| intro l hl j | |
| rw [Chain.alphabetSeq_fin] | |
| exact c.mem_alphabets z l hz (hPl l hl).2.1 (hPl l hl).1 j)) | |
| refine β¨Ξ,hd,hfull,hcover,?_β© | |
| change (volume K).toReal / ZLattice.covolume Ξ β€ | |
| Real.exp 1*((volume K).toReal /(ZLattice.covolume L*ZLattice.covolume c.fullLattice)) at hdens | |
| simpa only [c.full_covolume] using hdens | |
| end SingleLatticeCovering.Vertical | |
| end | |
| end | |
| section | |
| noncomputable section | |
| namespace SingleLatticeCovering.Vertical | |
| open MeasureTheory Folded LatticeGeometry Completion Shear CoverGeometry | |
| open scoped BigOperators Pointwise ENNReal | |
| lemma Chain.det_pos {B : Block} (c : Chain B) : 0 < c.det := by | |
| rw [βc.full_covolume] | |
| exact ZLattice.covolume_pos c.fullLattice | |
| theorem labeled_chain_to_cover {Ξ± : Type*} [Fintype Ξ±] {B : Block} (c : Chain B) | |
| {m : β} (hn : 2 β€ m+c.fullDim) | |
| (L : Submodule β€ (Fin m β β)) [DiscreteTopology L] [IsZLattice β L] | |
| (K : Set (Fin (m+c.fullDim) β β)) (hK : IsCompact K) (hconv : Convex β K) | |
| (hV : 0 < (volume K).toReal) | |
| (J : Ξ± β Set (Fin m β β)) (hJ : β a, IsCompact (J a)) | |
| (ΞΊ Ο csec Csec Ξ΅ Ο A Lstar : β) | |
| (hΟ : 0 < Ο) (hc : 0 β€ csec) (hC : 0 β€ Csec) (hΟ : 0 β€ Ο) (hA : 0 < A) | |
| (hcov : ZLattice.covolume L volume=(volume K).toReal/(Ο*c.det)) | |
| (hpat : β y : c.FullVec, β P : Finset c.FullVec, | |
| P.Nonempty β§ SuffixBinary P β§ | |
| (β l β P, l β c.fullRaw β§ c.FullResidual y l β§ | |
| c.det*gamma (y-c.fullLinear l) β€ Ξ΅) β§ | |
| ΞΊ β€ β l β P, c.det*gamma (y-c.fullLinear l)) | |
| (hsection : β v : c.FullVec, (β j, (v j)^2) β€ c.radiusSq+(B.terminalDim : β) β | |
| β a : Ξ±, (β j β J a, Fin.append j v β K) β§ | |
| csec*(volume K).toReal*gamma v β€ (volume (J a)).toReal β§ | |
| (volume (J a)).toReal β€ Csec*(volume K).toReal*gamma v) | |
| (hhole : β a, Ο β€ (volume (J a)).toReal/ZLattice.covolume L volume β | |
| (volume (J a)).toReal/ZLattice.covolume L volume β€ Csec*Ο*Ξ΅ β | |
| torusMeasure m ((latticeProjection L '' J a)αΆ) β€ | |
| ENNReal.ofReal (Real.exp (-((volume (J a)).toReal/ZLattice.covolume L volume)/2))) | |
| (hload : A+(2^c.fullDim : β)*Ο β€ csec*ΞΊ*Ο) | |
| (hLstar : 1 β€ Lstar) | |
| (hcost : ((β q β Finset.range (c.fullDim+1), | |
| (allPatterns c.alphabetSeq | |
| (Finset.univ.filter (fun a => Ο β€ (volume (J a)).toReal/ZLattice.covolume L volume β§ | |
| (volume (J a)).toReal/ZLattice.covolume L volume β€ Csec*Ο*Ξ΅)) q).card : β) : β) < Lstar) | |
| (herror : Real.exp ((2^c.fullDim : β)*Real.log Lstar-A/2) β€ | |
| 1/((m+c.fullDim : β) : β)^(2*(m+c.fullDim))) : | |
| β (Ξ : Submodule β€ (Fin (m+c.fullDim) β β)) (_ : DiscreteTopology Ξ), | |
| IsZLattice β Ξ β§ K+(Ξ : Set (Fin (m+c.fullDim) β β)) = Set.univ β§ | |
| (volume K).toReal / ZLattice.covolume Ξ volume β€ Real.exp 1*Ο := by | |
| have _ := hV | |
| have hL : 0 < ZLattice.covolume L volume := ZLattice.covolume_pos L | |
| have hVeq : (volume K).toReal=ZLattice.covolume L volume*(Ο*c.det) := by | |
| rw [hcov]; exact (div_mul_cancelβ _ (mul_pos hΟ c.det_pos).ne').symm | |
| have hratio (a g : β) : (a*(volume K).toReal*g)/ZLattice.covolume L volume=a*Ο*(c.det*g) := by | |
| rw [hVeq] | |
| field_simp [hL.ne'] | |
| obtain β¨Ξ,hd,hfull,hcover,hboundβ© := prepared_chain_to_cover c hn L K hK hconv J hJ | |
| (fun a => (volume (J a)).toReal/ZLattice.covolume L volume) ΞΊ Ο csec Csec Ξ΅ Ο A Lstar | |
| hΟ.le hc hC hΟ hA hpat (by | |
| intro v hv | |
| obtain β¨a,ha,hl,huβ© := hsection v hv | |
| refine β¨a,ha,?_,?_β© | |
| Β· rw [βhratio csec (gamma v)] | |
| exact div_le_div_of_nonneg_right hl hL.le | |
| Β· rw [βhratio Csec (gamma v)] | |
| exact div_le_div_of_nonneg_right hu hL.le) hhole hload hLstar hcost herror | |
| refine β¨Ξ,hd,hfull,hcover,?_β© | |
| have heq : (volume K).toReal/(ZLattice.covolume L volume*c.det)=Ο := by | |
| rw [hVeq] | |
| field_simp [hL.ne',c.det_pos.ne'] | |
| simpa only [heq] using hbound | |
| end SingleLatticeCovering.Vertical | |
| end | |
| end | |
| section | |
| namespace SingleLatticeCovering.LatticeGeometry | |
| open MeasureTheory | |
| open scoped Pointwise | |
| lemma affine_image_volume {n : β} (e : (Fin n β β) ββ[β] (Fin n β β)) | |
| (t : Fin n β β) (K : Set (Fin n β β)) : | |
| volume ((fun x => e x+t) '' K) = ENNReal.ofReal |LinearMap.det e.toLinearMap| * volume K := by | |
| have hs : (fun x => e x+t) '' K = (fun x => x+t) '' (e '' K) := by | |
| rw [Set.image_image] | |
| rw [hs,Set.image_add_right,measure_preimage_add_right] | |
| exact volume.addHaar_image_linearMap e.toLinearMap K | |
| lemma affine_image_cover {n : β} (L : Submodule β€ (Fin n β β)) | |
| (e : (Fin n β β) ββ[β] (Fin n β β)) (t : Fin n β β) | |
| (K : Set (Fin n β β)) (hcover : K+(L : Set (Fin n β β))=Set.univ) : | |
| (fun x => e x+t) '' K+(image L e : Set (Fin n β β))=Set.univ := by | |
| apply Set.eq_univ_of_forall | |
| intro x | |
| have hx : e.symm (x-t) β K+(L : Set (Fin n β β)) := by rw [hcover]; trivial | |
| obtain β¨k,hk,l,hl,hklβ© := hx | |
| refine β¨e k+t,β¨k,hk,rflβ©,e l,(mem_image L e (e l)).mpr β¨l,hl,rflβ©,?_β© | |
| change e k+t+e l=x | |
| have he : e k+e l=x-t := by | |
| rw [βmap_add] | |
| change k+l=e.symm (x-t) at hkl | |
| rw [hkl,e.apply_symm_apply] | |
| calc e k+t+e l = (e k+e l)+t := by abel | |
| _ = x := by rw [he]; abel | |
| lemma affine_image_density {n : β} (L : Submodule β€ (Fin n β β)) | |
| [DiscreteTopology L] [IsZLattice β L] | |
| (e : (Fin n β β) ββ[β] (Fin n β β)) (t : Fin n β β) | |
| (K : Set (Fin n β β)) : | |
| (volume ((fun x => e x+t) '' K)).toReal / ZLattice.covolume (image L e) = | |
| (volume K).toReal / ZLattice.covolume L := by | |
| rw [affine_image_volume,ENNReal.toReal_mul,ENNReal.toReal_ofReal (abs_nonneg _),image_covolume] | |
| exact mul_div_mul_left _ _ (abs_ne_zero.mpr e.isUnit_det'.ne_zero) | |
| end SingleLatticeCovering.LatticeGeometry | |
| noncomputable section | |
| namespace SingleLatticeCovering.LatticeGeometry | |
| open MeasureTheory | |
| open scoped Pointwise | |
| lemma affineEquiv_eq_linear_add {n : β} | |
| (e : (Fin n β β) βα΅[β] (Fin n β β)) (x : Fin n β β) : e x=e.linear x+e 0 := by | |
| have h := e.map_vadd (0 : Fin n β β) x | |
| simpa using h | |
| lemma pull_back_cover {n : β} (e : (Fin n β β) βα΅[β] (Fin n β β)) | |
| (K : Set (Fin n β β)) (L : Submodule β€ (Fin n β β)) | |
| [DiscreteTopology L] [IsZLattice β L] | |
| (hcover : e '' K+(L : Set (Fin n β β))=Set.univ) {d : β} | |
| (hd : (volume (e '' K)).toReal/ZLattice.covolume L β€ d) : | |
| β (Ξ : Submodule β€ (Fin n β β)) (_ : DiscreteTopology Ξ), IsZLattice β Ξ β§ | |
| K+(Ξ : Set (Fin n β β))=Set.univ β§ (volume K).toReal/ZLattice.covolume Ξ β€ d := by | |
| let Ξ := image L e.symm.linear | |
| have he : (fun x => e.symm.linear x+e.symm 0) '' (e '' K)=K := by | |
| simp_rw [βaffineEquiv_eq_linear_add] | |
| exact e.symm_image_image K | |
| refine β¨Ξ,inferInstance,inferInstance,?_,?_β© | |
| Β· have h := affine_image_cover L e.symm.linear (e.symm 0) (e '' K) hcover | |
| rwa [he] at h | |
| Β· have h := affine_image_density L e.symm.linear (e.symm 0) (e '' K) | |
| rw [he] at h | |
| exact h.trans_le hd | |
| end SingleLatticeCovering.LatticeGeometry | |
| end | |
| end | |
| section | |
| noncomputable section | |
| open Set Metric MeasureTheory MeasureTheory.Measure Module | |
| open scoped ENNReal NNReal BigOperators | |
| namespace SingleLatticeCovering.Sections | |
| lemma compact_separated_cover {E : Type*} [PseudoMetricSpace E] | |
| (K : Set E) (hK : IsCompact K) {Ξ΄ : ββ₯0} (hΞ΄ : 0 < Ξ΄) : | |
| β S : Finset E, (βS : Set E) β K β§ | |
| Metric.IsSeparated Ξ΄ (βS : Set E) β§ Metric.IsCover Ξ΄ K (βS : Set E) := by | |
| classical | |
| obtain β¨U,hUK,hUf,hUCβ© := Metric.exists_finite_isCover_of_isCompact | |
| (Ξ΅ := Ξ΄/2) (by positivity) hK | |
| have hfin : Metric.packingNumber Ξ΄ K β β€ := by | |
| have hh := Metric.packingNumber_two_mul_le_externalCoveringNumber (Ξ΄/2) K | |
| rw [mul_div_cancelβ _ (by norm_num : (2 : ββ₯0) β 0)] at hh | |
| exact ne_top_of_le_ne_top (Set.encard_ne_top_iff.mpr hUf) (hh.trans hUC.externalCoveringNumber_le_encard) | |
| have hSf' : (Metric.maximalSeparatedSet Ξ΄ K).Finite := | |
| Set.encard_ne_top_iff.mp (by rw [Metric.encard_maximalSeparatedSet hfin]; exact hfin) | |
| exact β¨hSf'.toFinset,by simpa using (Metric.maximalSeparatedSet_subset (Ξ΅ := Ξ΄) (A := K)), | |
| by simpa using (Metric.isSeparated_maximalSeparatedSet (Ξ΅ := Ξ΄) (A := K)), | |
| by simpa using Metric.isCover_maximalSeparatedSet hfinβ© | |
| lemma separated_card_bound {E : Type*} [NormedAddCommGroup E] [NormedSpace β E] | |
| [FiniteDimensional β E] [MeasurableSpace E] [BorelSpace E] | |
| (ΞΌ : Measure E) [IsAddHaarMeasure ΞΌ] | |
| (S : Finset E) {R Ξ΄ : β} (hR : 0 β€ R) (hΞ΄ : 0 < Ξ΄) | |
| (hS : β x β S, βxβ β€ R) | |
| (hsep : β x β S, β y β S, x β y β Ξ΄ < dist x y) : | |
| (S.card : β) β€ (1+2*R/Ξ΄)^(finrank β E) := by | |
| classical | |
| have hd : 0 < Ξ΄/2 := half_pos hΞ΄ | |
| have hdis : (βS : Set E).PairwiseDisjoint (fun x => Metric.ball x (Ξ΄/2)) := by | |
| intro x hx y hy hxy | |
| apply Set.disjoint_left.mpr | |
| intro z hzx hzy | |
| have hxz : dist x z < Ξ΄/2 := by simpa only [Metric.mem_ball,dist_comm] using hzx | |
| have hzy' : dist z y < Ξ΄/2 := hzy | |
| have hh := dist_triangle x z y | |
| have hxy' := hsep x hx y hy hxy | |
| linarith | |
| have hsub : (β x β (βS : Set E), Metric.ball x (Ξ΄/2)) β Metric.ball (0 : E) (R+Ξ΄/2) := by | |
| intro z hz | |
| obtain β¨x,hx,hzxβ© := Set.mem_iUnionβ.mp hz | |
| rw [Metric.mem_ball,dist_zero_right] | |
| have hdist : dist z x < Ξ΄/2 := hzx | |
| have hh := norm_add_le (z-x) x | |
| rw [sub_add_cancel,βdist_eq_norm] at hh | |
| linarith [hS x hx] | |
| have hΞΌ := measure_mono (ΞΌ := ΞΌ) hsub | |
| simp only [Finset.mem_coe] at hΞΌ | |
| rw [measure_biUnion_finset hdis (fun x hx => Metric.isOpen_ball.measurableSet)] at hΞΌ | |
| simp_rw [ΞΌ.addHaar_ball_of_pos _ hd] at hΞΌ | |
| rw [Finset.sum_const, nsmul_eq_mul, | |
| ΞΌ.addHaar_ball_of_pos _ (by linarith : 0 < R+Ξ΄/2)] at hΞΌ | |
| have hunit0 : ΞΌ (Metric.ball (0 : E) 1) β 0 := | |
| Metric.isOpen_ball.measure_ne_zero ΞΌ β¨0, by simpβ© | |
| have hunitTop : ΞΌ (Metric.ball (0 : E) 1) β β := | |
| measure_ball_ne_top | |
| have hreal : (S.card : β)*(Ξ΄/2)^finrank β E β€ (R+Ξ΄/2)^finrank β E := by | |
| have hh := (ENNReal.mul_le_mul_iff_left hunit0 hunitTop).mp (by simpa only [βmul_assoc] using hΞΌ) | |
| have hs : (S.card : ββ₯0β)*ENNReal.ofReal ((Ξ΄/2)^finrank β E) = | |
| ENNReal.ofReal ((S.card : β)*(Ξ΄/2)^finrank β E) := by rw [ENNReal.ofReal_mul (Nat.cast_nonneg _)]; simp | |
| rw [hs] at hh | |
| exact (ENNReal.ofReal_le_ofReal_iff (by positivity)).mp hh | |
| have he : (1+2*R/Ξ΄)^finrank β E = (R+Ξ΄/2)^finrank β E/(Ξ΄/2)^finrank β E := by | |
| rw [βdiv_pow]; congr 1; field_simp; ring | |
| rw [he] | |
| exact (le_div_iffβ (pow_pos hd _)).mpr hreal | |
| lemma ball_finite_net {E : Type*} [NormedAddCommGroup E] [NormedSpace β E] | |
| [FiniteDimensional β E] [MeasurableSpace E] [BorelSpace E] | |
| (ΞΌ : Measure E) [IsAddHaarMeasure ΞΌ] {R : β} (hR : 0 < R) | |
| {m : β} (hm : 1 β€ m) : | |
| β S : Finset E, (S.card : β) β€ (3*(m : β)^2)^(finrank β E) β§ | |
| (β a β S, βaβ β€ R) β§ | |
| β y : E, βyβ β€ R β β a β S, dist y a β€ R/(m : β)^2 := by | |
| classical | |
| have hm0 : (0 : β) < m := by exact_mod_cast hm | |
| have hd : 0 < R/(m : β)^2 := div_pos hR (pow_pos hm0 2) | |
| let Ξ΄ : ββ₯0 := β¨R/(m : β)^2,hd.leβ© | |
| obtain β¨S,hS,hsep,hcoverβ© := compact_separated_cover (Metric.closedBall (0 : E) R) | |
| (isCompact_closedBall _ _) (show 0 < Ξ΄ from hd) | |
| have hSn : β a β S, βaβ β€ R := by | |
| intro a ha | |
| simpa only [Metric.mem_closedBall,dist_zero_right] using hS ha | |
| have hsep' : β x β S, β y β S, x β y β R/(m : β)^2 < dist x y := by | |
| intro x hx y hy hxy | |
| have hh := ENNReal.toReal_strict_mono (edist_ne_top x y) (hsep hx hy hxy) | |
| rw [ENNReal.coe_toReal,edist_dist,ENNReal.toReal_ofReal dist_nonneg] at hh | |
| exact hh | |
| have hcard := separated_card_bound ΞΌ S hR.le hd hSn hsep' | |
| have hm1 : (1 : β) β€ m := by exact_mod_cast hm | |
| have hratio : 1+2*R/(R/(m : β)^2) β€ 3*(m : β)^2 := by | |
| have he : 2*R/(R/(m : β)^2)=2*(m : β)^2 := by field_simp | |
| rw [he]; nlinarith | |
| refine β¨S,hcard.trans (pow_le_pow_leftβ (by positivity) hratio _),hSn,?_β© | |
| intro y hy | |
| obtain β¨a,ha,hyaβ© := hcover (show y β Metric.closedBall (0 : E) R by simpa using hy) | |
| refine β¨a,ha,?_β© | |
| have hh := ENNReal.toReal_mono ENNReal.coe_ne_top hya | |
| rw [ENNReal.coe_toReal,edist_dist,ENNReal.toReal_ofReal dist_nonneg] at hh | |
| exact hh | |
| end SingleLatticeCovering.Sections | |
| noncomputable section | |
| open Set Metric MeasureTheory MeasureTheory.Measure Module | |
| open scoped Pointwise ENNReal NNReal BigOperators | |
| namespace SingleLatticeCovering.Sections | |
| variable {E F : Type*} [NormedAddCommGroup E] [NormedSpace β E] | |
| [NormedAddCommGroup F] [NormedSpace β F] | |
| def fiber (K : Set (E Γ F)) (y : F) : Set E := {x | (x,y) β K} | |
| lemma fiber_compact {E : Type*} {F : Type*} [NormedAddCommGroup E] [NormedSpace β E] [NormedAddCommGroup F] [NormedSpace β F] {K : Set (E Γ F)} (hK : IsCompact K) (y : F) : | |
| IsCompact (fiber K y) := by | |
| have he : fiber K y = Prod.fst '' (K β© Prod.snd β»ΒΉ' {y}) := by | |
| ext x; constructor | |
| Β· intro hx; exact β¨(x,y),β¨hx,by simpβ©,rflβ© | |
| Β· rintro β¨β¨x',y'β©,β¨hxy,hyβ©,hxβ© | |
| have hy' : y'=y := hy | |
| change x'=x at hx | |
| subst x'; subst y'; exact hxy | |
| rw [he] | |
| exact (hK.inter_right (isClosed_singleton.preimage continuous_snd)).image continuous_fst | |
| lemma fiber_convex {K : Set (E Γ F)} (hK : Convex β K) (y : F) : | |
| Convex β (fiber K y) := by | |
| intro x hx z hz a b ha hb hab | |
| have hh := hK hx hz ha hb hab | |
| simpa only [fiber, Set.mem_ofPred_eq, Prod.smul_mk, Prod.mk_add_mk, | |
| βadd_smul,hab,one_smul] using hh | |
| lemma nearby_fiber_inclusion {K : Set (E Γ F)} (hK : Convex β K) | |
| {R : β} (hR : 0 β€ R) {m : β} (hm : 1 β€ m) | |
| (hcenter : β z : F, βzβ β€ 2*R β (0,z) β K) | |
| {a y : F} (ha : βaβ β€ R) (hya : dist y a β€ R/(m : β)^2) : | |
| (1-(m : β)^(-2 : β€)) β’ fiber K a β fiber K y := by | |
| have _ := hR | |
| have hm1 : (1 : β) β€ m := by exact_mod_cast hm | |
| have hm0 : (0 : β) < m := lt_of_lt_of_le zero_lt_one hm1 | |
| let z := a+(m : β)^2 β’ (y-a) | |
| have hz : βzβ β€ 2*R := by | |
| calc | |
| _ β€ βaβ+β(m : β)^2 β’ (y-a)β := norm_add_le _ _ | |
| _ = βaβ+(m : β)^2*dist y a := by rw [norm_smul, Real.norm_of_nonneg (sq_nonneg _),dist_eq_norm] | |
| _ β€ R+(m : β)^2*(R/(m : β)^2) := add_le_add ha (mul_le_mul_of_nonneg_left hya (sq_nonneg _)) | |
| _ = 2*R := by field_simp; ring | |
| have ht : 0 β€ 1-(m : β)^(-2 : β€) := by | |
| norm_num only [zpow_neg, zpow_ofNat] | |
| have hh : 1 β€ (m : β)^2 := one_le_powβ hm1 | |
| exact sub_nonneg.mpr ((inv_le_oneβ (pow_pos hm0 _)).mpr hh) | |
| intro v hv | |
| obtain β¨x,hx,rflβ© := hv | |
| have hh := hK hx (hcenter z hz) ht (by positivity : 0 β€ (m : β)^(-2 : β€)) (by ring) | |
| have he : (1-(m : β)^(-2 : β€)) β’ a+(m : β)^(-2 : β€) β’ z=y := by | |
| dsimp [z]; rw [smul_add,smul_smul] | |
| norm_num only [zpow_neg, zpow_ofNat] | |
| rw [inv_mul_cancelβ (pow_ne_zero 2 hm0.ne'),one_smul] | |
| module | |
| simpa only [fiber,Set.mem_ofPred_eq,Prod.smul_mk,Prod.mk_add_mk,smul_zero,add_zero,he] using hh | |
| lemma shrink_power_half {m : β} (hm : 2 β€ m) : | |
| (1-(m : β)^(-2 : β€))^m β₯ (1/2 : β) := by | |
| have hm2 : (2 : β) β€ m := by exact_mod_cast hm | |
| have hp : 0 < (m : β)^2 := by positivity | |
| have hinv : (m : β)^(-2 : β€)=((m : β)^2)β»ΒΉ := by norm_num [zpow_neg] | |
| rw [hinv] | |
| have hi : ((m : β)^2)β»ΒΉ β€ 1 := (inv_le_oneβ hp).mpr (by nlinarith) | |
| have hh := one_add_mul_le_pow (show -2 β€ -((m : β)^2)β»ΒΉ by linarith) m | |
| have he : (m : β)*((m : β)^2)β»ΒΉ=(m : β)β»ΒΉ := by field_simp | |
| have hi2 : (m : β)β»ΒΉ β€ 1/2 := by simpa only [one_div] using one_div_le_one_div_of_le (by norm_num : (0 : β) < 2) hm2 | |
| simp only [mul_neg,he,βsub_eq_add_neg] at hh | |
| linarith | |
| lemma prescribed_volume [FiniteDimensional β E] [MeasurableSpace E] [BorelSpace E] | |
| (ΞΌ : Measure E) [IsAddHaarMeasure ΞΌ] (hn : 0 < finrank β E) | |
| {A : Set E} (hA : IsCompact A) (hconv : Convex β A) (hzero : (0 : E) β A) | |
| {v : β} (hv : 0 < v) (hvol : v β€ (ΞΌ A).toReal) : | |
| β J : Set E, IsCompact J β§ Convex β J β§ (0 : E) β J β§ J β A β§ (ΞΌ J).toReal=v := by | |
| have hΞΌ : 0 < (ΞΌ A).toReal := hv.trans_le hvol | |
| let t : β := (v/(ΞΌ A).toReal)^((finrank β E : β)β»ΒΉ) | |
| have ht : 0 < t := Real.rpow_pos_of_pos (div_pos hv hΞΌ) _ | |
| have ht1 : t β€ 1 := Real.rpow_le_one (by positivity) ((div_le_one hΞΌ).mpr hvol) (by positivity) | |
| refine β¨t β’ A, hA.smul t, hconv.smul t,?_,?_,?_β© | |
| Β· exact β¨0,hzero,smul_zero _β© | |
| Β· rintro x β¨a,ha,rflβ© | |
| exact hconv.smul_mem_of_zero_mem hzero ha β¨ht.le,ht1β© | |
| Β· rw [ΞΌ.addHaar_smul_of_nonneg ht.le, ENNReal.toReal_mul, | |
| ENNReal.toReal_ofReal (pow_nonneg ht.le _)] | |
| have he : t^finrank β E=v/(ΞΌ A).toReal := | |
| Real.rpow_inv_natCast_pow (div_pos hv hΞΌ).le hn.ne' | |
| rw [he,div_mul_cancelβ _ hΞΌ.ne'] | |
| end SingleLatticeCovering.Sections | |
| noncomputable section | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end OAI | |