import YM.Next.RANK.Distant import YM.Next.RANK.HaloLow /-! Produce Bell from Fourier terminal/lifted stencil ports, and real cumulative kernel estimates. Conditional version ONLY. -/ set_option autoImplicit false noncomputable section namespace YM.Next.Rank.Wall open Function Set Lattice Wilson RG Normal Perch Prayer Atlas Station CellsInt Configuration Glimmer Filter Beamer Maxwell open scoped Topology BigOperators Classical variable {G : Gauge} (A : Levels G) {k n d : ℕ} def stretch (b : ℝ) (k : ℕ) := A.S.a (middle A b k)/ A.S.a k def Vantage (d k p n D : ℕ) (b : ℝ) (F : AtlasData G A.S p) := Model A d k p F ∧ Fell F (before A b k) d (stretch A b k) (fraction n D (clim A k)) private lemma thump {z s r : ℝ} (hr : 0 Finset.sum_eq_zero fun j _ => ?_ have ht (x v) (u : KeyIn G d) : v=x.degree → v=d-1 → gesture x (arbor d r u) = 0 := by intro hx h; rw [arbor,map_smul,tester,gesture_over,smul_zero]; have hh := u.property; unfold Labels.generation at hh;omega rw [show mourn (gesture x) (gesture y) (fun s t => arbor d r i s*arbor d r j t)=gesture x (arbor d r i)*gesture y (arbor d r j) from ?_]; rotate_left · change gesture x (fun s => gesture y (arbor d r i s • arbor d r j)) = _ rw [show (fun s => gesture y (arbor d r i s • arbor d r j))= (gesture y (arbor d r j)) • arbor d r i from funext (fun s => (map_smul ..).trans (mul_comm ..)),map_smul]; exact mul_comm .. cases h with | inl h => rw [ht x _ i rfl h,zero_mul,smul_zero] | inr h => rw [ht y _ j rfl h,mul_zero,smul_zero] private lemma order (x : Degree G) {d m : ℕ} (h : attends d m x) : x.degree ≤ d-1 := by rcases h with ⟨he,hp⟩|⟨he,hp⟩ <;> omega private lemma attend (L : Hub G d 0) (n : ℕ) : attends d n L.val := Or.inl ⟨L.property.1,L.property.2.2⟩ theorem on_demand {x : Points n} (b : ℝ) (D d : ℕ) (H : G.Simple) (hx : x∈conf _) (hb : 6≤ b) : ∀ᶠ k in atTop,∀ h : Fit A b k x, Allowed A b k → ∀ p F,Vantage A d k p n D b F → Bell A F d D h := by let e := fuel D n have he : 0 hL.colors _ _ _,fun u hu z => ?_,fun u hu => ⟨fun i => ?_,fun i j => ?_⟩⟩ · change (( (_ : ℂ).re:ℝ) : ℂ)= _; rw [hL.sends_mean]; simp · let l:=middle A b k; let g:= choose A b k x; let c:= clim A k; let s:=stretch A b k let m:= A.clock.monitor k; have hm : 1 ≤ m := Real.one_le_exp (sq_nonneg _) let a:= mag A b k; have hp : 0 < a := mag_pos .. let P:=fraction n D c; have hC : 0 ≤ P := (Real.exp_pos _).le; have h3 := ha.dilation let H:= Wall.field F (before A b k) (g i) u have hP : 0 (he L H').trans (billed _ ?_)⟩, fun L => he _ (attend _ _)⟩ exact le_trans (by norm_num : (-3:ℝ)≤0) (by change 0≤e/4; linarith) let g := choose A b k x; let K:= currentX (Ship.fitting h) G d; let a := mag A b k; let l:= middle A b k; let s:=stretch A b k let L:= looked (scope (lines F l (before A b k)) (F.κ l)) (g i) (g j) let p₀:= A.clock.monitor k; let c:= clim A k; let P₀:= bill (e/4) c let B:= bill (-4+3*(e/4)) c; let δ:= bill (-3) c have ht := hL.moth (g i) (g j); have hl : 0 (signal G).sub_mem (signal G).zero_mem (ht.1 i),fun i => (signal G).sub_mem (signal G).zero_mem (ht.2 i),fun x y H H' => (ho x y H H').trans he₁, fun x y => ho _ _ (attend ..) (attend ..)⟩ rw [if_neg hy] let a' := looked (F.κ k) (g i) (g j) let s' := collect d (Ship.fitting h) a G i j let C:= fun s t=> (K.cov (i,s) (j,t)).re have hv := hS p F hM i j hy have hs (X y : Hub G d 0) : amount a X.val * amount a y.val * ‖mourn (gesture X.val) (gesture y.val) (a'-L-s')‖ ≤ δ := by let f:= mourn (gesture X.val) (gesture y.val) let c' := amount a X.val * amount a y.val have hc' : 0 ≤ c' := mul_nonneg (hE _).le (hE _).le let M:= Prayer.light X.val y.val (tested A b k x i) (tested A b k x j) have he : ‖c' * f a'-M‖≤bill (-4) c := hv.origin X y have ha : ‖c'*f s'-M‖≤bill (-4) c := hQ h i j X y hy have he' : c'*‖f L‖ ≤ B := Hk _ _ (attend ..) (attend ..) change c'*‖f _‖ ≤ _; calc _ = ‖((c'*f a'-M)-(c'*f s'-M))-c'*f L‖ := by rw [map_sub,map_sub,show (c'*_-M)-(c'*_-M)-c'*_ = c'*(f a'-f L-f s') by ring,norm_mul, Real.norm_of_nonneg hc'] _ ≤ _ := by apply (norm_sub_le ..).trans apply (add_le_add ((norm_sub_le ..).trans (add_le_add he ha)) ((by rw [norm_mul, Real.norm_of_nonneg hc']; exact he') : ‖c'*f L‖ ≤ B)).trans have hr : bill (-4) c ≤ B := billed _ (by linarith); linarith only [hr,t₀] refine ⟨fun i => (signal G).sub_mem ((signal G).sub_mem (hv.closures.1 i) (ht.1 i)) (choke d a C i), fun i => (signal G).sub_mem ((signal G).sub_mem (hv.closures.2 i) (ht.2 i)) (chokes d a C i), ?_, hs⟩ intro x y he hk by_cases hh : (x.degree+2 ≤ d ∧ x.point=0) ∧ (y.degree+2 ≤ d ∧ y.point=0) · exact (hs ⟨x,hh.1.2,Nat.zero_le _,hh.1.1⟩ ⟨y,hh.2.2,Nat.zero_le _,hh.2.1⟩).trans he₁ have hb' : x.degree=d-1 ∨ y.degree=d-1 := (not_and_or.mp hh).elim (fun H => Or.inl ((he.resolve_left (fun ⟨a,b⟩ => H ⟨b,a⟩)).1)) (fun H => Or.inr ((hk.resolve_left (fun ⟨a,b⟩ => H ⟨b,a⟩)).1)) let t := amount a x * amount a y change t * ‖mourn _ _ (a'-L-s')‖≤P₀ rw [map_sub,show mourn (gesture x) (gesture y) s'=0 from bled x y C hb', sub_zero, map_sub] apply le_trans (mul_le_mul_of_nonneg_left (norm_sub_le ..) (show 0≤t from mul_nonneg (hE _).le (hE _).le)) rw [mul_add] have hU : B ≤ bill (e/8) c := billed _ (by linarith) apply (add_le_add (hv.extent x y he hk) (Hk x y he hk)).trans; linarith only [hU,t₁] end YM.Next.Rank.Wall