Download data/lean/OAI/Analysis/C0Absorption/Molecules.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 11.1 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Analysis/C0Absorption/Molecules.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Analysis/C0Absorption/Molecules.lean
-
curl -L -o Molecules.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Analysis/C0Absorption/Molecules.lean
11.1 kB
| import OAI.Analysis.C0Absorption.Core | |
| import Mathlib | |
| namespace OAI | |
| namespace C0Absorption | |
| open scoped BigOperators NNReal ENNReal | |
| noncomputable section | |
| open Finset | |
| section Molecules | |
| variable (S : Type*) | |
| def MoleculeSpace : Submodule β (S ββ β) := | |
| (Finsupp.linearCombination β (fun _ : S => (1 : β))).ker | |
| abbrev Molecule := MoleculeSpace S | |
| noncomputable def pairing (f : S β β) : Molecule S ββ[β] β := | |
| (Finsupp.linearCombination β f).comp (MoleculeSpace S).subtype | |
| variable {S} | |
| noncomputable def molecule (s t : S) : Molecule S := | |
| β¨Finsupp.single s 1 - Finsupp.single t 1, by | |
| simp [MoleculeSpace, LinearMap.mem_ker]β© | |
| @[simp] theorem pairing_molecule (f : S β β) (s t : S) : | |
| pairing S f (molecule s t) = f s - f t := by | |
| simp [pairing, molecule] | |
| @[simp] theorem pairing_const (c : β) (m : Molecule S) : | |
| pairing S (fun _ => c) m = 0 := by | |
| have hm := m.property | |
| change (Finsupp.linearCombination β (fun _ : S => (1 : β))) m.val = 0 at hm | |
| simp only [Finsupp.linearCombination_apply, smul_eq_mul, mul_one] at hm | |
| simp only [pairing, LinearMap.comp_apply, Submodule.subtype_apply, | |
| Finsupp.linearCombination_apply, smul_eq_mul] | |
| rw [β Finsupp.sum_mul, hm, zero_mul] | |
| theorem molecule_decomposition (m : Molecule S) (o : S) : | |
| m = β s β m.val.support, m.val s β’ molecule s o := by | |
| classical | |
| have hm := m.property | |
| change (Finsupp.linearCombination β (fun _ : S => (1 : β))) m.val = 0 at hm | |
| simp only [Finsupp.linearCombination_apply, smul_eq_mul, mul_one, | |
| Finsupp.sum] at hm | |
| apply Subtype.ext | |
| simp only [Submodule.coe_sum, Submodule.coe_smul, molecule, smul_sub] | |
| rw [Finset.sum_sub_distrib, β Finset.sum_smul, hm, zero_smul, sub_zero] | |
| simpa only [Finsupp.smul_single, smul_eq_mul, mul_one, Finsupp.sum] using (Finsupp.sum_single m.val).symm | |
| @[simp] theorem molecule_self (s : S) : molecule s s = 0 := by | |
| apply Subtype.ext | |
| simp [molecule] | |
| theorem molecule_sub_molecule (s t o : S) : molecule s o - molecule t o = molecule s t := by | |
| apply Subtype.ext | |
| change (Finsupp.single s 1 - Finsupp.single o 1) - | |
| (Finsupp.single t 1 - Finsupp.single o 1) = Finsupp.single s 1 - Finsupp.single t 1 | |
| abel | |
| end Molecules | |
| section TestLists | |
| variable {S : Type*} [MetricSpace S] | |
| structure AdmissibleList (L : Set (S β β)) (C : ββ₯0) where | |
| length : β | |
| test : Fin length β S β β | |
| mem : β i, test i β L | |
| signed_lipschitz : β Ξ΅ : Fin length β β, (β i, |Ξ΅ i| = 1) β | |
| LipschitzWith C (fun s => β i, Ξ΅ i * test i s) | |
| def AdmissibleList.empty (L : Set (S β β)) (C : ββ₯0) : AdmissibleList L C where | |
| length := 0 | |
| test := Fin.elim0 | |
| mem i := Fin.elim0 i | |
| signed_lipschitz Ξ΅ hΞ΅ := by | |
| apply LipschitzWith.of_dist_le_mul | |
| intro s t | |
| simp only [Fin.sum_univ_zero, dist_self] | |
| positivity | |
| instance (L : Set (S β β)) (C : ββ₯0) : Nonempty (AdmissibleList L C) := | |
| β¨AdmissibleList.empty L Cβ© | |
| theorem AdmissibleList.sum_abs_sub_le {L : Set (S β β)} {C : ββ₯0} | |
| (l : AdmissibleList L C) (s t : S) : | |
| β i, |l.test i s - l.test i t| β€ C * dist s t := by | |
| classical | |
| let Ξ΅ : Fin l.length β β := fun i => if 0 β€ l.test i s - l.test i t then 1 else -1 | |
| have hΞ΅ : β i, |Ξ΅ i| = 1 := by | |
| intro i | |
| dsimp [Ξ΅] | |
| split <;> norm_num | |
| have heq : β i, Ξ΅ i * (l.test i s - l.test i t) = | |
| |l.test i s - l.test i t| := by | |
| intro i | |
| dsimp [Ξ΅] | |
| split | |
| Β· simp [abs_of_nonneg, *] | |
| Β· simp [abs_of_neg (lt_of_not_ge βΉΒ¬ 0 β€ l.test i s - l.test i tβΊ)] | |
| have h := (l.signed_lipschitz Ξ΅ hΞ΅).dist_le_mul s t | |
| rw [Real.dist_eq, β Finset.sum_sub_distrib] at h | |
| simp_rw [β mul_sub, heq] at h | |
| rwa [abs_of_nonneg (Finset.sum_nonneg fun _ _ => abs_nonneg _)] at h | |
| theorem finite_lp_norm_le_sum {ΞΉ : Type*} [Fintype ΞΉ] (p : ββ₯0β) [Fact (1 β€ p)] | |
| (f : PiLp p (fun _ : ΞΉ => β)) : βfβ β€ β i, |f i| := by | |
| classical | |
| have heq : f = β i, PiLp.single p (Ξ² := fun _ : ΞΉ => β) i (f i) := by | |
| apply PiLp.ext | |
| intro j | |
| simp [β WithLp.toLp_sum, PiLp.single, Function.update, Pi.single] | |
| calc | |
| βfβ = ββ i, PiLp.single p (Ξ² := fun _ : ΞΉ => β) i (f i)β := congrArg norm heq | |
| _ β€ β i, βPiLp.single p (Ξ² := fun _ : ΞΉ => β) i (f i)β := norm_sum_le _ _ | |
| _ = β i, |f i| := by simp [PiLp.norm_single, Real.norm_eq_abs] | |
| def AdmissibleList.eval {L : Set (S β β)} {C : ββ₯0} | |
| (l : AdmissibleList L C) (p : ββ₯0β) : | |
| Molecule S ββ[β] PiLp p (fun _ : Fin l.length => β) := | |
| (WithLp.linearEquiv p β _).symm.toLinearMap.comp | |
| (LinearMap.pi fun i => pairing S (l.test i)) | |
| @[simp] theorem AdmissibleList.eval_apply {L : Set (S β β)} {C : ββ₯0} | |
| (l : AdmissibleList L C) (p : ββ₯0β) (m : Molecule S) (i : Fin l.length) : | |
| (l.eval p m) i = pairing S (l.test i) m := rfl | |
| def AdmissibleList.seminorm {L : Set (S β β)} {C : ββ₯0} | |
| (l : AdmissibleList L C) (p : ββ₯0β) [Fact (1 β€ p)] : Seminorm β (Molecule S) := | |
| (normSeminorm β (PiLp p (fun _ : Fin l.length => β))).comp (l.eval p) | |
| @[simp] theorem AdmissibleList.seminorm_apply {L : Set (S β β)} {C : ββ₯0} | |
| (l : AdmissibleList L C) (p : ββ₯0β) [Fact (1 β€ p)] (m : Molecule S) : | |
| l.seminorm p m = βl.eval p mβ := rfl | |
| theorem AdmissibleList.seminorm_molecule_le {L : Set (S β β)} {C : ββ₯0} | |
| (l : AdmissibleList L C) (p : ββ₯0β) [Fact (1 β€ p)] (s t : S) : | |
| l.seminorm p (molecule s t) β€ C * dist s t := by | |
| calc | |
| l.seminorm p (molecule s t) β€ β i, |(l.eval p (molecule s t)) i| := | |
| finite_lp_norm_le_sum p _ | |
| _ = β i, |l.test i s - l.test i t| := by simp | |
| _ β€ C * dist s t := l.sum_abs_sub_le s t | |
| theorem AdmissibleList.seminorm_le {L : Set (S β β)} {C : ββ₯0} | |
| (l : AdmissibleList L C) (p : ββ₯0β) [Fact (1 β€ p)] (o : S) (m : Molecule S) : | |
| l.seminorm p m β€ C * β s β m.val.support, |m.val s| * dist s o := by | |
| classical | |
| conv_lhs => rw [molecule_decomposition m o] | |
| simp only [AdmissibleList.seminorm_apply, map_sum, map_smul] | |
| calc | |
| ββ s β m.val.support, m.val s β’ l.eval p (molecule s o)β | |
| β€ β s β m.val.support, |m.val s| * βl.eval p (molecule s o)β := by | |
| simpa only [norm_smul, Real.norm_eq_abs] using | |
| norm_sum_le m.val.support (fun s => m.val s β’ l.eval p (molecule s o)) | |
| _ β€ β s β m.val.support, |m.val s| * (C * dist s o) := by | |
| apply Finset.sum_le_sum | |
| intro s hs | |
| exact mul_le_mul_of_nonneg_left (l.seminorm_molecule_le p s o) (abs_nonneg _) | |
| _ = C * β s β m.val.support, |m.val s| * dist s o := by | |
| rw [Finset.mul_sum] | |
| apply Finset.sum_congr rfl | |
| intro s hs | |
| ring | |
| def sigma (L : Set (S β β)) (C : ββ₯0) (p : ββ₯0β) [Fact (1 β€ p)] : | |
| Seminorm β (Molecule S) := | |
| β¨ l : AdmissibleList L C, l.seminorm p | |
| theorem list_seminorms_bddAbove (L : Set (S β β)) (C : ββ₯0) | |
| (p : ββ₯0β) [Fact (1 β€ p)] (o : S) : | |
| BddAbove (Set.range fun l : AdmissibleList L C => l.seminorm p) := by | |
| rw [Seminorm.bddAbove_range_iff] | |
| intro m | |
| refine β¨C * β s β m.val.support, |m.val s| * dist s o, ?_β© | |
| rintro _ β¨l, rflβ© | |
| exact l.seminorm_le p o m | |
| theorem sigma_apply (L : Set (S β β)) (C : ββ₯0) | |
| (p : ββ₯0β) [Fact (1 β€ p)] (o : S) (m : Molecule S) : | |
| sigma L C p m = β¨ l : AdmissibleList L C, βl.eval p mβ := by | |
| exact Seminorm.iSup_apply (list_seminorms_bddAbove L C p o) | |
| theorem sigma_molecule_le (L : Set (S β β)) (C : ββ₯0) | |
| (p : ββ₯0β) [Fact (1 β€ p)] (s t : S) : | |
| sigma L C p (molecule s t) β€ C * dist s t := by | |
| rw [sigma_apply L C p s] | |
| exact ciSup_le fun l => l.seminorm_molecule_le p s t | |
| theorem list_le_sigma (L : Set (S β β)) (C : ββ₯0) | |
| (p : ββ₯0β) [Fact (1 β€ p)] (o : S) (l : AdmissibleList L C) : | |
| l.seminorm p β€ sigma L C p := | |
| le_ciSup (list_seminorms_bddAbove L C p o) l | |
| theorem sigma_le (L : Set (S β β)) (C : ββ₯0) | |
| (p : ββ₯0β) [Fact (1 β€ p)] (o : S) (m : Molecule S) : | |
| sigma L C p m β€ C * β s β m.val.support, |m.val s| * dist s o := by | |
| rw [sigma_apply L C p o] | |
| exact ciSup_le fun l => l.seminorm_le p o m | |
| end TestLists | |
| section SquareSum | |
| variable {M : Type*} [AddCommGroup M] [Module β M] | |
| variable (q : β β Seminorm β M) | |
| variable (hq : β x, Summable (fun n => (q n x) ^ 2)) | |
| def squareVector (x : M) : lp (fun _ : β => β) 2 := | |
| β¨fun n => q n x, memβp_gen (by | |
| simpa only [ENNReal.toReal_ofNat, Real.rpow_two, Real.norm_eq_abs, sq_abs] | |
| using hq x)β© | |
| @[simp] theorem squareVector_apply (x : M) (n : β) : | |
| squareVector q hq x n = q n x := rfl | |
| def squareSeminorm : Seminorm β M := | |
| Seminorm.of (fun x => βsquareVector q hq xβ) | |
| (by | |
| intro x y | |
| calc | |
| βsquareVector q hq (x + y)β β€ βsquareVector q hq x + squareVector q hq yβ := by | |
| apply lp.norm_mono (by norm_num : (2 : ββ₯0β) β 0) | |
| intro n | |
| change βq n (x + y)β β€ βq n x + q n yβ | |
| rw [Real.norm_of_nonneg (apply_nonneg _ _), | |
| Real.norm_of_nonneg (add_nonneg (apply_nonneg _ _) (apply_nonneg _ _))] | |
| exact map_add_le_add _ _ _ | |
| _ β€ βsquareVector q hq xβ + βsquareVector q hq yβ := norm_add_le _ _) | |
| (by | |
| intro a x | |
| have h : squareVector q hq (a β’ x) = βaβ β’ squareVector q hq x := by | |
| apply lp.ext | |
| funext n | |
| change q n (a β’ x) = βaβ * q n x | |
| exact map_smul_eq_mul _ _ _ | |
| rw [h, norm_smul, norm_norm]) | |
| @[simp] theorem squareSeminorm_apply (x : M) : | |
| squareSeminorm q hq x = βsquareVector q hq xβ := rfl | |
| theorem squareSeminorm_sq (x : M) : | |
| (squareSeminorm q hq x) ^ 2 = β' n, (q n x) ^ 2 := by | |
| simpa only [squareSeminorm_apply, ENNReal.toReal_ofNat, Real.rpow_two, | |
| Real.norm_eq_abs, sq_abs, squareVector_apply] using | |
| lp.norm_rpow_eq_tsum (by norm_num : 0 < (2 : ββ₯0β).toReal) (squareVector q hq x) | |
| theorem coordinate_le_squareSeminorm (n : β) (x : M) : | |
| q n x β€ squareSeminorm q hq x := by | |
| simpa only [squareSeminorm_apply, squareVector_apply, | |
| Real.norm_of_nonneg (apply_nonneg _ _)] using | |
| lp.norm_apply_le_norm (by norm_num : (2 : ββ₯0β) β 0) (squareVector q hq x) n | |
| theorem seminorm_abs_sub_le (r : Seminorm β M) (x y : M) : | |
| |r x - r y| β€ r (x - y) := by | |
| have hxy := map_add_le_add r (x - y) y | |
| have hyx := map_add_le_add r (y - x) x | |
| rw [sub_add_cancel] at hxy hyx | |
| have hn : r (y - x) = r (x - y) := by rw [β neg_sub x y, map_neg_eq_map] | |
| rw [hn] at hyx | |
| apply abs_le.mpr | |
| constructor <;> linarith | |
| theorem squareVector_sub_norm_le (x y : M) : | |
| βsquareVector q hq x - squareVector q hq yβ β€ squareSeminorm q hq (x - y) := by | |
| apply lp.norm_mono (by norm_num : (2 : ββ₯0β) β 0) | |
| intro n | |
| change βq n x - q n yβ β€ βq n (x - y)β | |
| rw [Real.norm_eq_abs, Real.norm_of_nonneg (apply_nonneg _ _)] | |
| exact seminorm_abs_sub_le _ _ _ | |
| end SquareSum | |
| end | |
| end C0Absorption | |
| end OAI | |