import YM.WilsonBulk.Build.Accept
/-!
# Finite output equation for all admissible real-germ transforms
Use for Ward, affine-null projection of rank2, and tree/tag independence.
Complete (through every coefficient), even when additive stopped at any
finite order. This output is positive M̂ including branch scalar cumulants.
We start relative reset subtracting only field-independent output (proved
coherent with zero expectation later on cashless cover). Domain chart.
-/
set_option autoImplicit false
noncomputable section
namespace YM.WilsonBulk.Atelier
open Function Filter Matrix Sheet Precision RG Exterior Lattice Wilson FreeResolvent
open Stationary (Army)
open scoped Topology BigOperators Classical ContDiff Matrix.Norms.Frobenius
open Coursing
variable {α β κ ι : Type} [Fintype κ] [Fintype ι]
variable {G : Gauge} {c f n : Side} {S : StepData c f} {F L : Coursing ι S} {P Q : Bed} {J : ChartRatio G} {a : ℝ} {k : G.El}
variable {M N : Logbook G f} {W Z : Logbook G c} {t r : S.Choices}
variable (s : Signed) (b : Site c)
def plateau (J : ChartRatio G) (P : Bed) (t : S.Choices) (F : Coursing ι S) (M : Logbook G f) (W : Logbook G c) :=
glimmer G ι P F (auditorium S t M) (haarTape c f J) W
abbrev pressurize (Q : Bed) (W : Logbook G c) := grains (matrixK G c Q)-W
lemma ride_preserve {u v : Tabletop κ→Interface G c} {X : Tabletop κ→Site c→ G.El} (hl : Bid.Larger (G:=G) S) (hc : Consoles P Q S) (hb : 01) := by
refine ⟨h,(swivel_jet ..).contDiffAt.comp _ h,he,by rw [Function.comp_apply,he,swivel_birth],⟨1,rfl⟩,Stationary.Army.park _ _, Eventually.of_forall fun z=>?_⟩
rw [Function.comp_apply,swivel_sign]; exact (turn_person _).symm
lemma costumed_coarse (k : G.El) :
Plays 1 (0:Site c) (upper (Pennant G c) (Needle G c)) (pigment c k) (curtainK c k ∘ lower _ _) := by
let U:= upper (Pennant G c) (Needle G c); let A:=lower (Pennant G c) (Needle G c)
refine ⟨U.contDiff.contDiffAt,pigment_jet _,map_zero U,pigment_birth _,⟨k,by rw [Function.comp_apply,map_zero, curtainK_zero]⟩,weatherK k A.contDiff.contDiffAt, (pigment_laid k).mono fun z hz=>?_⟩
rw [pull_id]; exact hz
lemma spins_post (hl : Bid.Larger (G:=G) S) (hc : Consoles P Q S) (hb : 0 by
have h:= ride_preserve 1 0 hl hc hb hB hJ (costumed_coarse k) hf hf h (by rw [show S.ratio.embed 0=0 from S.ratio.root.map_zero]; exact spins_id _)
rw [upper_code] at h; exact h.symm
lemma tree_credible (hl : Bid.Larger (G:=G) S) (hc : Consoles P Q S) (hb : 0