import YM.RG05Readout.Offsets.Transport import YM.UVExtension.Flake.Lamps /-! Adapt `Cub.noted` on retained offsets & restricted field rows. -/ set_option autoImplicit false noncomputable section namespace YM.PhysicalNext.Repeat.Cub open Circlet open Function Filter Set Lattice RG Pressure Pressure.Tube Tree Wilson Finset MeasureTheory open ConnectedActivityE6 Shell Coat SliceRows Pulse Mask Raw Matter Pond open Push Push.AbsoluteSums Gas Ursell Trees Multiple Letter OmitClusters RG Shoot Precision SectorMeasure Oriented Reserves open AnalyticBridge VerifiedReset Collection Quotes UVNext Next.Scheduling Org open Extra.Iteration Greenbelt Match Song Refrain open ConnectedActivityE6.Blaze Blaze.March Captain Silica Height Brim Time Supply Input Testing PriceCompiler Opera open JointLoad JointLoad.Heir JointLoad.Heir.Suite JointLoad.Psalm Clockwork Roof Daisy Charity Rain Roost Lotus Blush Mallow open UVNext.CouplingReset Animals Marlin Progress.DirectedRecipe Ovens Ovens.Pipes open Extra.Histories Extra.Histories.Doors Next.Foundations YM.Planned.GuardedAtom Labels Peak Mercury Graces open Planned.PrimaryIntegral295 WaterLevels open scoped Topology InnerProductSpace Matrix.Norms.Frobenius ContDiff BigOperators Classical variable {G : Gauge}{M : Metals G}{D:Rolls M.p}{A:Alloy M D}{Q:ℕ→ℕ→ Teller G}{C: Programs M.p} {r p:ℕ→ℕ} {R:ℕ→ℕ→Record}{B:Factor A}{V:Vintage.YM.Org.Bolt A} local notation "cc"=> A.B.a variable {m N n d:ℕ} (hm:m A.B.a.clock.J (m+1) local notation "T"=> A.B.a.clock.J m local notation "B₁"=> A.B.a.budget m local notation "B₂"=> A.B.a.budget (m+1) local notation "X"=> A.B.a.clock.op m n local notation "V0"=> ships A.B N m n local notation "L"=> D.L J local notation "y"=> A.B.a.clock.hatBeta m local notation "v"=> R J T local notation "u"=> C J T local notation "vT"=> M.p.profile J local notation "vB"=> M.p.profile T local notation "r'"=> B.span J T set_option quotPrecheck false variable (hP:Circlet.Pitch M.p M.K Q C r) (hp: Pads D R Q M.K C A.delay) (hc: Decked C D R B.span B.shape A.delay) (hb:goodD M.p (A.B.a.clock.J (m+1)) (A.B.a.clock.J m) d)(hV:Vintage.YM.PhysicalNext.Repeat.Graces.Nest B V) (hC:Mallow.Arrives B.shape A.delay) local notation "F"=> (Labels.frames G).level d local notation "n₀"=> A.B.a.S.side m n local notation "n₁"=> A.B.a.S.side (m+1) n variable {K:In A.B.a m n} {x t:ℝ} (H: Spring B N m n x t K)(z: Icc x t) local notation "Z"=> houseS H z local notation "K!"=> K z.val variable (hz:Push.Local.Readable (hol G) (localSection G d) (K z).p (A.B.a.S.side (m+1) n) (Cub.title G (M.p.profile (A.B.a.clock.J (m+1))))) (h!:HasSlots (K z|>.p) (K z|>.activities)) -- wrap etc. earn with fixed Glider. local notation "β" => (K z.val).beta open RG05Cell variable (b₀:Site (A.B.a.S.side (m+1) n))(hb₀:(A.B.a.clock.op m n).ratio.parent b₀=0) local notation "Ω"=> RG05Cell.tab G b₀ d local notation "w"=> B.span J T local notation "Xp"=> (localSection G d).footprint b₀ local notation "Yp"=> (plate Z Ω).support open PPX Next.Free WardBin.Lies -- expose Leg without footing.Help alignment variable (i:((Labels.frames G).level d).Index) local notation "θ!"=> Cub.title G vT local notation "T!"=> wood (K z) b₀ i hz h! local notation "c0"=> (K z).p local notation "U!"=> (X) local notation "f!"=> RG05Cell.hills (K z) b₀ i local notation "Z0"=> icon Z Ω local notation "q'"=> Chi.canonical set_option quotPrecheck false include h! hm hP hp hc hb hV hC include hb₀ open Multi.Puff Source Bid local notation "M0"=> (M.p.profile T) local notation "v0"=> ((L).val:ℂ)^d local notation "F0"=> (Blush.pane Z T! v0 Z0) local notation "t0"=> ((B₁).threshold) local notation "S!"=> localSection G d local notation "p'"=> (Vintage.YM.Planned.PrimaryIntegral295.WaterLevels.forecast V m N n) lemma RG05_target (E: Angle J T d (M0).order L vB vT (query M.p M.K J T) M.p.kernel u v (B.target J T) (B.walls J T) (B.shape.o J T) (B.shape.μ J T) y (B.span J T)) (hD : Push.Local.Readable (hol G) (localSection G d) B₁ n₀ (authors A.B.a m)) : (B₁).Regular (plate Z Ω).support (pane Z T! v0 Z0) ∧ ∀ (p: Push.Local.Probe G d), p∈ Local.tests F→p.2.val ≤ (F|>.grades i).1 → ∀ (hi:4≤ A.B.a.clock.J m) (hj : d ≤ A.B.a.clock.J (m+1)) (hu:PPX.Blend 2 (B₂).threshold (B₁).threshold), let P :=Warehouse.flight (Vintage.YM.Extra.Histories.Issue.trail V) N m let hf:= PPX.Seal.donne S! (sound G d) M.p.kernel.penalty_pos hi (Next.Foundations.valuation G d) P hj hu ‖Local.runProbe F p (Local.weighted (hol G) F 0 Yp t0 (F0) - hf.leads L (Place.copy F i))‖ ≤ E.current:=by -- X0.w.card hue. combine RealC.Identity h test.G.Weight. Need q.V Tracker options for curtain only.W Bonds. health.Nil. have hp':=B.pledging.conducts have hv:= (Vintage.YM.PhysicalNext.Repeat.Circlet.united (n:=n) hm hP hp hV).1; have hB:(K z).p=B₂:= (H.knows _ z.2).1.point; rw [← hB] at hv have hU:= (A.B.valid.pays m) obtain ⟨a,b,y₀,g,v₀,Y',p₁,B',g',e,ν,hX,hY,N'',hη⟩:= (hC _ _ hU _ hb.1).1.2 _ _ _ _ (Opera.protocol A.B hm hp'.full (n:=n)) _ _ Z have hn:= Rain.jersey (A:=A) (m:=m)|>.1 obtain ⟨hf,hy₀,hz₁⟩:= RG05_transport hm hP hp hc hb hV hC H z hz h! b₀ hb₀ i E Complex.reCLM juror obtain ⟨hf',hy₁,hz₂⟩:= RG05_transport hm hP hp hc hb hV hC H z hz h! b₀ hb₀ i E Complex.imCLM jurorI have h₁:= Blush.ornate (Mercury.cornice Z (T!).live Ω rfl v q' N'' hv hη hn.le); have h₂:=Blush.ornate (Mercury.cornice Z (T!).pale Ω rfl v q' N'' hv hη hn.le); have hF:=regular_smul v0 (regular_add h₁ (regular_smul Complex.I h₂)) refine ⟨hF,?_⟩; intro p hpX hpX' hi hj hu P f let U:= ocean p' f! y; let W:= v0 • U; let Y(c:ℂ→L[ℝ]ℝ):= Complex.ofRealCLM ∘ deem b₀ y p' (c ∘ f!) have h1: U=Y Complex.reCLM + Complex.I • Y Complex.imCLM:=by funext uA; change U uA=_ + Complex.I*_ ; unfold Y; simp only [Function.comp_apply,deem,hb₀] have hh₀ : (X).ratio.parent 0=0:=by let t:=(X).ratio; change t.parent 0=0; rw [← t.root.map_zero]; exact t.embed_parent _ unfold U ocean; have hp:=(X); rw [hh₀]; rw [mul_comm Complex.I]; exact (Complex.re_add_im _).symm have hx: Local.Chart d U 1:= by have hx₁ : ContDiffAt ℝ d (Y Complex.reCLM ∘ increment 1) 0:=Complex.ofRealCLM.contDiff.contDiffAt.comp _ (show ContDiffAt ℝ d _ _ from hy₀) have hx₂ : ContDiffAt ℝ d (Y Complex.imCLM ∘ increment 1) 0:=Complex.ofRealCLM.contDiff.contDiffAt.comp _ (show ContDiffAt ℝ d _ _ from hy₁) rw [h1]; exact hx₁.add (hx₂.const_smul Complex.I) let Z':= (θ!)*E.sail+ E.small have hN: Nonwrapping Yp 0:= hb₀ ▸ (RG05_shells hm hP hp hc hb hV H z h! b₀).1 have hS: Local.Chart d F0 1:= ((show (B₁).Regular Yp (F0) from hF).smooth 1 (one_healthy Yp _ (B₁).threshold_pos.le)).of_le (Nat.cast_le.mpr hD.order) have hLX:‖v0‖= ((L).val:ℝ)^d :=by simp let g:=Push.Local.sample (hol G) (0:Site n₀) Yp t0 W p have hg:Local.IdentityTest (hol G) (0:Site n₀) Yp B₁ F0 (W ∘ increment 1) p (gaugeMeter d* (‖v0‖ *(Z'+Z'))):= by apply Cub.speedTest _ _ p hS (show Local.Chart d W _ from ((show ContDiffAt ℝ (↑d) (U ∘ increment 1) (0:Directions G n₀) from hx).const_smul v0)) intro l hl hv; unfold W; rw [h1]; exact Cub.cleared hf hf' hy₀ hy₁ _ _ _ hl _ (hz₁ l hl hv) (hz₂ l hl hv) have he: ‖Push.Local.sample (hol G) 0 Yp t0 (F0) p-g‖ ≤ Push.Local.partPrice (hol G) p*(gaugeMeter d* (‖v0‖ *(Z'+Z'))):=by unfold g; rw [← score (f:=W)]; exact Local.compareSample hF hD.order hD.power hg let y':= Local.runProbe F p (f.leads L (Place.copy F i)) have h: ‖g - y'‖ ≤ E.small:=by have hP:(X).patch.L=L :=PriceCompiler.block_eq A.B.valid m have hs: 2*Heir.reach y < (n₀).val:=by have h:100*(radiusB y+1) ≤ (n₀).val:=A.B.a.fits.sizeT m n; unfold Heir.reach; omega have hr: HEq (p').R.A0 (Carrier.linesOf P M.p.kernel.penalty):=by change HEq (Carrier.linesOf P A.B.a.clock.kernel.penalty) (Carrier.linesOf P _); rw [A.B.valid.kernel] have hz := E.paths p hpX i hpX' n₀ n₁ X b₀ hb₀ p' P rfl hP hr _ _ hu hs hi hj let c:= ((B₁).threshold); let K':= (hol G).testLinks d (0:Site n₀) (c • p.1) have ht: g=((L).val:ℝ)^d • iteratedDeriv p.2.val (U∘ K') 0:=by unfold g Local.sample; rw [if_pos hN,show (W ∘ _)= (((L).val:ℝ)^d) • (U ∘ K') from (by funext x; unfold W; simp only [Pi.smul_apply,Function.comp_apply,Complex.real_smul,Complex.ofReal_pow,Complex.ofReal_natCast]; rfl), iteratedDeriv_const_smul] let t:= testLog (hol G) d (0:Site n₀) (c • p.1) have hv := ((increment_testLog (hol G) d (0:Site n₀) (c • p.1)).fun_comp U) have hp: t 0=0:=testLog_zero .. exact ContDiffAt.congr_of_eventuallyEq (ContDiffAt.comp 0 (hp.symm ▸ ((show ContDiffAt ℝ (↑d) (U ∘ increment 1) 0 from hx).of_le (Nat.cast_le.mpr (Nat.le_of_lt_succ p.2.isLt))) : ContDiffAt ℝ (↑p.2.val) (U ∘ increment 1) (t 0)) (f:=t) ((testLog_diff ..).of_le le_top)) hv rw [ht]; change ‖((L).val:ℝ)^d • iteratedDeriv p.2.val ((ocean p' (Local.presented S! b₀ ((K z).p.threshold) (Place.copy F i)) y) ∘ K') 0 - y'‖ ≤ _; rw [hB]; exact hz rw [map_sub,← Local.sample_eq F _ _ t0 (show (B₁).Regular Yp F0 from hF) hD.order p]; refine (norm_sub_le_norm_sub_add_norm_sub _ g _).trans ((add_le_add he h).trans ?_); rw [hLX,← two_mul Z']; exact E.law p hpX end YM.PhysicalNext.Repeat.Cub