math / data /lean /OAI /Analysis /ForestSpace /Reflexivity.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
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 @inner ℝ 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