Download data/lean/OAI/Analysis/DiamondDistortion/UpperFunction.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 9.18 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Analysis/DiamondDistortion/UpperFunction.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Analysis/DiamondDistortion/UpperFunction.lean
-
curl -L -o UpperFunction.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Analysis/DiamondDistortion/UpperFunction.lean
9.18 kB
| import OAI.Analysis.DiamondDistortion.EquivalentNorm | |
| namespace OAI | |
| universe u v | |
| noncomputable section | |
| open scoped BigOperators Classical Topology | |
| open Set | |
| namespace DiamondDistortion | |
| open scoped ENNReal | |
| namespace RecursiveModel | |
| variable (p : ββ₯0β) [Fact (1 β€ p)] | |
| abbrev Full (h : β) := lp (fun _ : Coord h => β) p | |
| lemma p_ne_zero : p β 0 := ne_of_gt (lt_of_lt_of_le (by norm_num : (0:ββ₯0β)<1) (Fact.out : 1 β€ p)) | |
| variable (hp : 0 < p.toReal) | |
| def child (h : β) (v : Full p (h+1)) (i : β) : Full p h := | |
| β¨fun s => v (.inr (i,s)),(memβp_gen_iff hp).mpr ((v.property.summable hp).comp_injective (by | |
| intro a b hh | |
| exact (Prod.mk.inj (Sum.inr.inj hh)).2))β© | |
| lemma child_apply (p : ββ₯0β) [Fact (1 β€ p)] (hp : 0 < p.toReal) (h : β) (v : Full p (h+1)) (i : β) (s : Coord h) : | |
| child p hp h v i s=v (.inr (i,s)) := rfl | |
| lemma child_sum (p : ββ₯0β) [Fact (1 β€ p)] (hp : 0 < p.toReal) (h : β) (v : Full p (h+1)) (i : β) : | |
| βchild p hp h v iβ^p.toReal=β' s : Coord h,βv (.inr (i,s))β^p.toReal := | |
| lp.norm_rpow_eq_tsum hp _ | |
| lemma child_summable (p : ββ₯0β) [Fact (1 β€ p)] (hp : 0 < p.toReal) (h : β) (v : Full p (h+1)) : | |
| Summable (fun q : β Γ Coord h => βv (.inr q)β^p.toReal) := | |
| (v.property.summable hp).comp_injective Sum.inr_injective | |
| def children (h : β) (v : Full p (h+1)) : lp (fun _ : β => Full p h) p := | |
| β¨fun i => child p hp h v i,(memβp_gen_iff hp).mpr (by | |
| have hh := (child_summable p hp h v).prod | |
| simpa only [β child_sum p hp h v] using hh)β© | |
| lemma children_apply (h : β) (v : Full p (h+1)) (i : β) : children p hp h v i=child p hp h v i := rfl | |
| lemma children_norm (h : β) (v : Full p (h+1)) : βchildren p hp h vβ β€ βvβ := by | |
| apply (Real.rpow_le_rpow_iff (norm_nonneg _) (norm_nonneg _) hp).mp | |
| rw [lp.norm_rpow_eq_tsum hp,lp.norm_rpow_eq_tsum hp] | |
| simp_rw [children_apply,child_sum] | |
| rw [β (child_summable p hp h v).tsum_prod] | |
| exact Summable.tsum_le_tsum_of_inj (fun q : β Γ Coord h => (Sum.inr q : Coord (h+1))) | |
| Sum.inr_injective (fun _ _ => by positivity) (fun _ => le_rfl) | |
| (child_summable p hp h v) (v.property.summable hp) | |
| @[simp] lemma child_add (p : ββ₯0β) [Fact (1 β€ p)] (hp : 0 < p.toReal) (h : β) (u v : Full p (h+1)) (i : β) : | |
| child p hp h (u+v) i=child p hp h u i+child p hp h v i := by ext s; rfl | |
| @[simp] lemma child_neg (p : ββ₯0β) [Fact (1 β€ p)] (hp : 0 < p.toReal) (h : β) (v : Full p (h+1)) (i : β) : | |
| child p hp h (-v) i=-child p hp h v i := by ext s; rfl | |
| @[simp] lemma child_smul (p : ββ₯0β) [Fact (1 β€ p)] (hp : 0 < p.toReal) (h : β) (a : β) (v : Full p (h+1)) (i : β) : | |
| child p hp h (a β’ v) i=a β’ child p hp h v i := by ext s; rfl | |
| @[simp] lemma child_zero (p : ββ₯0β) [Fact (1 β€ p)] (hp : 0 < p.toReal) (h : β) (i : β) : child p hp h 0 i=0 := by ext s; rfl | |
| end RecursiveModel | |
| namespace UpperFunction | |
| variable {E : Type*} [NormedAddCommGroup E] [NormedSpace β E] | |
| structure Data (E : Type*) [NormedAddCommGroup E] (C : β) where | |
| value : E β β Γ β | |
| nonneg : β v,0 β€ (value v).1 β§ 0 β€ (value v).2 | |
| bound : β v,(value v).1 β€ C*βvβ β§ (value v).2 β€ C*βvβ | |
| namespace Data | |
| variable {C : β} (U : Data E C) (hC : 0 β€ C) {p : ββ₯0β} [Fact (1 β€ p)] | |
| def positiveArray (v : lp (fun _ : β => E) p) : lp (fun _ : β => β) p := | |
| LpBoundedMap.map (fun x => (U.value x).1) C hC (fun x => by | |
| simpa only [Real.norm_eq_abs,abs_of_nonneg (U.nonneg x).1] using (U.bound x).1) v | |
| def negativeArray (v : lp (fun _ : β => E) p) : lp (fun _ : β => β) p := | |
| LpBoundedMap.map (fun x => (U.value x).2) C hC (fun x => by | |
| simpa only [Real.norm_eq_abs,abs_of_nonneg (U.nonneg x).2] using (U.bound x).2) v | |
| lemma positiveArray_apply {E : Type*} [NormedAddCommGroup E] [NormedSpace β E] {C : β} (U : Data E C) (hC : 0 β€ C) {p : ββ₯0β} [Fact (1 β€ p)] (v : lp (fun _ : β => E) p) (i : β) : | |
| positiveArray U hC v i=(U.value (v i)).1 := rfl | |
| lemma negativeArray_apply {E : Type*} [NormedAddCommGroup E] [NormedSpace β E] {C : β} (U : Data E C) (hC : 0 β€ C) {p : ββ₯0β} [Fact (1 β€ p)] (v : lp (fun _ : β => E) p) (i : β) : | |
| negativeArray U hC v i=(U.value (v i)).2 := rfl | |
| lemma positiveArray_norm (hp : p β 0) (v : lp (fun _ : β => E) p) : | |
| βpositiveArray U hC vβ β€ C*βvβ := LpBoundedMap.map_norm hp _ _ _ _ v | |
| lemma negativeArray_norm (hp : p β 0) (v : lp (fun _ : β => E) p) : | |
| βnegativeArray U hC vβ β€ C*βvβ := LpBoundedMap.map_norm hp _ _ _ _ v | |
| end Data | |
| end UpperFunction | |
| namespace RecursiveModel | |
| lemma join_upper_bound {r a b C M : β} (hC : 1 β€ C) (hM : 0 β€ M) | |
| (hr : |r| β€ M) (ha : a β€ C*M) (hb : b β€ C*M) : | |
| (join r a b).1 β€ (3*C)*M β§ (join r a b).2 β€ (3*C)*M := by | |
| have hCM : M β€ C*M := by nlinarith | |
| have hrp := (abs_le.mp hr).2 | |
| have hrn := (abs_le.mp hr).1 | |
| constructor <;> apply max_le <;> nlinarith | |
| variable (p : ββ₯0β) [Fact (1 β€ p)] (hp : 0 < p.toReal) | |
| /-- Least upper values on the original full βp component, not on a finite-support | |
| substitute. All child sequences are genuine countable βp vectors. -/ | |
| def fullUpperData : (h : β) β UpperFunction.Data (Full p h) (3^h) | |
| | 0 => { | |
| value v := (max (v ()) 0,max (-v ()) 0) | |
| nonneg v := β¨le_max_right _ _,le_max_right _ _β© | |
| bound v := by | |
| simp only [pow_zero,one_mul] | |
| have hb := lp.norm_apply_le_norm (p_ne_zero p) v () | |
| rw [Real.norm_eq_abs] at hb | |
| exact β¨max_le ((le_abs_self _).trans hb) (norm_nonneg _), | |
| max_le ((neg_le_abs _).trans hb) (norm_nonneg _)β© } | |
| | h+1 => | |
| let U := fullUpperData h | |
| let a (v : Full p (h+1)) := βU.positiveArray (by positivity) (children p hp h v)β | |
| let b (v : Full p (h+1)) := βU.negativeArray (by positivity) (children p hp h v)β | |
| { value v := join (v (.inl ())) (a v) (b v) | |
| nonneg v := β¨(norm_nonneg _).trans (le_max_left _ _),(norm_nonneg _).trans (le_max_right _ _)β© | |
| bound v := by | |
| have ha := (U.positiveArray_norm (by positivity) (p_ne_zero p) (children p hp h v)).trans | |
| (mul_le_mul_of_nonneg_left (children_norm p hp h v) (by positivity : (0:β) β€ 3^h)) | |
| have hb := (U.negativeArray_norm (by positivity) (p_ne_zero p) (children p hp h v)).trans | |
| (mul_le_mul_of_nonneg_left (children_norm p hp h v) (by positivity : (0:β) β€ 3^h)) | |
| have hr : |v (.inl ())| β€ βvβ := by | |
| simpa only [Real.norm_eq_abs] using lp.norm_apply_le_norm (p_ne_zero p) v (.inl ()) | |
| have hh := join_upper_bound (one_le_powβ (by norm_num : (1:β) β€ 3)) (norm_nonneg v) hr ha hb | |
| simpa only [pow_succ,show (3:β)*3^h=3^h*3 by ring] using hh } | |
| def fullUpper (h : β) (v : Full p h) : β Γ β := (fullUpperData p hp h).value v | |
| def fullPChildren (h : β) (v : Full p (h+1)) : lp (fun _ : β => β) p := | |
| (fullUpperData p hp h).positiveArray (by positivity) (children p hp h v) | |
| def fullQChildren (h : β) (v : Full p (h+1)) : lp (fun _ : β => β) p := | |
| (fullUpperData p hp h).negativeArray (by positivity) (children p hp h v) | |
| lemma fullUpper_zero_height (v : Full p 0) : fullUpper p hp 0 v=(max (v ()) 0,max (-v ()) 0) := rfl | |
| lemma fullUpper_succ (h : β) (v : Full p (h+1)) : | |
| fullUpper p hp (h+1) v=join (v (.inl ())) βfullPChildren p hp h vβ βfullQChildren p hp h vβ := rfl | |
| lemma fullPChildren_apply (h : β) (v : Full p (h+1)) (i : β) : | |
| fullPChildren p hp h v i=(fullUpper p hp h (child p hp h v i)).1 := rfl | |
| lemma fullQChildren_apply (h : β) (v : Full p (h+1)) (i : β) : | |
| fullQChildren p hp h v i=(fullUpper p hp h (child p hp h v i)).2 := rfl | |
| lemma fullUpper_nonneg (h : β) (v : Full p h) : | |
| 0 β€ (fullUpper p hp h v).1 β§ 0 β€ (fullUpper p hp h v).2 := (fullUpperData p hp h).nonneg v | |
| lemma fullUpper_bound (h : β) (v : Full p h) : | |
| (fullUpper p hp h v).1 β€ 3^h*βvβ β§ (fullUpper p hp h v).2 β€ 3^h*βvβ := | |
| (fullUpperData p hp h).bound v | |
| @[simp] lemma fullUpper_zero (h : β) : fullUpper p hp h 0=0 := by | |
| have hn := fullUpper_nonneg p hp h 0 | |
| have hb := fullUpper_bound p hp h 0 | |
| simp only [norm_zero,mul_zero] at hb | |
| exact Prod.ext (le_antisymm hb.1 hn.1) (le_antisymm hb.2 hn.2) | |
| lemma child_finiteLp (p : ββ₯0β) [Fact (1 β€ p)] (hp : 0 < p.toReal) (h : β) (v : Vec (h+1)) (i : β) : | |
| child p hp h (finiteLp p v) i=finiteLp p ((rootChildren h v).2 i) := by ext s; rfl | |
| lemma fullUpper_finiteLp (h : β) (v : Vec h) : fullUpper p hp h (finiteLp p v)=upper p h v := by | |
| induction h with | |
| | zero => rfl | |
| | succ h ih => | |
| let w := rootChildren h v | |
| let P := w.2.mapRange (fun z => (upper p h z).1) (by simp) | |
| let Q := w.2.mapRange (fun z => (upper p h z).2) (by simp) | |
| have hP : fullPChildren p hp h (finiteLp p v)=finiteLp p P := by | |
| ext i | |
| rw [fullPChildren_apply,child_finiteLp,ih] | |
| rfl | |
| have hQ : fullQChildren p hp h (finiteLp p v)=finiteLp p Q := by | |
| ext i | |
| rw [fullQChildren_apply,child_finiteLp,ih] | |
| rfl | |
| rw [fullUpper_succ,hP,hQ] | |
| rfl | |
| end RecursiveModel | |
| end DiamondDistortion | |
| end | |
| end OAI | |