Buckets:
| import OAI.Analysis.NodalLength.WitnessPacking | |
| namespace OAI | |
| noncomputable section | |
| open scoped ContDiff Bundle ENNReal | |
| open Bundle Manifold MeasureTheory | |
| open scoped ContDiff ENNReal Topology | |
| open MeasureTheory Filter Set | |
| open scoped Topology ENNReal | |
| open MeasureTheory Filter Set | |
| open scoped Topology ENNReal ContDiff | |
| open MeasureTheory Filter Set | |
| open scoped Topology ENNReal ContDiff | |
| open MeasureTheory Filter Set | |
| open scoped Topology ENNReal ContDiff | |
| open MeasureTheory Filter Set | |
| open scoped Topology ContDiff | |
| open Filter Set | |
| open scoped Topology ContDiff | |
| open Filter Set | |
| open scoped Topology ENNReal | |
| open Filter Set MeasureTheory TopologicalSpace | |
| open scoped Topology ContDiff | |
| open Filter Set | |
| open scoped Topology ENNReal | |
| open Filter Set MeasureTheory TopologicalSpace | |
| open scoped Topology ENNReal ContDiff | |
| open Filter Set MeasureTheory TopologicalSpace | |
| open scoped Topology ENNReal ContDiff | |
| open Filter Set MeasureTheory | |
| open scoped Topology ENNReal ContDiff | |
| open Filter Set MeasureTheory | |
| open scoped Topology ENNReal ContDiff | |
| open Filter Set MeasureTheory | |
| open scoped Topology ENNReal ContDiff | |
| open Filter Set MeasureTheory | |
| open scoped Topology ENNReal ContDiff | |
| open Filter Set MeasureTheory Laplacian | |
| open scoped Topology ENNReal ContDiff ComplexConjugate | |
| open Filter Set MeasureTheory Laplacian | |
| open scoped Topology ENNReal ContDiff ComplexConjugate | |
| open Filter Set MeasureTheory Laplacian | |
| open scoped Topology ENNReal NNReal | |
| open Filter Set MeasureTheory | |
| open scoped Topology ENNReal ContDiff | |
| open Filter Set MeasureTheory | |
| open scoped Topology ENNReal ContDiff | |
| open Filter Set MeasureTheory | |
| open scoped Topology ENNReal | |
| open Set MeasureTheory Filter | |
| open scoped Topology ENNReal | |
| open Filter Set MeasureTheory | |
| open scoped Topology ENNReal | |
| open Filter Set MeasureTheory | |
| open scoped Topology ENNReal | |
| open Filter Set MeasureTheory | |
| open scoped Topology ContDiff | |
| open Filter Set MeasureTheory | |
| open scoped Topology ContDiff Laplacian | |
| open Filter Set MeasureTheory InnerProductSpace | |
| open scoped Topology ContDiff | |
| open Filter Set MeasureTheory | |
| open scoped Topology ENNReal | |
| open Filter Set MeasureTheory | |
| open scoped Topology ENNReal ContDiff | |
| open Filter Set MeasureTheory | |
| open scoped Topology ENNReal ContDiff | |
| open Filter Set MeasureTheory | |
| open scoped Topology ENNReal ContDiff | |
| open Filter Set MeasureTheory | |
| open scoped Topology ENNReal ContDiff | |
| open Filter Set MeasureTheory | |
| open scoped Topology ENNReal ContDiff CompactlySupported | |
| open Set MeasureTheory | |
| open scoped Topology ENNReal ContDiff CompactlySupported | |
| open Set MeasureTheory | |
| open scoped Topology ENNReal ContDiff CompactlySupported | |
| open Set MeasureTheory | |
| open scoped Topology ContDiff | |
| open Filter Set MeasureTheory | |
| open scoped Topology ContDiff | |
| open Filter Set MeasureTheory | |
| open scoped Topology ContDiff | |
| open Filter Set MeasureTheory | |
| open scoped Topology ContDiff | |
| open Filter Set MeasureTheory | |
| open scoped Topology ContDiff | |
| open Filter Set MeasureTheory | |
| open scoped Topology ContDiff | |
| open Filter Set MeasureTheory | |
| open scoped Topology ContDiff Laplacian | |
| open Filter Set MeasureTheory InnerProductSpace | |
| open scoped Topology ContDiff Convolution | |
| open Filter Set MeasureTheory | |
| open scoped Topology ContDiff Convolution | |
| open Filter Set MeasureTheory | |
| open scoped Topology ContDiff Convolution | |
| open Filter Set MeasureTheory | |
| open scoped Topology ContDiff Convolution | |
| open Filter Set MeasureTheory | |
| open scoped Topology ContDiff Convolution | |
| open Filter Set MeasureTheory | |
| open scoped Topology ContDiff Convolution ENNReal | |
| open Filter Set MeasureTheory | |
| open scoped Topology ContDiff ENNReal | |
| open Filter Set MeasureTheory | |
| open scoped Topology ContDiff ENNReal | |
| open Filter Set MeasureTheory | |
| open scoped Topology ContDiff ENNReal | |
| open Filter Set MeasureTheory | |
| open scoped Topology ContDiff | |
| open Filter Set MeasureTheory | |
| open scoped Topology ContDiff | |
| open Filter Set MeasureTheory InnerProductSpace | |
| open scoped Topology ContDiff | |
| open Filter Set MeasureTheory InnerProductSpace | |
| open scoped Topology ContDiff | |
| open Filter Set MeasureTheory InnerProductSpace | |
| open scoped Topology ContDiff | |
| open Filter Set MeasureTheory InnerProductSpace | |
| open scoped Topology ContDiff | |
| open Filter Set MeasureTheory InnerProductSpace | |
| open scoped Topology ContDiff ENNReal | |
| open Filter Set MeasureTheory InnerProductSpace | |
| open scoped Topology ContDiff ENNReal | |
| open Filter Set MeasureTheory InnerProductSpace | |
| open scoped Topology ContDiff | |
| open Filter Set MeasureTheory Function | |
| open scoped Topology | |
| open Filter Set MeasureTheory | |
| open scoped Topology ENNReal | |
| open Filter Set MeasureTheory InnerProductSpace | |
| open scoped Topology | |
| open Filter Set MeasureTheory InnerProductSpace | |
| open scoped Topology ENNReal | |
| open Filter Set MeasureTheory InnerProductSpace | |
| open scoped Topology ENNReal ContDiff | |
| open Filter Set MeasureTheory InnerProductSpace | |
| open scoped Topology ENNReal ContDiff | |
| open Filter Set MeasureTheory InnerProductSpace | |
| open scoped Topology ENNReal | |
| open Filter Set MeasureTheory InnerProductSpace | |
| open scoped Topology ENNReal | |
| open Filter Set MeasureTheory | |
| open scoped Topology ENNReal | |
| open Filter Set MeasureTheory InnerProductSpace | |
| open scoped Topology ENNReal ContDiff | |
| open Filter Set MeasureTheory InnerProductSpace | |
| open scoped Topology ENNReal | |
| open Filter Set MeasureTheory InnerProductSpace | |
| open scoped Topology ENNReal ContDiff | |
| open Filter Set MeasureTheory InnerProductSpace | |
| open scoped Topology ENNReal ContDiff | |
| open Filter Set MeasureTheory InnerProductSpace | |
| open scoped Topology ENNReal ContDiff | |
| open Filter Set MeasureTheory InnerProductSpace | |
| open scoped BigOperators | |
| open Filter Set MeasureTheory | |
| open scoped BigOperators | |
| open scoped Topology ContDiff | |
| open Filter Set MeasureTheory InnerProductSpace | |
| open scoped Topology ContDiff | |
| open Filter Set MeasureTheory InnerProductSpace | |
| open scoped Topology ContDiff | |
| open Filter Set MeasureTheory InnerProductSpace | |
| open scoped Topology ContDiff | |
| open Filter Set MeasureTheory InnerProductSpace | |
| open scoped Topology ContDiff Convolution | |
| open Filter Set MeasureTheory InnerProductSpace | |
| open scoped Topology ContDiff | |
| open Filter Set MeasureTheory InnerProductSpace | |
| open scoped Topology ContDiff | |
| open Filter Set MeasureTheory InnerProductSpace | |
| open scoped Topology | |
| open Filter Set MeasureTheory | |
| open scoped Topology ContDiff | |
| open Filter Set MeasureTheory InnerProductSpace | |
| open scoped Topology ENNReal ContDiff | |
| open Filter Set MeasureTheory InnerProductSpace | |
| open scoped Topology ENNReal ContDiff | |
| open Filter Set MeasureTheory InnerProductSpace | |
| open scoped Topology ENNReal ContDiff | |
| open Filter Set MeasureTheory InnerProductSpace | |
| open scoped Topology ENNReal ContDiff BigOperators | |
| open Filter Set MeasureTheory InnerProductSpace | |
| open scoped Topology ENNReal ContDiff BigOperators | |
| open Filter Set MeasureTheory InnerProductSpace | |
| open scoped BigOperators | |
| open MeasureTheory | |
| open scoped BigOperators | |
| open Set MeasureTheory | |
| open scoped BigOperators | |
| open scoped Classical | |
| open scoped BigOperators Topology ENNReal | |
| open Set MeasureTheory | |
| open scoped BigOperators | |
| open scoped Topology ENNReal ContDiff | |
| open Filter Set MeasureTheory InnerProductSpace | |
| open scoped BigOperators Classical Topology | |
| open Filter Set MeasureTheory | |
| open scoped BigOperators Classical Topology | |
| open Filter Set MeasureTheory | |
| open scoped BigOperators | |
| open Set | |
| open scoped BigOperators Topology | |
| open Set MeasureTheory | |
| open scoped BigOperators | |
| open Set | |
| open scoped BigOperators symmDiff | |
| open Set | |
| open scoped BigOperators | |
| open Set | |
| open scoped BigOperators symmDiff | |
| open Set | |
| open scoped BigOperators Classical | |
| open Set | |
| namespace SharpNodal.Profiles | |
| def fieldGrowth (U : Plane → ℝ) (K : ℝ) : ℝ := | |
| massExcess (centeredMass 0 U 0 1000) (centeredMass 0 U 0 1)/K | |
| lemma UnitWave.growth_zero {Cp a₀ : ℝ} (D : UnitWave Cp a₀) : | |
| D.growth 0=fieldGrowth D.U D.K := by simp only [UnitWave.growth,UnitWave.excess,smul_zero,fieldGrowth] | |
| def pathGrowth (A : ℕ) : (n : ℕ) → (Plane → ℝ) → ℝ → GridWord A n → ℝ | |
| | 0,U,K,_ => fieldGrowth U K | |
| | n+1,U,K,w =>pathGrowth A n (U ∘ rescaleMap (gridCenter A (w 0)) (A:ℝ)⁻¹) | |
| (K/(A:ℝ)) (Fin.tail w) | |
| def PathHigh (A : ℕ) (L : ℝ) : (n : ℕ) → (Plane → ℝ) → ℝ → GridWord A n → Prop | |
| | 0,U,K,_ =>L<fieldGrowth U K | |
| | n+1,U,K,w =>L<fieldGrowth U K ∧ PathHigh A L n | |
| (U ∘ rescaleMap (gridCenter A (w 0)) (A:ℝ)⁻¹) (K/(A:ℝ)) (Fin.tail w) | |
| lemma HighWavePath.raw {A : ℕ} {Cp a₀ L : ℝ} {n : ℕ} {D : ScaledWave Cp a₀} | |
| {w : GridWord A n} (h : HighWavePath A L n D w) : PathHigh A L n D.U D.K w := by | |
| induction n generalizing D with | |
| | zero => simpa only [HighWavePath,PathHigh,UnitWave.growth_zero] using h | |
| | succ n ih => | |
| rcases h with ⟨h,E,hE,hh⟩ | |
| refine ⟨by simpa only [UnitWave.growth_zero] using h,?_⟩ | |
| have hh':=ih hh | |
| rw [hE.2.1,hE.2.2.1] at hh' | |
| exact hh' | |
| def activeGrowth (A : ℕ) (L : ℝ) (n : ℕ) (U : Plane → ℝ) (K : ℝ) (w : GridWord A n) : ℝ := | |
| if PathHigh A L n U K w then pathGrowth A n U K w else 0 | |
| namespace WaveTree | |
| variable {A : ℕ} {Cp a₀ : ℝ} | |
| def StopsAtLow (L : ℝ) : ℕ → WaveTree A Cp a₀ → Prop | |
| | 0,.stop _ _ =>True | |
| | _+1,.stop D _ =>D.growth 0≤L | |
| | 0,.step _ _ _ =>False | |
| | n+1,.step D _ t =>L<D.growth 0 ∧ ∀i,StopsAtLow L n (t i) | |
| theorem build_untilted_stopped {C₀ C₁ L : ℝ} (hA : 2≤A) (ha₀ : 0<a₀) (hC₀ : 0≤C₀) | |
| (hrule : DescentRule A Cp a₀ C₀ C₁ L) (n : ℕ) (D : ScaledWave Cp a₀) (b : Plane) | |
| (hbottom : a₀≤D.K/(A:ℝ)^n) : | |
| ∃t : WaveTree A Cp a₀,t.rootWave=D ∧ t.rootTilt=b ∧ Coherent n t ∧ | |
| Descent.Tree.Valid C₁ (t.numerical C₀) ∧ StopsAtLow L n t := by | |
| classical | |
| have hAr : 2≤(A:ℝ) := by exact_mod_cast hA | |
| have hArpos : 0<(A:ℝ) := by linarith | |
| induction n generalizing D b with | |
| | zero => exact ⟨.stop D b,rfl,rfl,trivial,label_nonnegative ha₀ hC₀ D b,trivial⟩ | |
| | succ n ih => | |
| by_cases hP : L<D.growth 0 | |
| · have hid : (D.K/(A:ℝ))/(A:ℝ)^n=D.K/(A:ℝ)^(n+1) := by rw [pow_succ]; ring | |
| have hnext : a₀≤D.K/(A:ℝ) := by | |
| have hpow : 1≤(A:ℝ)^n := one_le_pow₀ (by linarith) | |
| have hh := (le_div_iff₀ (pow_pos hArpos n)).mp (hid.symm ▸ hbottom) | |
| exact (le_mul_of_one_le_right ha₀.le hpow).trans hh | |
| obtain ⟨E,b',hchild,hinc,hdec⟩ := hrule D b hnext (Or.inl hP) | |
| have hbot (i : GridIndex A) : a₀≤(E i).K/(A:ℝ)^n := by rw [(hchild i).2.2.1,hid]; exact hbottom | |
| choose t hroot htilt hcoh hvalid hstop using (fun i =>ih (E i) (b' i) (hbot i)) | |
| refine ⟨.step D b t,rfl,rfl,?_,?_,⟨hP,hstop⟩⟩ | |
| · intro i | |
| rw [hroot i] | |
| exact ⟨hchild i,hcoh i⟩ | |
| · refine ⟨(label_nonnegative ha₀ hC₀ D b).1,(label_nonnegative ha₀ hC₀ D b).2,?_,?_,hvalid⟩ | |
| · simpa only [numerical_root,hroot,htilt,label] using hdec | |
| · simpa only [numerical_root,hroot,htilt,label] using hinc | |
| · exact ⟨.stop D b,rfl,rfl,trivial,label_nonnegative ha₀ hC₀ D b,le_of_not_gt hP⟩ | |
| lemma active_average_le_cost {C₀ C₁ L : ℝ} (hA : 0<A) (ha₀ : 0<a₀) | |
| (n : ℕ) (t : WaveTree A Cp a₀) (hcoh : t.Coherent n) | |
| (hvalid : Descent.Tree.Valid C₁ (t.numerical C₀)) (hstop : t.StopsAtLow L n) : | |
| (𝔼 w : GridWord A n,activeGrowth A L n t.rootWave.U t.rootWave.K w)≤ | |
| (t.numerical C₀).massCost+1001*(‖t.rootTilt‖+(t.numerical C₀).tiltCost) := by | |
| have : NeZero A := ⟨hA.ne'⟩ | |
| induction n generalizing t with | |
| | zero => cases t with | |
| | stop D b => | |
| have hg : D.growth 0≤D.growth b+1001*‖b‖ := by | |
| have hh:=D.toUnitWave.growth_change ha₀ 0 b | |
| simpa only [zero_sub,norm_neg] using hh | |
| change (𝔼 w : GridWord A 0,activeGrowth A L 0 D.U D.K w)≤D.growth b+1001*(‖b‖+0) | |
| by_cases hh : L<fieldGrowth D.U D.K | |
| · simp only [activeGrowth,PathHigh,pathGrowth,hh,ite_true,Fintype.expect_const,add_zero] | |
| simpa only [UnitWave.growth_zero] using hg | |
| · simp only [activeGrowth,PathHigh,pathGrowth,hh,ite_false,Fintype.expect_const,add_zero] | |
| have hh:=D.toUnitWave.growth_nonneg ha₀ b | |
| positivity | |
| | step D b ts =>exact hcoh.elim | |
| | succ n ih =>cases t with | |
| | stop D b => | |
| have hl : fieldGrowth D.U D.K≤L := by simpa only [StopsAtLow,UnitWave.growth_zero] using hstop | |
| have hh (w : GridWord A (n+1)) : activeGrowth A L (n+1) D.U D.K w=0 := by | |
| simp [activeGrowth,PathHigh,not_lt.mpr hl] | |
| change (𝔼 w : GridWord A (n+1),activeGrowth A L (n+1) D.U D.K w)≤D.growth b+1001*(‖b‖+0) | |
| simp only [hh,Fintype.expect_const,add_zero] | |
| have hm:=D.toUnitWave.growth_nonneg ha₀ b | |
| positivity | |
| | step D b ts => | |
| have hhigh : L<fieldGrowth D.U D.K := by simpa only [UnitWave.growth_zero] using hstop.1 | |
| have hrewrite (i : GridIndex A) (w : GridWord A n) : | |
| activeGrowth A L (n+1) D.U D.K (Fin.cons i w)= | |
| activeGrowth A L n (ts i).rootWave.U (ts i).rootWave.K w := by | |
| rw [(hcoh i).1.2.1,(hcoh i).1.2.2.1] | |
| simp only [activeGrowth,PathHigh,pathGrowth,Fin.cons_zero,Fin.tail_cons,hhigh,true_and] | |
| have havg:=Finset.expect_le_expect (s:=Finset.univ) (fun i _ => | |
| ih (ts i) (hcoh i).2 (hvalid.2.2.2.2 i) (hstop.2 i)) | |
| have htri:=Finset.expect_le_expect (s:=Finset.univ) (fun i (_ : i∈(Finset.univ : Finset (GridIndex A))) => | |
| show ‖(ts i).rootTilt‖≤‖(ts i).rootTilt-b‖+‖b‖ from by | |
| simpa only [sub_add_cancel] using norm_add_le ((ts i).rootTilt-b) b) | |
| simp only [Finset.expect_add_distrib,←Finset.mul_expect,Fintype.expect_const] at havg htri | |
| have hn : 0≤D.growth b := hvalid.1 | |
| change (𝔼 w : GridWord A (n+1),activeGrowth A L (n+1) D.U D.K w)≤_ | |
| rw [expect_word_succ] | |
| simp_rw [hrewrite] | |
| simp only [numerical,Descent.Tree.massCost,Descent.Tree.tiltCost,numerical_root,label,rootTilt] | |
| change (𝔼 i,𝔼 w : GridWord A n,activeGrowth A L n (ts i).rootWave.U (ts i).rootWave.K w)≤ | |
| D.growth b+(𝔼 i,(numerical C₀ (ts i)).massCost)+1001*(‖b‖+ | |
| 𝔼 i,(‖(ts i).rootTilt-b‖+(numerical C₀ (ts i)).tiltCost)) | |
| rw [Finset.expect_add_distrib] | |
| linarith | |
| end WaveTree | |
| end SharpNodal.Profiles | |
| namespace SharpNodal.Profiles | |
| def excursionCostConstant (C₀ C₁ a₀ : ℝ) : ℝ := | |
| 2+2002*C₁+(1+2002*C₁)*(2*(C₀/a₀+1)) | |
| lemma excursionCostConstant_nonneg {C₀ C₁ a₀ : ℝ} | |
| (hC₀ : 0≤C₀) (hC₁ : 0≤C₁) (ha₀ : 0<a₀) : 0≤excursionCostConstant C₀ C₁ a₀ := by | |
| dsimp [excursionCostConstant] | |
| positivity | |
| theorem active_terminal_average {A : ℕ} {Cp a₀ C₀ C₁ L : ℝ} (hA : 2≤A) | |
| (ha₀ : 0<a₀) (hC₀ : 0≤C₀) (hC₁ : 0≤C₁) | |
| (hrule : DescentRule A Cp a₀ C₀ C₁ L) (n : ℕ) (D : ScaledWave Cp a₀) | |
| (hbottom : a₀≤D.K/(A:ℝ)^n) : | |
| (𝔼 w : GridWord A n,activeGrowth A L n D.U D.K w)≤ | |
| excursionCostConstant C₀ C₁ a₀*(D.growth 0+1) := by | |
| have : NeZero A := ⟨by omega⟩ | |
| obtain ⟨t,hD,hb,hcoh,hvalid,hstop⟩:=WaveTree.build_untilted_stopped hA ha₀ hC₀ hrule n D 0 hbottom | |
| have hc:=WaveTree.active_average_le_cost (by omega : 0<A) ha₀ n t hcoh hvalid hstop | |
| rw [hD,hb,norm_zero,zero_add] at hc | |
| have hscaled:=t.coherent_floors C₀ hcoh | |
| rw [hD] at hscaled | |
| have hf:=Descent.Tree.physical_floor_bound (by exact_mod_cast hA : (2:ℝ)≤A) hC₀ ha₀ | |
| (ha₀.trans_le D.frequency_lower) D.side_pos.le D.side_le_one n hbottom hscaled | |
| obtain ⟨hm,ht⟩:=Descent.Tree.stopped_descent hC₁ hvalid | |
| rw [WaveTree.numerical_root,hD,hb] at hm ht | |
| change (t.numerical C₀).massCost≤2*D.growth 0+(t.numerical C₀).floorCost at hm | |
| change (t.numerical C₀).tiltCost≤2*C₁*D.growth 0+2*C₁*(t.numerical C₀).floorCost at ht | |
| have hF : 0≤2*(C₀/a₀+1) := by positivity | |
| have hh : (𝔼 w : GridWord A n,activeGrowth A L n D.U D.K w)≤ | |
| (2+2002*C₁)*D.growth 0+(1+2002*C₁)*(2*(C₀/a₀+1)) := by | |
| nlinarith [mul_le_mul_of_nonneg_left hf (by positivity : (0:ℝ)≤1+2002*C₁)] | |
| have hN:=D.toUnitWave.growth_nonneg ha₀ 0 | |
| dsimp only [excursionCostConstant] | |
| nlinarith [mul_nonneg (mul_nonneg (by positivity : (0:ℝ)≤1+2002*C₁) hF) hN] | |
| end SharpNodal.Profiles | |
| noncomputable section | |
| open scoped BigOperators | |
| open Set | |
| namespace SharpNodal.Grid | |
| def atLevel (A n : ℕ) (x : Point) : Cell := ⟨n,fun i =>x i/(A:ℤ)^n⟩ | |
| lemma mem_atLevel {A : ℕ} (hA : 0<A) (n : ℕ) (x : Point) : x∈(atLevel A n x).points A := by | |
| apply (mem_square_div (pow_pos hA n)).mpr | |
| intro i | |
| simp only [atLevel,Nat.cast_pow] | |
| lemma eq_atLevel {A : ℕ} (hA : 0<A) {Q : Cell} {x : Point} (hx : x∈Q.points A) : | |
| Q=atLevel A Q.level x := Cell.equal_level_eq_of_intersection hA rfl hx (mem_atLevel hA _ _) | |
| def fullTree (A : ℕ) (root : Cell) : Finset Cell := | |
| (Finset.range (root.level+1)).biUnion (fun n =>(root.points A).image (atLevel A n)) | |
| lemma mem_fullTree {A : ℕ} (hA : 0<A) {Q root : Cell} : | |
| Q∈fullTree A root ↔ Q.level≤root.level ∧ Q.points A⊆root.points A := by | |
| classical | |
| constructor | |
| · intro h | |
| obtain ⟨n,hn,hQ⟩:=Finset.mem_biUnion.mp h | |
| obtain ⟨x,hx,rfl⟩:=Finset.mem_image.mp hQ | |
| exact ⟨by simpa only [atLevel,Finset.mem_range,Nat.lt_succ_iff] using hn, | |
| Cell.subset_of_intersection hA (by simpa only [atLevel,Finset.mem_range,Nat.lt_succ_iff] using hn) | |
| (mem_atLevel hA n x) hx⟩ | |
| · rintro ⟨hlev,hsub⟩ | |
| obtain ⟨x,hx⟩:=(Finset.card_pos.mp (by rw [Cell.card_points]; exact pow_pos (Q.side_pos hA) 2)) | |
| apply Finset.mem_biUnion.mpr | |
| refine ⟨Q.level,Finset.mem_range.mpr (by omega),Finset.mem_image.mpr ⟨x,hsub hx,?_⟩⟩ | |
| exact (eq_atLevel hA hx).symm | |
| lemma atLevel_mem_fullTree {A : ℕ} (hA : 0<A) {root : Cell} {x : Point} | |
| (hx : x∈root.points A) {n : ℕ} (hn : n≤root.level) : atLevel A n x∈fullTree A root := by | |
| apply (mem_fullTree hA).mpr | |
| exact ⟨hn,Cell.subset_of_intersection hA hn (mem_atLevel hA n x) hx⟩ | |
| def entries (A : ℕ) (F : Finset Cell) (N : Cell → ℝ) (L H : ℝ) : Finset Cell := | |
| F.filter (fun Q =>H<N Q ∧ ∀P∈Q.ancestors A F,H<N P → | |
| ∃R∈F,Q.level<R.level ∧ R.level<P.level ∧ Q.points A⊆R.points A ∧ N R≤L) | |
| lemma entries_subset (A : ℕ) (F : Finset Cell) (N : Cell → ℝ) (L H : ℝ) : | |
| entries A F N L H⊆F := Finset.filter_subset _ _ | |
| lemma entry_high {A : ℕ} {F : Finset Cell} {N : Cell → ℝ} {L H : ℝ} {Q : Cell} | |
| (hQ : Q∈entries A F N L H) : H<N Q := (Finset.mem_filter.mp hQ).2.1 | |
| lemma entry_separation {A : ℕ} {F : Finset Cell} {N : Cell → ℝ} {L H : ℝ} {Q P : Cell} | |
| (hQ : Q∈entries A F N L H) (hP : P∈entries A F N L H) | |
| (hlev : Q.level<P.level) (hsub : Q.points A⊆P.points A) : | |
| ∃R∈F,Q.level<R.level ∧ R.level<P.level ∧ Q.points A⊆R.points A ∧ N R≤L := | |
| (Finset.mem_filter.mp hQ).2.2 P | |
| (Finset.mem_filter.mpr ⟨entries_subset A F N L H hP,hlev,hsub⟩) (entry_high hP) | |
| lemma entry_parent_low {A : ℕ} {F : Finset Cell} {N : Cell → ℝ} {L H : ℝ} {Q P : Cell} | |
| (hQ : Q∈entries A F N L H) (hP : P∈F) (hlev : P.level=Q.level+1) | |
| (hsub : Q.points A⊆P.points A) : N P≤H := by | |
| by_contra hh | |
| have hp : H<N P := lt_of_not_ge hh | |
| obtain ⟨R,hR,hQR,hRP,-,-⟩:=(Finset.mem_filter.mp hQ).2.2 P | |
| (Finset.mem_filter.mpr ⟨hP,by omega,hsub⟩) hp | |
| omega | |
| lemma entries_on_high_suffix {A : ℕ} (hA : 0<A) (F : Finset Cell) (N : Cell → ℝ) | |
| (L H : ℝ) (n : ℕ) (x : Point) | |
| (hhigh : ∀R∈F,R.level≤n → x∈R.points A → L<N R) : | |
| ((entries A F N L H).filter (fun Q =>Q.level≤n ∧ x∈Q.points A)).card≤1 := by | |
| apply Finset.card_le_one.mpr | |
| intro Q hQ P hP | |
| rcases Finset.mem_filter.mp hQ with ⟨hQ,hQn,hxQ⟩ | |
| rcases Finset.mem_filter.mp hP with ⟨hP,hPn,hxP⟩ | |
| rcases lt_trichotomy Q.level P.level with h|h|h | |
| · obtain ⟨R,hR,hQR,hRP,hsub,hlow⟩:=entry_separation hQ hP h | |
| (Cell.subset_of_intersection hA h.le hxQ hxP) | |
| exact (not_lt_of_ge hlow (hhigh R hR (hRP.le.trans hPn) (hsub hxQ))).elim | |
| · exact Cell.equal_level_eq_of_intersection hA h hxQ hxP | |
| · obtain ⟨R,hR,hPR,hRQ,hsub,hlow⟩:=entry_separation hP hQ h | |
| (Cell.subset_of_intersection hA h.le hxP hxQ) | |
| exact (not_lt_of_ge hlow (hhigh R hR (hRQ.le.trans hQn) (hsub hxP))).elim | |
| lemma smaller_entries_high_suffix {A : ℕ} (hA : 0<A) (F : Finset Cell) (N : Cell → ℝ) | |
| (L H : ℝ) (Q : Cell) (n : ℕ) (x : Point) | |
| (hhigh : ∀R∈F,R.level≤n → x∈R.points A → L<N R) : | |
| (Q.smallerAt A (entries A F N L H) x).card≤Q.level-n+1 := by | |
| classical | |
| let S:=Q.smallerAt A (entries A F N L H) x | |
| let Lo:=S.filter (fun P =>P.level≤n) | |
| let Hi:=S.filter (fun P =>¬P.level≤n) | |
| have hsplit : Lo.card+Hi.card=S.card := Finset.card_filter_add_card_filter_not _ | |
| have hlo : Lo.card≤1 := by | |
| apply (Finset.card_le_card ?_).trans (entries_on_high_suffix hA F N L H n x hhigh) | |
| intro P hP | |
| rcases Finset.mem_filter.mp hP with ⟨hP,hn⟩ | |
| rcases Finset.mem_filter.mp hP with ⟨hP,hPlev,hx⟩ | |
| exact Finset.mem_filter.mpr ⟨hP,hn,hx⟩ | |
| have hmap : MapsTo Cell.level (Hi : Set Cell) (Finset.Ico (n+1) Q.level) := by | |
| intro P hP | |
| rcases Finset.mem_filter.mp hP with ⟨hP,hn⟩ | |
| have hlev := (Finset.mem_filter.mp hP).2.1 | |
| exact Finset.mem_Ico.mpr ⟨by omega,hlev⟩ | |
| have hinj : InjOn Cell.level (Hi : Set Cell) := by | |
| intro P hP R hR he | |
| exact Cell.equal_level_eq_of_intersection hA he | |
| (Finset.mem_filter.mp (Finset.mem_filter.mp hP).1).2.2 | |
| (Finset.mem_filter.mp (Finset.mem_filter.mp hR).1).2.2 | |
| have hhi:=Finset.card_le_card_of_injOn Cell.level hmap hinj | |
| rw [Nat.card_Ico] at hhi | |
| change S.card≤_ | |
| omega | |
| def activeSet (A : ℕ) (F : Finset Cell) (N : Cell → ℝ) (L : ℝ) (Q : Cell) : Finset Point := | |
| (Q.points A).filter (fun x =>∀R∈F,R.level≤Q.level → x∈R.points A → L<N R) | |
| lemma terminal_has_active_entry {A : ℕ} (hA : 0<A) (root : Cell) (N : Cell → ℝ) | |
| {L H : ℝ} (hLH : L≤H) {x : Point} (hx : x∈root.points A) | |
| (ht : H<N (atLevel A 0 x)) : | |
| ∃Q∈entries A (fullTree A root) N L H,x∈activeSet A (fullTree A root) N L Q := by | |
| classical | |
| let F:=fullTree A root | |
| let G:=F.filter (fun Q =>x∈Q.points A ∧ H<N Q ∧ | |
| ∀R∈F,R.level≤Q.level → x∈R.points A → L<N R) | |
| have hterm : atLevel A 0 x∈G := by | |
| refine Finset.mem_filter.mpr ⟨atLevel_mem_fullTree hA hx (Nat.zero_le _),mem_atLevel hA 0 x,ht,?_⟩ | |
| intro R hR hn hRx | |
| have he : R=atLevel A 0 x := Cell.equal_level_eq_of_intersection hA (Nat.eq_zero_of_le_zero hn) hRx (mem_atLevel hA 0 x) | |
| rw [he] | |
| exact hLH.trans_lt ht | |
| obtain ⟨Q,hQ,hmax⟩:=Finset.exists_max_image G Cell.level ⟨_,hterm⟩ | |
| rcases Finset.mem_filter.mp hQ with ⟨hQF,hxQ,hNQ,hhigh⟩ | |
| refine ⟨Q,Finset.mem_filter.mpr ⟨hQF,hNQ,?_⟩,Finset.mem_filter.mpr ⟨hxQ,hhigh⟩⟩ | |
| intro P hP hNP | |
| rcases Finset.mem_filter.mp hP with ⟨hPF,hQP,hsub⟩ | |
| by_contra hbar | |
| have hPgood : ∀R∈F,R.level≤P.level → x∈R.points A → L<N R := by | |
| intro R hR hRP hxR | |
| by_cases hRQ : R.level≤Q.level | |
| · exact hhigh R hR hRQ hxR | |
| · by_cases he : R.level=P.level | |
| · have hEq:=Cell.equal_level_eq_of_intersection hA he hxR (hsub hxQ) | |
| rw [hEq] | |
| exact hLH.trans_lt hNP | |
| · by_contra hlow | |
| exact hbar ⟨R,hR,by omega,by omega, | |
| Cell.subset_of_intersection hA (by omega) hxQ hxR,le_of_not_gt hlow⟩ | |
| have hPG : P∈G := Finset.mem_filter.mpr ⟨hPF,hsub hxQ,hNP,hPgood⟩ | |
| have hh:=hmax P hPG | |
| omega | |
| end SharpNodal.Grid | |
| namespace SharpNodal.Grid | |
| theorem terminal_sum_le {A : ℕ} (hA : 0<A) (root : Cell) (N : Cell → ℝ) {L H C : ℝ} | |
| (hLH : L≤H) (hH : 0≤H) | |
| (hN : ∀x∈root.points A,0≤N (atLevel A 0 x)) | |
| (hlocal : ∀Q∈entries A (fullTree A root) N L H, | |
| (∑x∈activeSet A (fullTree A root) N L Q,N (atLevel A 0 x))≤C*(Q.points A).card) : | |
| (∑x∈root.points A,N (atLevel A 0 x))≤ | |
| H*(root.points A).card+C*∑Q∈entries A (fullTree A root) N L H,((Q.points A).card:ℝ) := by | |
| classical | |
| let E:=entries A (fullTree A root) N L H | |
| let Ω:=activeSet A (fullTree A root) N L | |
| let t:=fun x =>N (atLevel A 0 x) | |
| have hΩ : ∀Q∈E,Ω Q⊆root.points A := by | |
| intro Q hQ | |
| exact (Finset.filter_subset _ _).trans ((mem_fullTree hA).mp (entries_subset _ _ _ _ _ hQ)).2 | |
| have hp (x : Point) (hx : x∈root.points A) : t x≤H+∑Q∈E,if x∈Ω Q then t x else 0 := by | |
| have hnon : ∀ Q : Cell, 0 ≤ (if x∈Ω Q then t x else 0) := fun Q =>by split_ifs <;> first | exact hN x hx | rfl | |
| by_cases ht : t x≤H | |
| · exact ht.trans (le_add_of_nonneg_right (Finset.sum_nonneg (fun Q _ =>hnon Q))) | |
| · obtain ⟨Q,hQ,hxQ⟩:=terminal_has_active_entry hA root N hLH hx (lt_of_not_ge ht) | |
| have hsingle:=Finset.single_le_sum (s:=E) (fun P _ =>hnon P) hQ | |
| rw [ite_eq_left hxQ] at hsingle | |
| exact hsingle.trans (le_add_of_nonneg_left hH) | |
| have hsumQ (Q : Cell) (hQ : Q∈E) : | |
| (∑x∈root.points A,if x∈Ω Q then t x else 0)=∑x∈Ω Q,t x := by | |
| rw [←Finset.sum_filter] | |
| congr 1 | |
| ext x | |
| simp only [Finset.mem_filter] | |
| exact ⟨fun h =>h.2,fun h =>⟨hΩ Q hQ h,h⟩⟩ | |
| calc | |
| _≤∑x∈root.points A,(H+∑Q∈E,if x∈Ω Q then t x else 0) := Finset.sum_le_sum (fun x hx =>hp x hx) | |
| _=H*(root.points A).card+∑Q∈E,∑x∈root.points A,if x∈Ω Q then t x else 0 := by | |
| rw [Finset.sum_add_distrib,Finset.sum_comm] | |
| simp only [Finset.sum_const,nsmul_eq_mul,mul_comm] | |
| _=H*(root.points A).card+∑Q∈E,∑x∈Ω Q,t x := by | |
| congr 1 | |
| exact Finset.sum_congr rfl (fun Q hQ =>hsumQ Q hQ) | |
| _≤H*(root.points A).card+∑Q∈E,C*(Q.points A).card := | |
| add_le_add le_rfl (Finset.sum_le_sum (fun Q hQ =>hlocal Q hQ)) | |
| _=_ := by rw [←Finset.mul_sum] | |
| theorem terminal_mean_of_witnesses {A D c J : ℕ} (hA : 2≤A) (root : Cell) | |
| (N : Cell → ℝ) {L H C : ℝ} (hLH : L≤H) (hH : 0≤H) (hC : 0≤C) | |
| (hN : ∀x∈root.points A,0≤N (atLevel A 0 x)) | |
| (hlocal : ∀Q∈entries A (fullTree A root) N L H, | |
| (∑x∈activeSet A (fullTree A root) N L Q,N (atLevel A 0 x))≤C*(Q.points A).card) | |
| (Y : Cell → Finset Point) | |
| (hnear : ∀Q∈entries A (fullTree A root) N L H,Y Q⊆Q.near A D) | |
| (hlower : ∀Q∈entries A (fullTree A root) N L H,(Q.points A).card≤c*(Y Q).card) | |
| (hsmall : ∀Q∈entries A (fullTree A root) N L H,∀x∈Y Q, | |
| (Q.smallerAt A (entries A (fullTree A root) N L H) x).card≤J) : | |
| (∑x∈root.points A,N (atLevel A 0 x))≤ | |
| (H+C*packingConstant D c J)*(root.points A).card := by | |
| have hApos : 0<A := by omega | |
| have hp:=nearby_witness_packing hA (entries A (fullTree A root) N L H) root Y | |
| (fun Q hQ =>(mem_fullTree hApos).mp ((entries_subset A (fullTree A root) N L H) hQ)) | |
| hnear hlower hsmall | |
| have hp' : (∑Q∈entries A (fullTree A root) N L H,((Q.points A).card:ℝ))≤ | |
| (packingConstant D c J:ℝ)*(root.points A).card := by exact_mod_cast hp | |
| have hs:=terminal_sum_le hApos root N hLH hH hN hlocal | |
| nlinarith [mul_le_mul_of_nonneg_left hp' hC] | |
| end SharpNodal.Grid | |
| end | |
| end | |
| end OAI | |
Xet Storage Details
- Size:
- 27.1 kB
- Xet hash:
- c38b4a2350011b423b860b80bf69f3f63d842d238a35ec4057ddd70dd485a072
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.