Download data/lean/OAI/GroupTheory/UniversalGroup/SimplexDisk.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 9.16 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/GroupTheory/UniversalGroup/SimplexDisk.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/GroupTheory/UniversalGroup/SimplexDisk.lean
-
curl -L -o SimplexDisk.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/GroupTheory/UniversalGroup/SimplexDisk.lean
9.16 kB
| import OAI.GroupTheory.UniversalGroup.UniversalPresentation | |
| namespace OAI | |
| open Set Metric Topology BigOperators | |
| namespace UniversalFInfinity.SimplexDisk | |
| noncomputable section | |
| def Simplex (A : Type*) [Fintype A] : Set (A β β) := | |
| {x | (β a, 0 β€ x a) β§ β a, x a = 1} | |
| instance (A : Type*) [Fintype A] : CompactSpace (Simplex A) := by | |
| apply isCompact_iff_compactSpace.mp | |
| have closed : IsClosed (Simplex A) := by | |
| have description : Simplex A = | |
| (β index, {point | (0 : β) β€ point index}) β© {point | β index, point index = 1} := by | |
| ext point | |
| simp [Simplex] | |
| rw [description] | |
| exact (isClosed_iInter fun index => isClosed_le continuous_const (continuous_apply index)).inter | |
| (isClosed_eq (continuous_finsetSum _ fun index _ => continuous_apply index) continuous_const) | |
| apply (isCompact_Icc (a := (0 : A β β)) (b := 1)).of_isClosed_subset closed | |
| intro point membership | |
| refine β¨membership.1, fun index => ?_β© | |
| change point index β€ (1 : β) | |
| rw [β membership.2] | |
| exact Finset.single_le_sum (fun other _ => membership.1 other) (Finset.mem_univ index) | |
| def Truncated (n : β) : Set (Fin n β β) := | |
| {x | (β i, 0 β€ x i) β§ β i, x i β€ 1} | |
| def Positive (n : β) : Set (Fin n β β) := | |
| {x | (β i, 0 < x i) β§ β i, x i < 1} | |
| def sumCLM (n : β) : (Fin n β β) βL[β] β := | |
| β i, ContinuousLinearMap.proj i | |
| @[simp] lemma sumCLM_apply (n : β) (x : Fin n β β) : sumCLM n x = β i, x i := by | |
| simp [sumCLM] | |
| lemma truncated_closed (n : β) : IsClosed (Truncated n) := by | |
| have h : Truncated n = (β i, {x | (0:β) β€ x i}) β© {x | β i, x i β€ 1} := by | |
| ext x; simp [Truncated] | |
| rw [h] | |
| exact (isClosed_iInter fun i => isClosed_le continuous_const (continuous_apply i)).inter | |
| (isClosed_le (continuous_finsetSum _ fun i _ => continuous_apply i) continuous_const) | |
| lemma positive_open (n : β) : IsOpen (Positive n) := by | |
| have h : Positive n = (β i, {x | (0:β) < x i}) β© {x | β i, x i < 1} := by | |
| ext x; simp [Positive] | |
| rw [h] | |
| exact (isOpen_iInter_of_finite fun i => isOpen_lt continuous_const (continuous_apply i)).inter | |
| (isOpen_lt (continuous_finsetSum _ fun i _ => continuous_apply i) continuous_const) | |
| lemma interior_truncated (n : β) : interior (Truncated n) = Positive n := by | |
| apply Subset.antisymm | |
| Β· intro x hx | |
| have hc : β i, 0 < x i := by | |
| intro i | |
| have hh := interior_mono (show Truncated n β (Function.eval i) β»ΒΉ' Ici (0:β) from fun _ h => h.1 i) hx | |
| rw [β (isOpenMap_eval i).preimage_interior_eq_interior_preimage (continuous_apply i),interior_Ici] at hh | |
| exact hh | |
| refine β¨hc,?_β© | |
| cases n with | |
| | zero => simp | |
| | succ n => | |
| have hs : Function.Surjective (sumCLM (n+1)) := by | |
| intro r | |
| refine β¨Pi.single 0 r,?_β© | |
| simp | |
| have hh := interior_mono (show Truncated (n+1) β (sumCLM (n+1)) β»ΒΉ' Iic (1:β) from fun _ h => by simpa using h.2) hx | |
| rw [β ((sumCLM (n+1)).isOpenMap hs).preimage_interior_eq_interior_preimage (sumCLM (n+1)).continuous,interior_Iic] at hh | |
| simpa only [mem_preimage,mem_Iio,sumCLM_apply] using hh | |
| Β· apply (positive_open n).subset_interior_iff.mpr | |
| exact fun _ h => β¨fun i => (h.1 i).le,h.2.leβ© | |
| lemma truncated_convex (n : β) : Convex β (Truncated n) := by | |
| have h : Truncated n = (β i, ((LinearMap.proj i : (Fin n β β) ββ[β] β) β»ΒΉ' Ici 0)) β© | |
| (sumCLM n) β»ΒΉ' Iic 1 := by ext x; simp [Truncated] | |
| rw [h] | |
| exact (convex_iInter fun i => (convex_Ici (0:β)).linear_preimage (LinearMap.proj i)).inter | |
| ((convex_Iic (1:β)).linear_preimage (sumCLM n).toLinearMap) | |
| lemma truncated_bounded (n : β) : Bornology.IsBounded (Truncated n) := by | |
| apply (isBounded_Icc (a := (0 : Fin n β β)) (b := 1)).subset | |
| intro x hx | |
| refine β¨hx.1,fun i => ?_β© | |
| exact (Finset.single_le_sum (fun j _ => hx.1 j) (Finset.mem_univ i)).trans hx.2 | |
| lemma positive_nonempty (n : β) : (Positive n).Nonempty := by | |
| refine β¨fun _ => 1 / (n+1 : β),fun _ => by positivity,?_β© | |
| simp only [Finset.sum_const,Finset.card_univ,Fintype.card_fin,nsmul_eq_mul] | |
| have hn : (0:β) < n+1 := by positivity | |
| rw [mul_one_div,div_lt_one hn] | |
| linarith | |
| noncomputable def ambient (n : β) : (Fin n β β) ββ (Fin n β β) := | |
| Classical.choose (exists_homeomorph_image_interior_closure_frontier_eq_unitBall | |
| (truncated_convex n) (by rw [interior_truncated]; exact positive_nonempty n) (truncated_bounded n)) | |
| lemma ambient_positive (n : β) : ambient n '' Positive n = ball 0 1 := by | |
| simpa only [ambient,interior_truncated] using | |
| (Classical.choose_spec (exists_homeomorph_image_interior_closure_frontier_eq_unitBall | |
| (truncated_convex n) (by rw [interior_truncated]; exact positive_nonempty n) (truncated_bounded n))).1 | |
| lemma ambient_truncated (n : β) : ambient n '' Truncated n = closedBall 0 1 := by | |
| simpa only [ambient,(truncated_closed n).closure_eq] using | |
| (Classical.choose_spec (exists_homeomorph_image_interior_closure_frontier_eq_unitBall | |
| (truncated_convex n) (by rw [interior_truncated]; exact positive_nonempty n) (truncated_bounded n))).2.1 | |
| noncomputable def truncatedDisk (n : β) : Truncated n ββ closedBall (0 : Fin n β β) 1 := | |
| ((ambient n).image (Truncated n)).trans (Homeomorph.setCongr (ambient_truncated n)) | |
| noncomputable def simplexTruncated (n : β) : SimplexDisk.Simplex (Fin (n+1)) ββ Truncated n where | |
| toFun x := β¨fun i => x.1 i.succ,fun i => x.2.1 _,by | |
| have h := x.2.2 | |
| rw [Fin.sum_univ_succ] at h | |
| linarith [x.2.1 0]β© | |
| invFun x := β¨Fin.cons (1 - β i, x.1 i) x.1,by | |
| constructor | |
| Β· intro i | |
| refine Fin.cases ?_ (fun j => ?_) i | |
| Β· exact sub_nonneg.mpr x.2.2 | |
| Β· exact x.2.1 j | |
| Β· simp [Fin.sum_univ_succ]β© | |
| left_inv x := by | |
| apply Subtype.ext | |
| funext i | |
| refine Fin.cases ?_ (fun j => rfl) i | |
| have h := x.2.2 | |
| rw [Fin.sum_univ_succ] at h | |
| change 1 - β i : Fin n, x.1 i.succ = x.1 0 | |
| linarith | |
| right_inv x := by rfl | |
| continuous_toFun := (continuous_pi fun i => (continuous_apply i.succ).comp continuous_subtype_val).subtype_mk _ | |
| continuous_invFun := by | |
| apply Continuous.subtype_mk | |
| apply continuous_pi | |
| intro i | |
| refine Fin.cases ?_ (fun j => ?_) i | |
| Β· exact continuous_const.sub (continuous_finsetSum _ fun j _ => (continuous_apply j).comp continuous_subtype_val) | |
| Β· exact (continuous_apply j).comp continuous_subtype_val | |
| noncomputable def simplexDisk (n : β) : SimplexDisk.Simplex (Fin (n+1)) ββ closedBall (0 : Fin n β β) 1 := | |
| (simplexTruncated n).trans (truncatedDisk n) | |
| lemma simplexTruncated_positive (n : β) (x : SimplexDisk.Simplex (Fin (n+1))) : | |
| (simplexTruncated n x).1 β Positive n β β i, 0 < x.1 i := by | |
| have h := x.2.2 | |
| rw [Fin.sum_univ_succ] at h | |
| constructor | |
| Β· rintro β¨hc,hsβ© i | |
| refine Fin.cases ?_ (fun j => hc j) i | |
| change β i : Fin n, x.1 i.succ < 1 at hs | |
| linarith | |
| Β· intro hc | |
| refine β¨fun j => hc _,?_β© | |
| change β i : Fin n, x.1 i.succ < 1 | |
| linarith [hc 0] | |
| lemma simplexDisk_open (n : β) (x : SimplexDisk.Simplex (Fin (n+1))) : | |
| (simplexDisk n x).1 β ball 0 1 β β i, 0 < x.1 i := by | |
| rw [β simplexTruncated_positive] | |
| change ambient n (simplexTruncated n x).1 β ball 0 1 β _ | |
| rw [β ambient_positive] | |
| exact (ambient n).injective.mem_set_image | |
| lemma simplexDisk_boundary (n : β) (x : SimplexDisk.Simplex (Fin (n+1))) : | |
| (simplexDisk n x).1 β sphere 0 1 β β i, x.1 i = 0 := by | |
| have h := (simplexDisk n x).2 | |
| rw [mem_sphere,mem_closedBall] at * | |
| have ho := simplexDisk_open n x | |
| simp only [mem_ball] at ho | |
| constructor | |
| Β· intro he | |
| have hn : Β¬ β i, 0 < x.1 i := by rw [βho,he]; exact lt_irrefl _ | |
| push Not at hn | |
| obtain β¨i,hiβ© := hn | |
| exact β¨i,le_antisymm hi (x.2.1 i)β© | |
| Β· rintro β¨i,hiβ© | |
| apply le_antisymm h | |
| by_contra hn | |
| have hp := ho.mp (lt_of_not_ge hn) | |
| linarith [hp i] | |
| noncomputable def reindex {A B : Type*} [Fintype A] [Fintype B] (e : A β B) : | |
| SimplexDisk.Simplex A ββ SimplexDisk.Simplex B where | |
| toFun x := β¨fun b => x.1 (e.symm b),fun b => x.2.1 _,(e.symm.sum_comp x.1).trans x.2.2β© | |
| invFun x := β¨fun a => x.1 (e a),fun a => x.2.1 _,(e.sum_comp x.1).trans x.2.2β© | |
| left_inv x := by ext a; simp | |
| right_inv x := by ext b; simp | |
| continuous_toFun := (continuous_pi fun b => ((continuous_apply (e.symm b)).comp continuous_subtype_val : Continuous (fun x : SimplexDisk.Simplex A => x.1 (e.symm b)))).subtype_mk _ | |
| continuous_invFun := (continuous_pi fun a => ((continuous_apply (e a)).comp continuous_subtype_val : Continuous (fun x : SimplexDisk.Simplex B => x.1 (e a)))).subtype_mk _ | |
| lemma reindex_positive {A B : Type*} [Fintype A] [Fintype B] (e : A β B) (x : SimplexDisk.Simplex A) : | |
| (β b, 0 < (reindex e x).1 b) β β a, 0 < x.1 a := by | |
| constructor | |
| Β· intro h a | |
| change β b, 0 < x.1 (e.symm b) at h | |
| simpa only [e.symm_apply_apply] using h (e a) | |
| Β· intro h b | |
| change 0 < x.1 (e.symm b) | |
| exact h _ | |
| end | |
| end UniversalFInfinity.SimplexDisk | |
| end OAI | |