Offline · exact source
Exact Lean source

YoungTwoRowMoment

formalization/Cloning/YoungTwoRowMoment.lean

Source hash: d217af68b3df9ded7304a0159e0d671d6723343844835e7e392a8adda7d8eb7c

Full source copied without mathematical changes from the snapshot whose input hash matches the passing audit. Select a line number for a stable source pointer.

The declarations belong to the compiled inventory covered by the project’s shared axiom audit. That audit records an aggregate union, without attributing axioms to individual declarations.

Declarations in this module
definition Cloning.YoungTwoRow.Pathdefinition Cloning.YoungTwoRow.stepSpindefinition Cloning.YoungTwoRow.stepProbabilitydefinition Cloning.YoungTwoRow.spindefinition Cloning.YoungTwoRow.weightdefinition Cloning.YoungTwoRow.legaldefinition Cloning.YoungTwoRow.upperRowdefinition Cloning.YoungTwoRow.lowerRowdefinition Cloning.YoungTwoRow.spinCasimirdefinition Cloning.YoungTwoRow.expectationtheorem Cloning.YoungTwoRow.stepProbability_nonnegtheorem Cloning.YoungTwoRow.stepProbability_sumtheorem Cloning.YoungTwoRow.step_spinCasimirtheorem Cloning.YoungTwoRow.weight_nonnegtheorem Cloning.YoungTwoRow.expectation_succtheorem Cloning.YoungTwoRow.expectation_onetheorem Cloning.YoungTwoRow.weight_sumtheorem Cloning.YoungTwoRow.expectation_spinCasimirtheorem Cloning.YoungTwoRow.row_sumtheorem Cloning.YoungTwoRow.spin_add_lower_eq_uppertheorem Cloning.YoungTwoRow.lowerRow_le_upperRowtheorem Cloning.YoungTwoRow.weight_formulatheorem Cloning.YoungTwoRow.weight_eq_zero_of_not_legaldefinition Cloning.YoungTwoRow.rowVariancetheorem Cloning.YoungTwoRow.rowVariance_eq_half_spin_sqtheorem Cloning.YoungTwoRow.centered_second_moment_ledefinition Cloning.YoungTwoRow.rowCasimirtheorem Cloning.YoungTwoRow.rowCasimir_eqtheorem Cloning.YoungTwoRow.expectation_rowCasimirtheorem Cloning.YoungTwoRow.spin_le_lengthdefinition Cloning.YoungTwoRow.tableauPathCountdefinition Cloning.YoungTwoRow.shapeProbabilitytheorem Cloning.YoungTwoRow.shapeProbability_formulatheorem Cloning.YoungTwoRow.shapeProbability_nonnegtheorem Cloning.YoungTwoRow.shape_expectationtheorem Cloning.YoungTwoRow.shapeProbability_sumtheorem Cloning.YoungTwoRow.dimension_count_identitytheorem Cloning.YoungTwoRow.shape_spinCasimir_momenttheorem Cloning.YoungTwoRow.upperRow_eq_of_legaltheorem Cloning.YoungTwoRow.lowerRow_eq_of_legaldefinition Cloning.YoungTwoRow.shapeVariancetheorem Cloning.YoungTwoRow.shape_centered_second_moment_le
1import Cloning.Projector
2import Mathlib.Data.Fintype.BigOperators
3import Lean.Elab.Tactic.Omega
4 
5/-!
6# A concrete two-row Young law and its exact Casimir moment
7 
8Paths add one box to either of two rows; a path is legal when the upper row
9never becomes shorter than the lower row. Each legal path has weight
10`(row gap + 1) / 2^N`. Thus the marginal of a fixed shape is its number of
11standard two-row tableau paths times its two-letter Schur dimension, divided
12by `2^N`. Normalization and the moment estimates are proved from the explicit
13branching probabilities, not assumed as distributional identities.
14 
15This combinatorial construction does not assert an identification with
16particular irreducible representation spaces.
17-/
18 
19noncomputable section
20open scoped BigOperators
21 
22namespace Cloning.YoungTwoRow
23 
24/-- Binary histories of length `N`, with the most recent choice at the end. -/
25noncomputable def Path : ℕ → Type
26  | 0 => Unit
27  | N + 1 => Path N × Bool
28 
29noncomputable instance pathFintype : (N : ℕ) → Fintype (Path N)
30  | 0 => inferInstanceAs (Fintype Unit)
31  | N + 1 =>
32    letI := pathFintype N
33    inferInstanceAs (Fintype (Path N × Bool))
34 
35def stepSpin (s : ℕ) (b : Bool) : ℕ := if b then s + 1 else s - 1
36 
37/-- The exact dimension-ratio branching probabilities for two rows. -/
38def stepProbability (s : ℕ) (b : Bool) : ℝ :=
39  if b then ((s : ℝ) + 2) / (2 * ((s : ℝ) + 1))
40  else (s : ℝ) / (2 * ((s : ℝ) + 1))
41 
42noncomputable def spin : (N : ℕ) → Path N → ℕ
43  | 0, _ => 0
44  | N + 1, p => stepSpin (spin N p.1) p.2
45 
46noncomputable def weight : (N : ℕ) → Path N → ℝ
47  | 0, _ => 1
48  | N + 1, p => weight N p.1 * stepProbability (spin N p.1) p.2
49 
50noncomputable def legal : (N : ℕ) → Path N → Prop
51  | 0, _ => True
52  | N + 1, p => legal N p.1 ∧ (p.2 = true ∨ 0 < spin N p.1)
53 
54instance legalDecidable (N : ℕ) (p : Path N) : Decidable (legal N p) :=
55  Classical.propDecidable _
56 
57noncomputable def upperRow : (N : ℕ) → Path N → ℕ
58  | 0, _ => 0
59  | N + 1, p => upperRow N p.1 + if p.2 then 1 else 0
60 
61noncomputable def lowerRow : (N : ℕ) → Path N → ℕ
62  | 0, _ => 0
63  | N + 1, p => lowerRow N p.1 + if p.2 then 0 else 1
64 
65def spinCasimir (s : ℕ) : ℝ := (s : ℝ) * ((s : ℝ) + 2)
66 
67def expectation (N : ℕ) (f : ℕ → ℝ) : ℝ :=
68  ∑ p : Path N, weight N p * f (spin N p)
69 
70theorem stepProbability_nonneg (s : ℕ) (b : Bool) : 0 ≤ stepProbability s b := by
71  cases b <;> dsimp [stepProbability] <;> positivity
72 
73theorem stepProbability_sum (s : ℕ) : (∑ b : Bool, stepProbability s b) = 1 := by
74  simp only [Fintype.sum_bool, stepProbability, Bool.false_eq_true, ↓reduceIte]
75  have hs : (s : ℝ) + 1 ≠ 0 := by positivity
76  field_simp
77  ring
78 
79theorem step_spinCasimir (s : ℕ) :
80    (∑ b : Bool, stepProbability s b * spinCasimir (stepSpin s b)) =
81      spinCasimir s + 3 := by
82  cases s with
83  | zero => norm_num [Fintype.sum_bool, stepProbability, stepSpin, spinCasimir]
84  | succ s =>
85    simp only [Fintype.sum_bool, stepProbability, stepSpin, spinCasimir,
86      Bool.false_eq_true, ↓reduceIte, Nat.add_sub_cancel, Nat.cast_add, Nat.cast_one]
87    have hs : (s : ℝ) + 1 + 1 ≠ 0 := by positivity
88    field_simp
89    ring
90 
91theorem weight_nonneg (N : ℕ) (p : Path N) : 0 ≤ weight N p := by
92  induction N with
93  | zero => exact zero_le_one
94  | succ N ih => exact mul_nonneg (ih p.1) (stepProbability_nonneg _ _)
95 
96/-- The elementary expectation recursion for this concrete finite law. -/
97theorem expectation_succ (N : ℕ) (f : ℕ → ℝ) :
98    expectation (N + 1) f = ∑ p : Path N, weight N p *
99      ∑ b : Bool, stepProbability (spin N p) b * f (stepSpin (spin N p) b) := by
100  change (∑ p : Path N × Bool, _) = _
101  rw [Fintype.sum_prod_type]
102  apply Finset.sum_congr rfl
103  intro p hp
104  rw [Finset.mul_sum]
105  apply Finset.sum_congr rfl
106  intro b hb
107  dsimp [weight, spin]
108  ring
109 
110theorem expectation_one (N : ℕ) : expectation N (fun _ => 1) = 1 := by
111  induction N with
112  | zero => simp [expectation, weight, Path]
113  | succ N ih =>
114    rw [expectation_succ]
115    simp only [mul_one, stepProbability_sum]
116    simpa only [expectation, mul_one] using ih
117 
118/-- Normalization is a theorem about the explicit finite weights. -/
119theorem weight_sum (N : ℕ) : (∑ p : Path N, weight N p) = 1 := by
120  simpa only [expectation, mul_one] using expectation_one N
121 
122/-- The exact rank-two quadratic Casimir moment, without a moment premise. -/
123theorem expectation_spinCasimir (N : ℕ) : expectation N spinCasimir = 3 * (N : ℝ) := by
124  induction N with
125  | zero => simp [expectation, weight, spin, spinCasimir, Path]
126  | succ N ih =>
127    rw [expectation_succ]
128    simp_rw [step_spinCasimir, mul_add, Finset.sum_add_distrib, ← Finset.sum_mul]
129    rw [weight_sum]
130    change expectation N spinCasimir + 1 * 3 = _
131    rw [ih, Nat.cast_add, Nat.cast_one]
132    ring
133 
134/-- The two row lengths contain exactly the number of boxes added. -/
135theorem row_sum (N : ℕ) (p : Path N) : upperRow N p + lowerRow N p = N := by
136  induction N with
137  | zero => rfl
138  | succ N ih =>
139    obtain ⟨p, b⟩ := p
140    have h := ih p
141    cases b <;> simp only [upperRow, lowerRow, Bool.false_eq_true, ↓reduceIte] <;> omega
142 
143/-- On legal tableaux the spin is exactly the ordered row gap. -/
144theorem spin_add_lower_eq_upper (N : ℕ) (p : Path N) (hp : legal N p) :
145    spin N p + lowerRow N p = upperRow N p := by
146  induction N with
147  | zero => rfl
148  | succ N ih =>
149    obtain ⟨p, b⟩ := p
150    have h := ih p hp.1
151    have hs := hp.2
152    cases b with
153    | false =>
154      have hs0 : 0 < spin N p := by simpa using hs
155      change (spin N p - 1) + (lowerRow N p + 1) = upperRow N p + 0
156      omega
157    | true =>
158      change (spin N p + 1) + (lowerRow N p + 0) = upperRow N p + 1
159      omega
160 
161theorem lowerRow_le_upperRow (N : ℕ) (p : Path N) (hp : legal N p) :
162    lowerRow N p ≤ upperRow N p := by
163  have := spin_add_lower_eq_upper N p hp
164  omega
165 
166/-- The actual branching weights telescope to the Schur path weight.
167Illegal histories have zero weight, including every attempted lower-row
168extension when the two row lengths are equal. -/
169theorem weight_formula (N : ℕ) (p : Path N) :
170    weight N p = if legal N p then ((spin N p : ℝ) + 1) / (2 : ℝ) ^ N else 0 := by
171  classical
172  induction N with
173  | zero => simp [weight, spin, legal]
174  | succ N ih =>
175    obtain ⟨p, b⟩ := p
176    by_cases hp : legal N p
177    · cases b with
178      | false =>
179        cases hs : spin N p with
180        | zero => simp [weight, ih p, hp, hs, stepProbability, legal]
181        | succ s =>
182          have hd : (s : ℝ) + 1 + 1 ≠ 0 := by positivity
183          simp only [weight, ih p, hp, hs, stepProbability, legal, spin, stepSpin,
184            Bool.false_eq_true, false_or, Nat.succ_pos, and_self, ↓reduceIte,
185            Nat.add_sub_cancel, Nat.cast_add, Nat.cast_one, pow_succ]
186          field_simp
187      | true =>
188        have hd : (spin N p : ℝ) + 1 ≠ 0 := by positivity
189        simp only [weight, ih p, hp, stepProbability, legal, spin, stepSpin,
190          true_or, and_self, ↓reduceIte, Nat.cast_add, Nat.cast_one, pow_succ]
191        field_simp
192        ring
193    · simp [weight, ih p, hp, legal]
194 
195theorem weight_eq_zero_of_not_legal (N : ℕ) (p : Path N) (hp : ¬ legal N p) :
196    weight N p = 0 := by rw [weight_formula]; simp [hp]
197 
198/-- The manuscript's Euclidean squared fluctuation of the actual two rows. -/
199def rowVariance (N : ℕ) (p : Path N) : ℝ :=
200  ((upperRow N p : ℝ) - (N : ℝ) / 2) ^ 2 +
201    ((lowerRow N p : ℝ) - (N : ℝ) / 2) ^ 2
202 
203theorem rowVariance_eq_half_spin_sq (N : ℕ) (p : Path N) (hp : legal N p) :
204    rowVariance N p = (spin N p : ℝ) ^ 2 / 2 := by
205  have hsum : (upperRow N p : ℝ) + (lowerRow N p : ℝ) = N :=
206    by exact_mod_cast row_sum N p
207  have hgap : (spin N p : ℝ) + (lowerRow N p : ℝ) = upperRow N p :=
208    by exact_mod_cast spin_add_lower_eq_upper N p hp
209  dsimp [rowVariance]
210  rw [← hsum, ← hgap]
211  ring
212 
213/-- A concrete centered second-moment bound, with the manuscript's exact
214rank-two constant `r − 1/r = 3/2`. No distribution or moment law is a premise. -/
215theorem centered_second_moment_le (N : ℕ) :
216    (∑ p : Path N, weight N p * rowVariance N p) ≤ 3 * (N : ℝ) / 2 := by
217  have hp (p : Path N) : weight N p * rowVariance N p ≤
218      weight N p * spinCasimir (spin N p) / 2 := by
219    by_cases hl : legal N p
220    · rw [rowVariance_eq_half_spin_sq N p hl]
221      have hs : 0 ≤ (spin N p : ℝ) := Nat.cast_nonneg _
222      have hw := weight_nonneg N p
223      dsimp [spinCasimir]
224      nlinarith [mul_nonneg hw hs]
225    · rw [weight_eq_zero_of_not_legal N p hl]
226      simp
227  calc
228    _ ≤ ∑ p : Path N, weight N p * spinCasimir (spin N p) / 2 :=
229      Finset.sum_le_sum (fun p _ => hp p)
230    _ = expectation N spinCasimir / 2 := by
231      simp only [expectation, div_eq_mul_inv, ← Finset.sum_mul]
232    _ = _ := by rw [expectation_spinCasimir]
233 
234/-- The exact two-row quadratic Casimir eigenvalue polynomial. -/
235def rowCasimir (N : ℕ) (p : Path N) : ℝ :=
236  (upperRow N p : ℝ) * ((upperRow N p : ℝ) + 1) +
237    (lowerRow N p : ℝ) * ((lowerRow N p : ℝ) - 1)
238 
239theorem rowCasimir_eq (N : ℕ) (p : Path N) (hp : legal N p) :
240    rowCasimir N p = (N : ℝ) ^ 2 / 2 + spinCasimir (spin N p) / 2 := by
241  have hsum : (upperRow N p : ℝ) + (lowerRow N p : ℝ) = N :=
242    by exact_mod_cast row_sum N p
243  have hgap : (spin N p : ℝ) + (lowerRow N p : ℝ) = upperRow N p :=
244    by exact_mod_cast spin_add_lower_eq_upper N p hp
245  dsimp [rowCasimir, spinCasimir]
246  rw [← hsum, ← hgap]
247  ring
248 
249/-- The concrete law has exactly the Casimir expectation used in the
250manuscript: `Nr + N(N−1)/r`, here with `r=2`. -/
251theorem expectation_rowCasimir (N : ℕ) :
252    (∑ p : Path N, weight N p * rowCasimir N p) =
253      (N : ℝ) * 2 + (N : ℝ) * ((N : ℝ) - 1) / 2 := by
254  have hp (p : Path N) : weight N p * rowCasimir N p =
255      weight N p * ((N : ℝ) ^ 2 / 2 + spinCasimir (spin N p) / 2) := by
256    by_cases hl : legal N p
257    · rw [rowCasimir_eq N p hl]
258    · rw [weight_eq_zero_of_not_legal N p hl]
259      simp
260  simp_rw [hp, mul_add, Finset.sum_add_distrib, ← Finset.sum_mul]
261  rw [weight_sum]
262  have hhalf : (∑ p : Path N, weight N p * (spinCasimir (spin N p) / 2)) =
263      expectation N spinCasimir / 2 := by
264    simp only [expectation, div_eq_mul_inv, ← mul_assoc, ← Finset.sum_mul]
265  rw [hhalf, expectation_spinCasimir]
266  ring
267 
268theorem spin_le_length (N : ℕ) (p : Path N) : spin N p ≤ N := by
269  induction N with
270  | zero => exact le_rfl
271  | succ N ih =>
272    obtain ⟨p, b⟩ := p
273    have h := ih p
274    cases b <;> simp only [spin, stepSpin, Bool.false_eq_true, ↓reduceIte] <;> omega
275 
276/-- The actual number of legal standard tableau paths ending at a given gap. -/
277def tableauPathCount (N s : ℕ) : ℕ :=
278  (Finset.univ.filter (fun p : Path N => legal N p ∧ spin N p = s)).card
279 
280/-- The shape marginal of the normalized finite path law. -/
281def shapeProbability (N s : ℕ) : ℝ :=
282  ∑ p : Path N, if spin N p = s then weight N p else 0
283 
284/-- The exact combinatorial Schur-weight formula: dimension `s+1` times
285the actual tableau-path multiplicity, divided by `2^N`. -/
286theorem shapeProbability_formula (N s : ℕ) :
287    shapeProbability N s = ((s : ℝ) + 1) * tableauPathCount N s / (2 : ℝ) ^ N := by
288  have hp (p : Path N) : (if spin N p = s then weight N p else 0) =
289      if legal N p ∧ spin N p = s then ((s : ℝ) + 1) / (2 : ℝ) ^ N else 0 := by
290    by_cases hs : spin N p = s <;> by_cases hl : legal N p <;>
291      simp [hs, hl, weight_formula]
292  unfold shapeProbability
293  simp_rw [hp]
294  rw [← Finset.sum_filter]
295  simp only [Finset.sum_const, nsmul_eq_mul, tableauPathCount]
296  ring
297 
298theorem shapeProbability_nonneg (N s : ℕ) : 0 ≤ shapeProbability N s := by
299  apply Finset.sum_nonneg
300  intro p hp
301  split_ifs
302  · exact weight_nonneg N p
303  · exact le_rfl
304 
305/-- Every expectation depending only on the shape agrees with its finite
306shape marginal. There is no measure-identification premise. -/
307theorem shape_expectation (N : ℕ) (f : ℕ → ℝ) :
308    (∑ s : Fin (N + 1), shapeProbability N s * f s) = expectation N f := by
309  classical
310  unfold shapeProbability expectation
311  simp_rw [Finset.sum_mul]
312  rw [Finset.sum_comm]
313  apply Finset.sum_congr rfl
314  intro p hp
315  let s : Fin (N + 1) := ⟨spin N p, Nat.lt_succ_of_le (spin_le_length N p)⟩
316  rw [Finset.sum_eq_single s]
317  · simp [s]
318  · intro b hb hbs
319    have hneq : spin N p ≠ b.val := by
320      intro heq
321      apply hbs
322      exact Fin.ext heq.symm
323    simp [hneq]
324  · simp
325 
326theorem shapeProbability_sum (N : ℕ) :
327    (∑ s : Fin (N + 1), shapeProbability N s) = 1 := by
328  have h := (shape_expectation N (fun _ => 1)).trans (expectation_one N)
329  simpa only [mul_one] using h
330 
331/-- The exact rank-two combinatorial dimension count, in natural numbers. -/
332theorem dimension_count_identity (N : ℕ) :
333    (∑ s : Fin (N + 1), (s.val + 1) * tableauPathCount N s) = 2 ^ N := by
334  have h : (∑ s : Fin (N + 1), ((s.val : ℝ) + 1) * tableauPathCount N s) /
335      (2 : ℝ) ^ N = 1 := by
336    rw [div_eq_mul_inv, Finset.sum_mul]
337    simpa only [shapeProbability_formula, div_eq_mul_inv] using shapeProbability_sum N
338  have hden : (2 : ℝ) ^ N ≠ 0 := pow_ne_zero _ (by norm_num)
339  have heq := (div_eq_one_iff_eq hden).mp h
340  exact_mod_cast heq
341 
342theorem shape_spinCasimir_moment (N : ℕ) :
343    (∑ s : Fin (N + 1), shapeProbability N s * spinCasimir s) = 3 * (N : ℝ) :=
344  (shape_expectation N spinCasimir).trans (expectation_spinCasimir N)
345 
346theorem upperRow_eq_of_legal (N : ℕ) (p : Path N) (hp : legal N p) :
347    upperRow N p = (N + spin N p) / 2 := by
348  have := row_sum N p
349  have := spin_add_lower_eq_upper N p hp
350  omega
351 
352theorem lowerRow_eq_of_legal (N : ℕ) (p : Path N) (hp : legal N p) :
353    lowerRow N p = (N - spin N p) / 2 := by
354  have := row_sum N p
355  have := spin_add_lower_eq_upper N p hp
356  omega
357 
358/-- The centered variance of the two integer row lengths of a shape. -/
359def shapeVariance (N s : ℕ) : ℝ :=
360  (((N + s) / 2 : ℕ) - (N : ℝ) / 2) ^ 2 +
361    (((N - s) / 2 : ℕ) - (N : ℝ) / 2) ^ 2
362 
363/-- The concrete shape law obeys the manuscript's second-moment estimate. -/
364theorem shape_centered_second_moment_le (N : ℕ) :
365    (∑ s : Fin (N + 1), shapeProbability N s * shapeVariance N s) ≤
366      3 * (N : ℝ) / 2 := by
367  rw [shape_expectation]
368  have heq : expectation N (shapeVariance N) =
369      ∑ p : Path N, weight N p * rowVariance N p := by
370    apply Finset.sum_congr rfl
371    intro p hp
372    by_cases hl : legal N p
373    · simp only [shapeVariance, rowVariance, upperRow_eq_of_legal N p hl,
374        lowerRow_eq_of_legal N p hl]
375    · rw [weight_eq_zero_of_not_legal N p hl]
376      simp
377  rw [heq]
378  exact centered_second_moment_le N
379 
380end Cloning.YoungTwoRow