Exact Lean source
YoungRSKTableauReverse
formalization/Cloning/YoungRSKTableauReverse.lean
Source hash: 10b1cc823dcb5dbd15b4f53e9e69ae6d1dced4720681d7d63754071ca08fa84a
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.YoungGeneral.tableauReversedefinition Cloning.YoungGeneral.tableauRemovabletheorem Cloning.YoungGeneral.tableauReverse_lengththeorem Cloning.YoungGeneral.tableauReverse_corner_lttheorem Cloning.YoungGeneral.tableauReverse_head_prefixtheorem Cloning.YoungGeneral.rowInterlaces_mass_letheorem Cloning.YoungGeneral.rowLast_exists_of_masstheorem Cloning.YoungGeneral.rowRemove_strictPrefixtheorem Cloning.YoungGeneral.rowStrictPrefix_eq_mass_of_lasttheorem Cloning.YoungGeneral.rowRemoveLast_interlacestheorem Cloning.YoungGeneral.tableauReverse_after_inserttheorem Cloning.YoungGeneral.tableauReverse_after_insert_fixedtheorem Cloning.YoungGeneral.tableauInsert_after_reversetheorem Cloning.YoungGeneral.tableauReverse_exists_pairwisetheorem Cloning.YoungGeneral.tableauReverse_pairwisetheorem Cloning.YoungGeneral.tableauReverse_shapetheorem Cloning.YoungGeneral.tableauReverse_content1import Cloning.YoungRSKReverse
2import Cloning.YoungRSKTableau
3
4/-! Recursive reverse deletion on a supplied corner, retaining the fixed
5number of count rows used by the finite content-array model. -/
6
7noncomputable section
8open scoped BigOperators Classical
9namespace Cloning.YoungGeneral
10
11noncomputable def tableauReverse {d : ℕ} : List (RowContent d) → ℕ → Option (List (RowContent d) × Fin d)
12 | [], _ => none
13 | U :: T, 0 =>
14 match rowLast U with
15 | none => none
16 | some x => some (rowDeleteLast U :: T, x)
17 | U :: T, r + 1 =>
18 match tableauReverse T r with
19 | none => none
20 | some (S, y) =>
21 match rowReverseBump U y with
22 | none => none
23 | some x => some (rowReversed U y :: S, x)
24
25noncomputable def tableauRemovable {d : ℕ} : List (RowContent d) → ℕ → Prop
26 | [], _ => False
27 | U :: T, 0 => 0 < ∑ j, U j ∧ ∀ V ∈ T.head?, (∑ j, V j) < ∑ j, U j
28 | _ :: T, r + 1 => tableauRemovable T r
29
30theorem tableauReverse_length {d : ℕ} (T S : List (RowContent d)) (r : ℕ) (x : Fin d)
31 (h : tableauReverse T r = some (S, x)) : S.length = T.length := by
32 induction T generalizing S r x with
33 | nil => simp [tableauReverse] at h
34 | cons U T ih =>
35 cases r with
36 | zero =>
37 cases hb : rowLast U with
38 | none => simp [tableauReverse, hb] at h
39 | some b =>
40 simp only [tableauReverse, hb, Option.some.injEq, Prod.mk.injEq] at h
41 obtain ⟨rfl, rfl⟩ := h
42 rfl
43 | succ r =>
44 cases ht : tableauReverse T r with
45 | none => simp [tableauReverse, ht] at h
46 | some P =>
47 obtain ⟨R, b⟩ := P
48 cases hb : rowReverseBump U b with
49 | none => simp [tableauReverse, ht, hb] at h
50 | some a =>
51 simp only [tableauReverse, ht, hb, Option.some.injEq, Prod.mk.injEq] at h
52 obtain ⟨rfl, rfl⟩ := h
53 simpa only [List.length_cons] using congrArg Nat.succ (ih R r b ht)
54
55theorem tableauReverse_corner_lt {d : ℕ} (T S : List (RowContent d)) (r : ℕ) (x : Fin d)
56 (h : tableauReverse T r = some (S, x)) : r < T.length := by
57 induction T generalizing S r x with
58 | nil => simp [tableauReverse] at h
59 | cons U T ih =>
60 cases r with
61 | zero => simp
62 | succ r =>
63 cases ht : tableauReverse T r with
64 | none => simp [tableauReverse, ht] at h
65 | some P =>
66 obtain ⟨R, b⟩ := P
67 exact Nat.succ_lt_succ (ih R r b ht)
68
69/-- A successful reverse path decreases every prefix of its top row and
70removes one occurrence at the recovered letter. -/
71theorem tableauReverse_head_prefix {d : ℕ} (U : RowContent d)
72 (T S : List (RowContent d)) (r : ℕ) (x : Fin d)
73 (h : tableauReverse (U :: T) r = some (S, x)) :
74 ∃ W R, S = W :: R ∧ 0 < U x ∧
75 (∀ k, rowPrefix W k ≤ rowPrefix U k) ∧
76 rowPrefix W x + 1 = rowPrefix U x := by
77 cases r with
78 | zero =>
79 cases hb : rowLast U with
80 | none => simp [tableauReverse, hb] at h
81 | some b =>
82 simp only [tableauReverse, hb, Option.some.injEq, Prod.mk.injEq] at h
83 obtain ⟨rfl, rfl⟩ := h
84 have hbpos := ((rowLast_eq_some_iff U b).mp hb).1
85 refine ⟨rowDeleteLast U, T, rfl, hbpos, ?_, ?_⟩
86 · intro k
87 have he := rowRemove_prefix U b k hbpos
88 simp only [rowDeleteLast, hb]
89 omega
90 · simpa only [rowDeleteLast, hb, le_refl, if_true] using rowRemove_prefix U b b hbpos
91 | succ r =>
92 cases ht : tableauReverse T r with
93 | none => simp [tableauReverse, ht] at h
94 | some P =>
95 obtain ⟨R, b⟩ := P
96 cases hb : rowReverseBump U b with
97 | none => simp [tableauReverse, ht, hb] at h
98 | some a =>
99 simp only [tableauReverse, ht, hb, Option.some.injEq, Prod.mk.injEq] at h
100 obtain ⟨rfl, rfl⟩ := h
101 obtain ⟨hab, hapos, _⟩ := (rowReverseBump_eq_some_iff U b a).mp hb
102 refine ⟨rowReversed U b, R, rfl, hapos, ?_, ?_⟩
103 · intro k
104 have he := rowReversed_prefix U b a k hb
105 omega
106 · simpa only [le_refl, hab, and_self, if_true] using rowReversed_prefix U b a a hb
107
108theorem rowInterlaces_mass_le {d : ℕ} (U V : RowContent d)
109 (hUV : ∀ k, rowPrefix V k ≤ rowStrictPrefix U k) :
110 (∑ j, V j) ≤ ∑ j, U j := by
111 cases d with
112 | zero => simp
113 | succ d =>
114 have h := hUV (Fin.last d)
115 have hv : rowPrefix V (Fin.last d) = ∑ j, V j := by
116 simp [rowPrefix, Fin.le_last]
117 rw [hv] at h
118 exact h.trans (Finset.sum_le_sum_of_subset (Finset.filter_subset _ _))
119
120theorem rowLast_exists_of_mass {d : ℕ} (U : RowContent d) (hU : 0 < ∑ j, U j) :
121 ∃ x, rowLast U = some x := by
122 obtain ⟨x, _, hx⟩ := Finset.sum_pos_iff.mp hU
123 have hs : (Finset.univ.filter (fun y => 0 < U y)).Nonempty := ⟨x, by simp [hx]⟩
124 exact ⟨_, by rw [rowLast, dif_pos hs]⟩
125
126theorem rowRemove_strictPrefix {d : ℕ} (A : RowContent d) (x k : Fin d) (hx : 0 < A x) :
127 rowStrictPrefix (rowRemove A x) k + (if x < k then 1 else 0) =
128 rowStrictPrefix A k := by
129 have he := Finset.sum_congr (s₁ := Finset.univ.filter (fun j => j < k)) rfl
130 (fun j _ => rowRemove_content A x j hx)
131 simpa only [rowStrictPrefix, Finset.sum_add_distrib, Finset.sum_ite_eq',
132 Finset.mem_filter, Finset.mem_univ, true_and] using he
133
134theorem rowStrictPrefix_eq_mass_of_last {d : ℕ} (U : RowContent d) (b k : Fin d)
135 (hb : rowLast U = some b) (hbk : b < k) : rowStrictPrefix U k = ∑ j, U j := by
136 apply Finset.sum_subset (Finset.filter_subset _ _)
137 intro j _ hj
138 simp only [Finset.mem_filter, Finset.mem_univ, true_and, not_lt] at hj
139 by_contra hjzero
140 have hmax := ((rowLast_eq_some_iff U b).mp hb).2 j (Nat.pos_of_ne_zero hjzero)
141 exact (not_le_of_gt hbk) (hj.trans hmax)
142
143/-- Removing the final entry at an outer corner preserves its inequalities
144with every shorter lower row. -/
145theorem rowRemoveLast_interlaces {d : ℕ} (U V : RowContent d) (b : Fin d)
146 (hUV : ∀ k, rowPrefix V k ≤ rowStrictPrefix U k)
147 (hmass : (∑ j, V j) < ∑ j, U j) (hb : rowLast U = some b) :
148 ∀ k, rowPrefix V k ≤ rowStrictPrefix (rowDeleteLast U) k := by
149 have hbpos := ((rowLast_eq_some_iff U b).mp hb).1
150 intro k
151 simp only [rowDeleteLast, hb]
152 have he := rowRemove_strictPrefix U b k hbpos
153 by_cases hbk : b < k
154 · rw [if_pos hbk, rowStrictPrefix_eq_mass_of_last U b k hb hbk] at he
155 have hbound : rowPrefix V k ≤ ∑ j, V j :=
156 Finset.sum_le_sum_of_subset (Finset.filter_subset _ _)
157 omega
158 · rw [if_neg hbk, add_zero] at he
159 rw [he]
160 exact hUV k
161
162/-- Reversing the recorded corner exactly recovers insertion's input whenever
163insertion stays within the supplied fixed list of rows. -/
164theorem tableauReverse_after_insert {d : ℕ} (T : List (RowContent d)) (x : Fin d)
165 (hcorner : (tableauInsert T x).2 < T.length) :
166 tableauReverse (tableauInsert T x).1 (tableauInsert T x).2 = some (T, x) := by
167 induction T generalizing x with
168 | nil => simp [tableauInsert] at hcorner
169 | cons U T ih =>
170 cases hb : rowBump U x with
171 | none =>
172 simp only [tableauInsert, hb, tableauReverse,
173 rowLast_after_terminal_insert U x hb, rowDeleteLast_after_terminal_insert U x hb]
174 | some y =>
175 have ht : (tableauInsert T y).2 < T.length := by
176 simpa only [tableauInsert, hb, List.length_cons, Nat.add_lt_add_iff_right] using hcorner
177 simp only [tableauInsert, hb, tableauReverse, ih y ht,
178 rowReverseBump_after_insert U x y hb, rowReversed_after_insert U x y hb]
179
180theorem tableauReverse_after_insert_fixed {d : ℕ} (T : List (RowContent d)) (x : Fin d)
181 (hT : T.length = d) :
182 tableauReverse (tableauInsert T x).1 (tableauInsert T x).2 = some (T, x) := by
183 apply tableauReverse_after_insert
184 have h := tableauInsert_corner_lt T x
185 rw [tableauInsert_fixed_length T x hT] at h
186 omega
187
188/-- Every successful reverse deletion is recovered by actual insertion. -/
189theorem tableauInsert_after_reverse {d : ℕ} (T S : List (RowContent d)) (r : ℕ) (x : Fin d)
190 (h : tableauReverse T r = some (S, x)) : tableauInsert S x = (T, r) := by
191 induction T generalizing S r x with
192 | nil => simp [tableauReverse] at h
193 | cons U T ih =>
194 cases r with
195 | zero =>
196 cases hb : rowLast U with
197 | none => simp [tableauReverse, hb] at h
198 | some b =>
199 simp only [tableauReverse, hb, Option.some.injEq, Prod.mk.injEq] at h
200 obtain ⟨rfl, rfl⟩ := h
201 simp only [tableauInsert, rowBump_after_deleteLast U b hb,
202 rowInserted_after_deleteLast U b hb]
203 | succ r =>
204 cases ht : tableauReverse T r with
205 | none => simp [tableauReverse, ht] at h
206 | some P =>
207 obtain ⟨R, b⟩ := P
208 cases hb : rowReverseBump U b with
209 | none => simp [tableauReverse, ht, hb] at h
210 | some a =>
211 simp only [tableauReverse, ht, hb, Option.some.injEq, Prod.mk.injEq] at h
212 obtain ⟨rfl, rfl⟩ := h
213 simp only [tableauInsert, rowBump_after_reverse U b a hb,
214 rowInserted_after_reverse U b a hb, ih R r b ht]
215
216/-- A genuine removable corner admits reverse deletion, and all strict
217column inequalities are preserved throughout the reverse path. -/
218theorem tableauReverse_exists_pairwise {d : ℕ} (T : List (RowContent d))
219 (hT : List.Pairwise RowInterlaces T) (r : ℕ) (hr : tableauRemovable T r) :
220 ∃ S x, tableauReverse T r = some (S, x) ∧ List.Pairwise RowInterlaces S := by
221 induction T generalizing r with
222 | nil => simp [tableauRemovable] at hr
223 | cons U T ih =>
224 obtain ⟨hU, hT⟩ := List.pairwise_cons.mp hT
225 cases r with
226 | zero =>
227 obtain ⟨hUpos, hnext⟩ := hr
228 obtain ⟨b, hb⟩ := rowLast_exists_of_mass U hUpos
229 refine ⟨rowDeleteLast U :: T, b, by simp [tableauReverse, hb], ?_⟩
230 apply List.pairwise_cons.mpr
231 refine ⟨?_, hT⟩
232 intro V hV
233 have hmass : (∑ j, V j) < ∑ j, U j := by
234 cases T with
235 | nil => simp at hV
236 | cons W R =>
237 have hWU := hnext W (by simp)
238 rcases List.mem_cons.mp hV with rfl | hVR
239 · exact hWU
240 · exact (rowInterlaces_mass_le W V ((List.pairwise_cons.mp hT).1 V hVR)).trans_lt hWU
241 exact rowRemoveLast_interlaces U V b (hU V hV) hmass hb
242 | succ r =>
243 cases T with
244 | nil => simp [tableauRemovable] at hr
245 | cons V R =>
246 obtain ⟨S, b, hS, hSpair⟩ := ih hT r hr
247 obtain ⟨W, R', heq, hbpos, hprefix, hdrop⟩ :=
248 tableauReverse_head_prefix V R S r b hS
249 obtain ⟨a, ha⟩ := rowReverseBump_exists_of_prefix U V b
250 (hU V List.mem_cons_self) hbpos
251 refine ⟨rowReversed U b :: S, a, by simp [tableauReverse, hS, ha], ?_⟩
252 rw [heq] at hSpair ⊢
253 apply pairwise_interlaces_cons _ hSpair
254 exact rowReversed_interlaces_of_prefix U V W b a
255 (hU V List.mem_cons_self) hbpos ha hprefix hdrop.le
256
257theorem tableauReverse_pairwise {d : ℕ} (T S : List (RowContent d))
258 (hT : List.Pairwise RowInterlaces T) (r : ℕ) (hr : tableauRemovable T r) (x : Fin d)
259 (h : tableauReverse T r = some (S, x)) : List.Pairwise RowInterlaces S := by
260 obtain ⟨S', x', h', hp⟩ := tableauReverse_exists_pairwise T hT r hr
261 have he := Option.some.inj (h.symm.trans h')
262 have heS := congrArg Prod.fst he
263 change S = S' at heS
264 rwa [heS]
265
266theorem tableauReverse_shape {d : ℕ} (T S : List (RowContent d)) (r : ℕ) (x : Fin d)
267 (h : tableauReverse T r = some (S, x)) :
268 shapeAdd (tableauShape S) r = tableauShape T := by
269 have he := tableauInsert_shape S x
270 rw [tableauInsert_after_reverse T S r x h] at he
271 exact he.symm
272
273theorem tableauReverse_content {d : ℕ} (T S : List (RowContent d)) (r : ℕ) (x j : Fin d)
274 (h : tableauReverse T r = some (S, x)) :
275 tableauContent T j = tableauContent S j + (if j = x then 1 else 0) := by
276 have he := tableauInsert_content S x j
277 rw [tableauInsert_after_reverse T S r x h] at he
278 exact he
279
280end Cloning.YoungGeneral