import YM.Marker.Truncated /-! # Connected vs total moments in the commuting marker algebra Fix a finite family of slots. Use zero marker weights separately as quantum vacuum; `Expands C F` means simply `C` is the unique connected polynomial of `F` (F has constant coefficient one), by the finite exponential in this marker algebra. The identities here are before any integral/copy estimate. They honour the commuting square-zero convention even for higher arity. -/ set_option autoImplicit false noncomputable section namespace YM.Next.Rank.Exponential open Marker Finset open scoped BigOperators Pointwise variable {V : Type*} [DecidableEq V] {R : Census V} private def vanish (q : ℕ) (a : Poly R) := ∀ T : R.Mode,T.val.card < q → a.part T=0 private lemma vanish_add {p q : ℕ} {a b : Poly R} (hx : vanish p a) (hy : vanish q b) : vanish (p+q) (a*b) := by intro T ht; rw [Poly.part_mul] apply sum_eq_zero; intro i _; apply sum_eq_zero; intro j _ split_ifs with h · rcases h with ⟨h₁,h₂⟩ by_cases hi : i.val.card
False.elim (Nat.not_lt_zero _ hx)
private lemma vanish_one {a : Poly R} (ha : a.part R.quiet=0) : vanish 1 a := by
intro i hi; exact (show R.quiet=i from Subtype.ext (card_eq_zero.mp (show i.val.card=0 by omega)).symm) ▸ ha
private lemma vanish_pow {q} {a : Poly R} (h : vanish q a) : ∀ p : ℕ,vanish (q*p) (a^p)
| 0 => by rw [Nat.mul_zero]; exact vanish_zero _
| p+1 => by rw [Nat.mul_succ, pow_succ]; exact vanish_add (vanish_pow h p) h
@[simp] lemma part_sub (a b : Poly R) (i : R.Mode) : (a-b).part i=a.part i-b.part i := rfl
variable [Fintype V]
private def term (x : Poly R) (n : ℕ) := (n.factorial:ℂ)⁻¹ • x^n
lemma pass_extend {x : Poly R} (ht : x.part R.quiet=0) (n) (hn : Fintype.card V≤n) : Poly.pass x =
∑ i∈ Finset.range (n+1),(i.factorial:ℂ)⁻¹ • x^i := by
apply sum_subset (Finset.range_mono (show Fintype.card V+1≤n+1 by omega))
intro i _ hi; rw [Poly.stops x ht i (by simp at hi; exact hi),smul_zero]
@[simp] lemma pass_zero : Poly.pass (0:Poly R)=1 := by
unfold Poly.pass
rw [sum_eq_single 0]
· simp
· intro b _ h; rw [zero_pow h,smul_zero]
simp
theorem pass_add (x y : Poly R) (hx : x.part R.quiet=0) (hy : y.part R.quiet=0) :
Poly.pass (x+y) = Poly.pass x * Poly.pass y := by
let p := term x
let q := term y
have he (n : ℕ) : term (x+y) n = ∑ z ∈ Finset.antidiagonal n,p z.1 * q z.2 := by
unfold p q term
rw [(Commute.all x y).add_pow' n,Finset.smul_sum]
refine Finset.sum_congr rfl fun i hi => ?_
have hl := Finset.mem_antidiagonal.mp hi
rw [← Nat.cast_smul_eq_nsmul ℂ, smul_smul, smul_mul_smul_comm, ← hl, Nat.cast_add_choose, hl]
field_simp [n.factorial_ne_zero]
have h (i j : ℕ) (ht : Fintype.card V < i+j) : p i*q j=0 := by
have hr := vanish_add (vanish_pow (vanish_one hx) i) (vanish_pow (vanish_one hy) j)
unfold p q term
rw [smul_mul_smul_comm,show x^i*y^j=0 from ?_,smul_zero]
ext T; rw [Poly.part_nil,hr T (by simpa using lt_of_le_of_lt (card_le_univ _) ht)]
let A := Finset.range (Fintype.card V + 1)
let I := fun (x : ℕ × ℕ) => p x.1*q x.2
let B := A.biUnion Finset.antidiagonal
have hf : B ⊆ A ×ˢ A := by
refine Finset.biUnion_subset.mpr ?_
intro i hi z hz; unfold A at *; rw [Finset.mem_range] at hi;rw [Finset.mem_antidiagonal] at hz
exact Finset.mem_product.mpr ⟨mem_range.mpr (by omega),mem_range.mpr (by omega)⟩
have hv : (∑ i∈B,I i)=∑ i∈ A ×ˢ A,I i := by
refine sum_subset hf ?_
rintro ⟨i,j⟩ _ H
apply h
by_contra! hh; exact H (mem_biUnion.mpr ⟨i+j,mem_range.mpr (by omega),Finset.mem_antidiagonal.mpr rfl⟩)
have hg : (A:Set ℕ).PairwiseDisjoint Finset.antidiagonal := by
intro i _ j _ he; exact Finset.disjoint_left.mpr fun k hk he' => he (((Finset.mem_antidiagonal.mp hk).symm).trans (Finset.mem_antidiagonal.mp he'))
rw [show (∑ i∈B,I i) = ∑ j∈A, ∑ i ∈ Finset.antidiagonal j,I i from Finset.sum_biUnion hg, Finset.sum_product] at hv
change (∑ i∈A,term (x+y) i)=(∑ i∈A,p i)*(∑ i∈A,q i)
rw [sum_mul_sum]; simp_rw [he]; exact hv
lemma pass_neg (x : Poly R) (hx : x.part R.quiet=0) : Poly.pass (-x)*Poly.pass x=1 := by rw [← pass_add _ _ (by simp [hx]) hx, neg_add_cancel, pass_zero]
lemma pass_sum {W : Type*} (s : Finset W) (f : W → Poly R) (h : ∀ i∈s,(f i).part R.quiet=0) :
Poly.pass (∑ i∈s,f i)= ∏ i∈s,Poly.pass (f i) := by
classical
induction s using Finset.induction_on with
| empty => simp
| @insert i t hi ih =>
have he : ∀ i∈t,(f i).part R.quiet=0 := fun k hk => h k (by simp [hk])
rw [sum_insert hi, prod_insert hi, pass_add,ih he]; exact h i (mem_insert_self ..)
rw [Poly.part_sum]; exact sum_eq_zero he
-- For the logarithm we use the triangularity rather than formal differentiation.
private lemma pass_linear (x : Poly R) {m : ℕ} (hm : 0