Download data/lean/OAI/Analysis/ForestSpace/Reflexivity.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/Analysis/ForestSpace/Reflexivity.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Analysis/ForestSpace/Reflexivity.lean
-
curl -L -o Reflexivity.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Analysis/ForestSpace/Reflexivity.lean
13.2 kB
| import OAI.Analysis.ForestSpace.Trees | |
| namespace OAI | |
| open scoped BigOperators | |
| open Finset | |
| namespace ForestSpace | |
| noncomputable section | |
| attribute [local instance] Classical.propDecidable | |
| section Reflexivity | |
| theorem reflexive_of_equiv {E F : Type} [NormedAddCommGroup E] [NormedSpace β E] | |
| [NormedAddCommGroup F] [NormedSpace β F] (e : E βL[β] F) (hF : Reflexive F) : Reflexive E := by | |
| intro Ξ¦ | |
| let Ξ¨ := Ξ¦.comp (ContinuousLinearMap.precomp β e.toContinuousLinearMap) | |
| obtain β¨y,hyβ© := hF Ξ¨ | |
| refine β¨e.symm y,?_β© | |
| ext Ο | |
| have hh := congrArg (fun z : StrongDual β (StrongDual β F) => z (Ο.comp e.symm.toContinuousLinearMap)) hy | |
| have he : (Ο.comp e.symm.toContinuousLinearMap).comp e.toContinuousLinearMap = Ο := by | |
| ext x | |
| simp | |
| change Ο (e.symm y) = Ξ¦ ((Ο.comp e.symm.toContinuousLinearMap).comp e.toContinuousLinearMap) at hh | |
| rw [he] at hh | |
| exact hh | |
| theorem reflexive_dual {E : Type} [NormedAddCommGroup E] [NormedSpace β E] | |
| (hE : Reflexive E) : Reflexive (StrongDual β E) := by | |
| intro Ξ¦ | |
| refine β¨Ξ¦.comp (NormedSpace.inclusionInDoubleDual β E),?_β© | |
| ext G | |
| obtain β¨x,rflβ© := hE G | |
| rfl | |
| theorem reflexive_hilbert (H : Type) [NormedAddCommGroup H] [InnerProductSpace β H] | |
| [CompleteSpace H] : Reflexive H := by | |
| intro Ξ¦ | |
| let R : H βL[β] StrongDual β H := (InnerProductSpace.toDual β H).toContinuousLinearEquiv | |
| let x := R.symm (Ξ¦.comp R.toContinuousLinearMap) | |
| refine β¨x,?_β© | |
| ext Ο | |
| obtain β¨y,rflβ© := R.surjective Ο | |
| change β H _ y x = Ξ¦ (R y) | |
| rw [real_inner_comm] | |
| exact InnerProductSpace.toDual_symm_apply | |
| section L2Dual | |
| variable {I : Type} (E : I β Type) [β i, NormedAddCommGroup (E i)] [β i, NormedSpace β (E i)] | |
| noncomputable def l2DualMap : lp (fun i => StrongDual β (E i)) 2 βL[β] StrongDual β (lp E 2) := | |
| lp.dualPairing 2 2 (fun i => ContinuousLinearMap.id β (StrongDual β (E i))) | |
| (K := 1) (fun _ => ContinuousLinearMap.norm_id_le) | |
| @[simp] theorem l2DualMap_apply (a : lp (fun i => StrongDual β (E i)) 2) (x : lp E 2) : | |
| l2DualMap E a x = β' i, a i (x i) := rfl | |
| @[simp] theorem l2DualMap_single_right (a : lp (fun i => StrongDual β (E i)) 2) | |
| (i : I) (x : E i) : l2DualMap E a (lp.single 2 i x) = a i x := by | |
| rw [l2DualMap_apply,tsum_eq_single i] | |
| Β· simp | |
| Β· intro j hj | |
| simp [Pi.single_eq_of_ne hj] | |
| @[simp] theorem l2DualMap_single_left (i : I) (Ο : StrongDual β (E i)) (x : lp E 2) : | |
| l2DualMap E (lp.single 2 i Ο) x = Ο (x i) := by | |
| rw [l2DualMap_apply,tsum_eq_single i] | |
| Β· simp | |
| Β· intro j hj | |
| simp [Pi.single_eq_of_ne hj] | |
| noncomputable def l2Restriction (Ο : StrongDual β (lp E 2)) (i : I) : StrongDual β (E i) := | |
| Ο.comp (lp.singleContinuousLinearMap β E 2 i) | |
| theorem l2_norm_sum_unit_le (u : β i, E i) (hu : β i, βu iβ β€ 1) | |
| (S : Finset I) (a : I β β) : | |
| ββ i β S, a i β’ lp.single 2 i (u i)β β€ Real.sqrt (β i β S, a i ^ 2) := by | |
| have he := lp.norm_sum_single (p := 2) (by norm_num) (fun i => a i β’ u i) S | |
| have he' : ββ i β S, a i β’ lp.single 2 i (u i)β^2 = | |
| β i β S, (|a i| * βu iβ)^2 := by | |
| simpa only [ENNReal.toReal_ofNat,Real.rpow_two,lp.single_smul,norm_smul, | |
| Real.norm_eq_abs] using he | |
| apply (sq_le_sqβ (norm_nonneg _) (Real.sqrt_nonneg _)).mp | |
| rw [Real.sq_sqrt (Finset.sum_nonneg (fun _ _ => sq_nonneg _)),he'] | |
| apply Finset.sum_le_sum | |
| intro i hi | |
| have hh := mul_le_mul_of_nonneg_left (hu i) (abs_nonneg (a i)) | |
| have hh' : (|a i| * βu iβ)^2 β€ |a i|^2 := | |
| (sq_le_sqβ (mul_nonneg (abs_nonneg _) (norm_nonneg _)) (abs_nonneg _)).mpr (by simpa using hh) | |
| simpa only [sq_abs] using hh' | |
| theorem l2_restriction_summable (Ο : StrongDual β (lp E 2)) : | |
| Summable (fun i => βl2Restriction E Ο iβ^2) := by | |
| have hc : β i, β u : E i, βuβ β€ 1 β§ βl2Restriction E Ο iβ/2 β€ βl2Restriction E Ο i uβ := by | |
| intro i | |
| by_cases hz : βl2Restriction E Ο iβ = 0 | |
| Β· exact β¨0,by simp,by simp [hz]β© | |
| Β· have hp : 0 < βl2Restriction E Ο iβ := lt_of_le_of_ne (norm_nonneg _) (Ne.symm hz) | |
| obtain β¨u,hu,hΟβ© := (l2Restriction E Ο i).exists_lt_apply_of_lt_opNorm (half_lt_self hp) | |
| exact β¨u,hu.le,hΟ.leβ© | |
| choose u hu hΟ using hc | |
| have hb := dual_vectors_squares_le (fun i => lp.single 2 i (u i)) (l2_norm_sum_unit_le E u hu) Ο | |
| apply summable_of_sum_le (fun _ => sq_nonneg _) (c := 4*βΟβ^2) | |
| intro S | |
| calc | |
| (β i β S, βl2Restriction E Ο iβ^2) β€ β i β S, 4*(Ο (lp.single 2 i (u i)))^2 := by | |
| apply Finset.sum_le_sum | |
| intro i hi | |
| have hh := hΟ i | |
| change βl2Restriction E Ο iβ/2 β€ |Ο (lp.single 2 i (u i))| at hh | |
| have h0 := norm_nonneg (l2Restriction E Ο i) | |
| have h1 := abs_nonneg (Ο (lp.single 2 i (u i))) | |
| nlinarith [sq_abs (Ο (lp.single 2 i (u i)))] | |
| _ = 4*β i β S, (Ο (lp.single 2 i (u i)))^2 := by rw [Finset.mul_sum] | |
| _ β€ 4*βΟβ^2 := mul_le_mul_of_nonneg_left (hb S) (by norm_num) | |
| theorem l2DualMap_surjective : Function.Surjective (l2DualMap E) := by | |
| intro Ο | |
| let a : lp (fun i => StrongDual β (E i)) 2 := β¨l2Restriction E Ο, memβp_gen (by | |
| simpa only [ENNReal.toReal_ofNat,Real.rpow_two] using l2_restriction_summable E Ο)β© | |
| refine β¨a,?_β© | |
| apply lp.ext_continuousLinearMap (by norm_num) | |
| intro i | |
| ext x | |
| exact l2DualMap_single_right E a i x | |
| theorem reflexive_l2 (hE : β i, Reflexive (E i)) : Reflexive (lp E 2) := by | |
| intro Ξ¦ | |
| obtain β¨g,hgβ© := l2DualMap_surjective (fun i => StrongDual β (E i)) (Ξ¦.comp (l2DualMap E)) | |
| choose u hu using (fun i => hE i (g i)) | |
| have hn : β i, βu iβ = βg iβ := by | |
| intro i | |
| rw [β hu i] | |
| exact (NormedSpace.inclusionInDoubleDualLi β).norm_map (u i) |>.symm | |
| let x : lp E 2 := β¨u,memβp_gen (by | |
| simpa only [hn] using (memβp_gen_iff (p := 2) (by norm_num)).mp (lp.memβp g))β© | |
| refine β¨x,?_β© | |
| ext Ο | |
| obtain β¨a,rflβ© := l2DualMap_surjective E Ο | |
| have hh := congrArg (fun z : StrongDual β (lp (fun i => StrongDual β (E i)) 2) => z a) hg | |
| simp only [ContinuousLinearMap.comp_apply,l2DualMap_apply] at hh β’ | |
| rw [β hh] | |
| apply tsum_congr | |
| intro i | |
| rw [β hu i] | |
| rfl | |
| end L2Dual | |
| end Reflexivity | |
| section CompletionIsomorphism | |
| variable {E F : Type} [NormedAddCommGroup E] [NormedSpace β E] | |
| [NormedAddCommGroup F] [NormedSpace β F] [CompleteSpace F] | |
| theorem completion_equiv_of_bounds (f : E βL[β] F) (K : NNReal) | |
| (hK : β x, βxβ β€ K*βf xβ) (hd : DenseRange f) : | |
| Nonempty (UniformSpace.Completion E βL[β] F) := by | |
| let L : UniformSpace.Completion E βL[β] F := f.extend UniformSpace.Completion.toComplL | |
| have he : β x : E, L (x : UniformSpace.Completion E) = f x := by | |
| intro x | |
| exact f.extend_eq UniformSpace.Completion.denseRange_coe | |
| (UniformSpace.Completion.isUniformInducing_coe E) x | |
| have hL : β x, βxβ β€ K*βL xβ := by | |
| intro x | |
| refine UniformSpace.Completion.induction_on x | |
| (isClosed_le continuous_norm (continuous_const.mul L.continuous.norm)) ?_ | |
| intro x | |
| simpa only [he,UniformSpace.Completion.norm_coe] using hK x | |
| have ha := L.antilipschitz_of_bound hL | |
| have hs : Function.Surjective L := by | |
| intro y | |
| apply closure_minimal (t := Set.range L) ?_ (ha.isClosed_range L.uniformContinuous) (hd y) | |
| rintro _ β¨x,rflβ© | |
| exact β¨(x : UniformSpace.Completion E),he xβ© | |
| exact β¨ContinuousLinearEquiv.ofBijective L (LinearMap.ker_eq_bot.mpr ha.injective) | |
| (LinearMap.range_eq_top.mpr hs)β© | |
| theorem denseRange_lp_of_singles {I : Type} (G : I β Type) | |
| [β i, NormedAddCommGroup (G i)] [β i, NormedSpace β (G i)] | |
| (f : E ββ[β] lp G 2) | |
| (hs : β i (x : G i), lp.single 2 i x β f.range.topologicalClosure) : DenseRange f := by | |
| intro x | |
| have hh : x β f.range.topologicalClosure := by | |
| apply (Submodule.isClosed_topologicalClosure f.range).mem_of_tendsto | |
| (lp.hasSum_single (by norm_num : (2 : ENNReal) β β€) x) | |
| exact Filter.Eventually.of_forall (fun S => Submodule.sum_mem _ (fun i hi => hs i (x i))) | |
| exact hh | |
| end CompletionIsomorphism | |
| section ComponentHilbert | |
| variable {V : Type} [PartialOrder V] | |
| noncomputable def rawL2Linear : TestVector V ββ[β] lp (fun _ : V => β) 2 where | |
| toFun u := β¨(fun v => u v),memβp_gen (by | |
| apply summable_of_ne_finset_zero (s := u.toFinsupp.support) | |
| intro v hv | |
| have hz : u v = 0 := Finsupp.notMem_support_iff.mp hv | |
| simp [hz])β© | |
| map_add' u v := by ext w; rfl | |
| map_smul' a u := by ext w; rfl | |
| omit [PartialOrder V] in | |
| @[simp] theorem rawL2Linear_apply [PartialOrder V] (u : TestVector V) (v : V) : rawL2Linear u v = u v := rfl | |
| omit [PartialOrder V] in | |
| theorem rawL2_norm_sq [PartialOrder V] (u : TestVector V) : | |
| βrawL2Linear uβ^2 = β v β u.toFinsupp.support, u v^2 := by | |
| have he := lp.norm_rpow_eq_tsum (p := 2) (by norm_num) (rawL2Linear u) | |
| simp only [ENNReal.toReal_ofNat,Real.rpow_two,rawL2Linear_apply,Real.norm_eq_abs,sq_abs] at he | |
| rw [he] | |
| apply tsum_eq_sum | |
| intro v hv | |
| have hz : u v = 0 := Finsupp.notMem_support_iff.mp hv | |
| simp [hz] | |
| theorem rawL2_norm_le (u : TestVector V) : βrawL2Linear uβ β€ βuβ := by | |
| apply (sq_le_sqβ (norm_nonneg _) (norm_nonneg _)).mp | |
| rw [rawL2_norm_sq] | |
| exact coordinate_squares_le _ u | |
| noncomputable def rawL2 : TestVector V βL[β] lp (fun _ : V => β) 2 := | |
| rawL2Linear.mkContinuous 1 (by intro u; simpa only [one_mul] using rawL2_norm_le u) | |
| @[simp] theorem rawL2_apply (u : TestVector V) : rawL2 u = rawL2Linear u := rfl | |
| omit [PartialOrder V] in | |
| theorem sum_sq_le_support [PartialOrder V] (u : TestVector V) (S : Finset V) : | |
| β v β S, u v^2 β€ β v β u.toFinsupp.support, u v^2 := by | |
| have he : (β v β S βͺ u.toFinsupp.support, u v^2) = β v β u.toFinsupp.support, u v^2 := by | |
| symm | |
| apply Finset.sum_subset Finset.subset_union_right | |
| intro v hv hn | |
| have hz : u v = 0 := Finsupp.notMem_support_iff.mp hn | |
| simp [hz] | |
| rw [β he] | |
| exact Finset.sum_le_sum_of_subset_of_nonneg Finset.subset_union_left (fun _ _ _ => sq_nonneg _) | |
| theorem rho_le_card_bound (C : β) (hC : β S : Finset V, IsSegment S β S.card β€ C) | |
| (u : TestVector V) : βuβ β€ Real.sqrt C * βrawL2 uβ := by | |
| apply (TestVector.norm_le_iff_testBound u (mul_nonneg (Real.sqrt_nonneg _) (norm_nonneg _))).mpr | |
| intro I inst S hS hd | |
| have hloc : β i, (segSum u (S i))^2 β€ C * β v β S i, u v^2 := by | |
| intro i | |
| have hh := Finset.sum_mul_sq_le_sq_mul_sq (S i) (fun _ => (1:β)) (fun v => u v) | |
| simp only [one_mul,one_pow,Finset.sum_const,nsmul_eq_mul,mul_one] at hh | |
| apply hh.trans | |
| change (S i).card * (β v β S i, u v^2) β€ (C : β) * _ | |
| exact mul_le_mul_of_nonneg_right (by exact_mod_cast hC (S i) (hS i)) | |
| (Finset.sum_nonneg (fun _ _ => sq_nonneg _)) | |
| have hsum : (β i, β v β S i, u v^2) β€ β v β u.toFinsupp.support, u v^2 := by | |
| rw [β Finset.sum_biUnion (s := Finset.univ) (t := S) (by | |
| intro i hi j hj hij | |
| exact hd hij)] | |
| exact sum_sq_le_support u _ | |
| have hm : (β i, (C : β) * β v β S i, u v^2) β€ (C : β) * β v β u.toFinsupp.support, u v^2 := by | |
| rw [β Finset.mul_sum] | |
| exact mul_le_mul_of_nonneg_left hsum (Nat.cast_nonneg C) | |
| have hh := (Finset.sum_le_sum (s := Finset.univ) (fun i hi => hloc i)).trans hm | |
| simpa only [mul_pow,Real.sq_sqrt (Nat.cast_nonneg C),rawL2_apply,rawL2_norm_sq] using hh | |
| theorem rawL2_dense : DenseRange (rawL2 (V := V)) := by | |
| apply denseRange_lp_of_singles (fun _ : V => β) rawL2Linear | |
| intro v a | |
| apply Submodule.le_topologicalClosure | |
| refine β¨TestVector.single v a,?_β© | |
| ext w | |
| simp [TestVector.single_apply,lp.single_apply,Pi.single_apply,eq_comm] | |
| theorem reflexive_J_of_segment_card_bound (C : β) | |
| (hC : β S : Finset V, IsSegment S β S.card β€ C) : Reflexive (J V) := by | |
| obtain β¨eβ© := completion_equiv_of_bounds (rawL2 (V := V)) β¨Real.sqrt C,Real.sqrt_nonneg _β© | |
| (rho_le_card_bound C hC) rawL2_dense | |
| exact reflexive_of_equiv e (reflexive_hilbert _) | |
| abbrev Component (h : β) := {v : Vertex // v.height = h} | |
| theorem component_segment_card (h : β) (S : Finset (Component h)) (hS : IsSegment S) : | |
| S.card β€ h+1 := by | |
| let f : S β Fin (h+1) := fun v => β¨v.val.val.word.letters.length, by | |
| have hh := v.val.val.bounded | |
| rw [v.val.property] at hh | |
| omegaβ© | |
| have hf : Function.Injective f := by | |
| intro a b hab | |
| have hl : a.val.val.word.letters.length = b.val.val.word.letters.length := congrArg Fin.val hab | |
| apply Subtype.ext | |
| apply Subtype.ext | |
| apply Vertex.ext (a.val.property.trans b.val.property.symm) | |
| apply Word.ext | |
| rcases hS.1 a a.property b b.property with h | h | |
| Β· exact h.2.eq_of_length hl | |
| Β· exact (h.2.eq_of_length hl.symm).symm | |
| have hh := Fintype.card_le_of_injective f hf | |
| simpa only [Fintype.card_coe, Fintype.card_fin] using hh | |
| theorem reflexive_component (h : β) : Reflexive (J (Component h)) := | |
| reflexive_J_of_segment_card_bound (h+1) (component_segment_card h) | |
| end ComponentHilbert | |
| end | |
| end ForestSpace | |
| end OAI | |