Planar scattering definitions and support in Shuffle
DefinitionMarkovScatteringPlanar_Shufflemarkov-scattering
Defines the recursive shuffle weight and the corresponding products of reciprocal successive denominators.
Definition code
import Lean.Elab.Tactic.Omega
import Mathlib.Algebra.Field.Basic
/-!
# The two-sequence shuffle identity
This is Lemma 2.1 in `proofs/tree-theorem.md`. The two coordinates count the entries
used from the two sequences. Each interleaving is a lattice path with unit steps.
Grouping paths by their last step gives the recursion for their total weight.
-/
namespace MarkovScattering
variable {K : Type*} [Field K]
/-- The sum of the weights of all paths from `(0, 0)` to `(p, q)`, computed by
partitioning at the last step. Entering `(a, b)` contributes `(x a + y b)⁻¹`.
The origin counts the empty path with weight one. -/
def shuffleWeight (x y : ℕ → K) : ℕ → ℕ → K
| 0, 0 => 1
| a + 1, 0 => shuffleWeight x y a 0 / (x (a + 1) + y 0)
| 0, b + 1 => shuffleWeight x y 0 b / (x 0 + y (b + 1))
| a + 1, b + 1 =>
(shuffleWeight x y a (b + 1) + shuffleWeight x y (a + 1) b) /
(x (a + 1) + y (b + 1))
termination_by a b => a + b
decreasing_by all_goals omega
/-- The product of the reciprocals of `x 1, …, x n`. -/
def prefixProduct (x : ℕ → K) : ℕ → K
| 0 => 1
| n + 1 => prefixProduct x n * (x (n + 1))⁻¹
/-- On the vertical axis there is a single path. -/
theorem shuffleWeight_zero_left (x y : ℕ → K) (q : ℕ) (hx : x 0 = 0) :
shuffleWeight x y 0 q = prefixProduct y q := by
induction q with
| zero => simp [shuffleWeight, prefixProduct]
| succ q ih => simp [shuffleWeight, ih, hx, div_eq_mul_inv, prefixProduct]
/-- On the horizontal axis there is a single path. -/
theorem shuffleWeight_zero_right (x y : ℕ → K) (p : ℕ) (hy : y 0 = 0) :
shuffleWeight x y p 0 = prefixProduct x p := by
induction p with
| zero => simp [shuffleWeight, prefixProduct]
| succ p ih => simp [shuffleWeight, ih, hy, div_eq_mul_inv, prefixProduct]
end MarkovScattering
Source