import YM.MergeProof.Badlands import YM.MergeProof.North.Lichen import YM.MergeProof.South.Window import YM.Next.RANK.Compass import YM.MultipleContact.Bunch.Focal import YM.MultipleContact.Bunch.Dew import YM.MultipleContact.Bunch.Gush import YM.MultipleContact.Bunch.Sugary import YM.MultipleContact.Bunch.Stained import YM.MultipleContact.Bunch.Stator import YM.MultipleContact.Bunch.Fermi import YM.MultipleContact.Bunch.Corn import YM.MultipleContact.Bunch.Lyme import YM.MultipleContact.Bunch.Botan import YM.MultipleContact.Bunch.Junction import YM.MultipleContact.Bunch.Nigella import YM.MultipleContact.Bunch.Buoy import YM.MultipleContact.Bunch.Gild import YM.MultipleContact.Bunch.Farr import YM.MultipleContact.Bunch.Billow import YM.MultipleContact.Bunch.Blot import YM.MultipleContact.Bunch.Pond import YM.MultipleContact.Bunch.Shan import YM.MultipleContact.Bunch.SkyFall import YM.MultipleContact.Bunch.Quark import YM.MultipleContact.Bunch.Menu import YM.MultipleContact.Bunch.Wraith import YM.MultipleContact.Bunch.Thumb import YM.MultipleContact.Bunch.Apiary import YM.MultipleContact.Bunch.Aeolus import YM.MultipleContact.Bunch.Wiring import YM.MultipleContact.Bunch.Frost import YM.MultipleContact.Bunch.Arbor import YM.MultipleContact.Bunch.Platform import YM.MultipleContact.Bunch.Islands import YM.MultipleContact.Bunch.Quiet import YM.MultipleContact.Bunch.Price import YM.MultipleContact.Bunch.Antique import YM.MultipleContact.Bunch.Stable import YM.MultipleContact.Bunch.Belvedere import YM.MultipleContact.Bunch.Thunder import YM.MultipleContact.Bunch.Lichen /- generalized from YM.MergeProof.North.Flank to arbitrary arity -/ set_option autoImplicit false set_option linter.unusedSectionVars false noncomputable section namespace YM.MergeProof.BatchRibbons variable {slot:Type}[Fintype slot][DecidableEq slot][Inhabited slot] open Function Filter Set MeasureTheory Lattice Wilson RG Source Push Marker Extra.Histories Ac Bid Local open Planned.GuardedAtom Accent Menu Motion Extra.Multi Next.Rank Next.Rank.Spindle BatchRibbon open scoped Topology Matrix.Norms.Frobenius BigOperators Classical ContDiff section variable {V:Type}[Fintype V][DecidableEq V]{B:Census V}{G:Gauge} variable (C:Family G) (d : slot → ℕ)(N k p:ℕ) set_option quotPrecheck false local notation "H"=> C.path local notation "P"=> C.path.levels.budget local notation "B!"=> C.path.rep N p variable (W: Bid.Worth) (u ψ φ δ: ℕ→ℝ)(ζ:ℕ→ℕ→ℝ)(r:ℕ→ℕ) (D:∀ N p m:ℕ,m (Aged V slot) local notation "t"=> (fun i=>MergeProof.item C (d i) N p (s i) (fun j=>f j (v,i)) (q i)) local notation "Λ"=> (fun j:Name V slot=>δ k * (φ k * a j.2)) lemma upper (hh : Geyser C W u ψ φ δ ζ r D)(h:C.Makes) {μ:ℕ} (hr:Thor (slot:=slot) C.path δ r D σ χ μ)(hp:μ≤k)(he:∀ i,C.ref (d i) ≤ k)(hk:k hh.stay.water _ (Nat.zero_le i),fun i _=> hh.stay.mint _ (Nat.zero_le i),fun i _=> hh.stay.split _ (Nat.zero_le i),fun i _=> hh.stay.support _ (Nat.zero_le i)⟩ let w:= march a φ k; let W' (i)(j:Name V slot):= w i j.2 have hΔ(i):(march (fun j:Name V slot=> a j.2) φ k i)=W' i:=by induction i with | zero=>rfl | succ i IH=> unfold W' w march; split · rename_i he; funext j; change φ i*(march (fun j:Name V slot=> a j.2) φ k i _) =_; rw [IH] exact rfl have h': Matchup C.path r δ p N k f W' κ:= (funext hΔ) ▸ (desal C.path r k p N δ φ f (fun j=> a j.2) (fun i=>hw _) hF κ hx hz hh.mom hm) have ht:w (k+1)=fun j=>φ k*a j:=by unfold w; rw [march,if_pos le_rfl,marines _ _ _ hw] suffices hK:∀ j:slot,∃ U:∀ m:ℕ,Config G (C.side m p)→ℂ,∃ L:∀ m:ℕ,ℕ → Config G (C.side m p)→ℂ,Stately H u k N p (fun m=>f m (v,j)) (fun m=>w m j) U L (F (v,j)) D by have hY:= tidal C.path u δ r D E f M v w β F h.wilson hh.night h' hP hV σ χ hr hp hi (S:=gust C.path N p N (birth κ (B! N) F)) (fun i _ he=> gust_step C.path N p N _ he) (gust_base ..) (fun i _ hn=> gust_live C.path _ _ _ _ hX hn) hk hK hT; simp only [ht] at hY; exact hY intro j obtain ⟨T,hI,hS,hK,hY⟩:= (hh.aim (d j) N p ((he j).trans hk.le)).lyrics obtain ⟨b,hQ,hL,hB,hb,hH⟩:= hh.heights (d j) k N p (he j) hk.le let Y:= (C.factory (d j) N p).terminal.symm (s j) have hp(m):parcel C (d j) m N p (s j)=(T.tone m).plays Y:=by unfold parcel; rw [hI];rfl have hZ: Sung (C.localSection (d j)) H N p C.params W k T:= ⟨hS.head,hk.le,fun j' hi=> hS.earned _ ((he j).trans hi),fun j' hi=> hS.step _ ((he j).trans hi)⟩ let i:Name V slot:= (v,j); have hu(m:ℕ)(he:k ≤ m)(hn:m≤N):0f m (v,j)) (fun m=>w m j) D h.wilson (h.sections (d j)) hZ hu ?_ ?_ hQ hB hb hH ?_ (hY _) ?_; obtain ⟨g,hg,_⟩:= hf exact ⟨_,g,hg⟩ · intro i h hp; rw [hU i h]; exact mul_le_of_le_one_left (hu i h hp.le|>.le) (hL.level i h) · apply cost_chain H C.params (C.localSection (d j)) W (ζ (d j)) k N p T Y (fun m=>w m j) le_rfl (fun i h hp=> (hu i h hp).le) hk.le (fun i h hi=>?_) (fun i h hp=> hu i h hp.le) hh.cost hh.back hZ hM' rw [hU i h]; exact le_trans (le_of_eq (b:=φ i* (((C.S.block i).val:ℝ)^(d j) * (C.path.levels.params (i+1)).columns)*ζ (d j) i*w i j) (by ring)) (mul_le_mul_of_nonneg_right (hL.cost i h) ((hu i h hi.le).le)) · intro i hy hm; exact congr_fun (hx.mare i hy hm).symm _ intro i h hp; obtain ⟨hF,-⟩:= hr.moon N p i (by omega) hp; exact ⟨hK i ((he j).trans h) hp,hF.propagate⟩ end end YM.MergeProof.BatchRibbons