Download lean/OAI/RepresentationTheory/UniversalSquare/Balance/WordPackingGeometry.lean from roseking/openAI-math-dataset: direct link, hf CLI and curl.
theoremWordPacking.neighbor {r d : ℕ} (hr : 0 < r) (hd : r+1≤ d)
{ps : Listℕ} (hsum : ps.sum = 2*r+1) (hlen : ps.length ≤4)
(k : ℕ) (A : Fin (d*d) →Prop) (label : Fin (d*d) →ℕ)
(he : ∀ a, (A a ∧ label a = k) ↔ output a ∈Set.Icc r (r+1)) :
Nonempty (WordPacking [r+1,r] ps d A label {k}) :=by
proof · 13
lines
havehrow : (ShortColumns.shape r 1).rowLens = [r+1,r] :=YoungDiagram.rowLens_ofRowLens_eq_self (by simp; omega)
havehD : (ShortColumns.shape r 1).transpose.colLen 0≤ d :=by
rw [YoungDiagram.colLen_transpose]
have hh :=YoungDiagram.rowLen_ofRowLens (hw :=by apply List.Pairwise.sortedGE; simp)
(showFin [r+1,r].length from ⟨0,by simp⟩)
change (ShortColumns.shape r 1).rowLen 0 = r+1 at hh
rw [hh]
exact hd
apply WordPacking.of_bounded_shape (μ := (ShortColumns.shape r 1).transpose)
(by rw [YoungDiagram.transpose_transpose,hrow]) hD (by simp; omega) hlen k _ A label he
intro t
exact neighboring_word_support (by simp; omega) t
lemmarepeated_column_length {m k n : ℕ} (hk : 0 < k)
(t : Tableau n (YoungDiagram.ofRowLens (List.replicate m k) (replicate_sorted m k)).transpose)
(i : Fin n) : (columnLengthWord t i).val+1 = k :=by
proof · 9
lines
have hm :=YoungDiagram.mem_transpose.mp (t i).property
obtain ⟨hj,hi⟩ :=YoungDiagram.mem_ofRowLens.mp hm
have he :=YoungDiagram.rowLen_ofRowLens (hw := replicate_sorted m k)
(showFin (List.replicate m k).length from ⟨(t i).val.2,hj⟩)
simp only [Fin.getElem_fin, List.getElem_replicate] at he
change (YoungDiagram.ofRowLens (List.replicate m k) (replicate_sorted m k)).transpose.colLen
(t i).val.2 - 1 + 1 = k
rw [YoungDiagram.colLen_transpose,he]
omega
theoremWordPacking.repeated {m k d : ℕ} (hm : 0 < m) (hk : 0 < k) (hd : k ≤ d)
(j : ℕ) (A : Fin (d*d) →Prop) (label : Fin (d*d) →ℕ)
(he : ∀ a, (A a ∧ label a = j) ↔ output a = k) :
Nonempty (WordPacking (List.replicate m k) [m*k] d A label {j}) :=by
proof · 18
lines
let μ := (YoungDiagram.ofRowLens (List.replicate m k) (replicate_sorted m k)).transpose
havehrow : μ.transpose.rowLens = List.replicate m k :=by
rw [YoungDiagram.transpose_transpose]
apply YoungDiagram.rowLens_ofRowLens_eq_self
intro x hx
rw [(List.mem_replicate.mp hx).2]
exact hk
havehD : μ.colLen 0≤ d :=by
rw [YoungDiagram.colLen_transpose]
have hh :=YoungDiagram.rowLen_ofRowLens (hw := replicate_sorted m k)
(showFin (List.replicate m k).length from ⟨0,by simpa⟩)
simp only [Fin.getElem_fin, List.getElem_replicate] at hh
rw [hh]
exact hd
apply WordPacking.of_bounded_shape (μ := μ) (E:=1) (by rw [hrow]) hD
(by simp) (by simp) j {k} A label he
intro t
exact constant_output_support t k (repeated_column_length hk t)