| .empty => []
| .neighbor r _ => [r+1,r]
| .repeated m k =>List.replicate m k
| .twosOdd m x _ =>List.replicate m 2 ++ [x]
| .twoPaths q _ => [q+2,q] ++ List.replicate 21
| .threeRows m s _ _ =>ThreeRow.columns m s
| .join p q => p.columns ++ q.columns
| .empty,_ =>True
| .neighbor r ps,d =>0 < r ∧ r+1≤ d ∧ ps.sum = 2*r+1∧ ps.length ≤4
| .repeated m k,d =>0 < m ∧0 < k ∧ k ≤ d
| .twosOdd m x ps,d =>1≤ m ∧Odd x ∧ x ≤2*m ∧2≤ d ∧ x ≤ d ∧
ps.sum = 2*m+x ∧ ps.length ≤2
| .twoPaths q ps,d =>3≤ q ∧ q+2≤ d ∧ ps.sum = 2*q+4∧ ps.length ≤4
| .threeRows m s ps cs,d =>3≤ d ∧UniversalTensorSquare.ThreeRowMask m s ps cs
| .join p q,d => p.Valid d ∧ q.Valid d ∧Disjoint p.marks q.marks
theoremrealize (p : PackingPlan) {d : ℕ} (h : p.Valid d)
(A : Fin (d*d) →Prop) (label : Fin (d*d) →ℕ)
(he : ∀ e ∈ p.bands, ∀ z, (A z ∧ label z = e.1) ↔ output z ∈Set.Icc e.1 e.2) :
Nonempty (WordPacking p.columns p.parts d A label p.marks) :=by
proof · 40
lines
induction p with
| empty => simpa [columns,parts,marks,bands,bandStarts] usingNonempty.intro (WordPacking.empty d A label)
| neighbor r ps =>
rcases h with ⟨hr,hd,hs,hl⟩
simpa [columns,parts,marks,bands,bandStarts] usingWordPacking.neighbor hr hd hs hl r A label (he (r,r+1) (by simp [bands]))
| repeated m k =>
rcases h with ⟨hm,hk,hd⟩
havehei : ∀ z, (A z ∧ label z = k) ↔ output z = k :=by
intro z
rw [he (k,k) (by simp [bands]) z]
simp only [Set.mem_Icc]; omega
simpa [columns,parts,marks,bands,bandStarts] usingWordPacking.repeated hm hk hd k A label hei
| twosOdd m x ps =>
rcases h with ⟨hm,hx,hxc,hd,hd',hs,hl⟩
havehne : 2≠ x :=by intro heq; rw [← heq] at hx; norm_num at hx
havehei : ∀ k, (k,k) ∈ (PackingPlan.twosOdd m x ps).bands →∀ z, (A z ∧ label z = k) ↔ output z = k :=by
intro k hk z
rw [he (k,k) hk z]
simp only [Set.mem_Icc]; omega
simpa [columns,parts,marks,bands,bandStarts] usingWordPacking.twosOdd hm hx hxc hd hd' hs hl
2 x hne A label (hei 2 (by simp [bands])) (hei x (by simp [bands]))
| twoPaths q ps =>
rcases h with ⟨hq,hd,hs,hl⟩
havehe1 : ∀ z, (A z ∧ label z = 1) ↔ output z = 1:=by
intro z
rw [he (1,1) (by simp [bands]) z]
simp only [Set.mem_Icc]; omega
simpa [columns,parts,marks,bands,bandStarts] usingWordPacking.twoPaths hq hd hs hl
q 1 (by omega) A label (he (q,2*q+3) (by simp [bands])) he1
| threeRows m s ps cs =>
simpa [columns,parts,marks,bands,bandStarts] usingWordPacking.threeRows h.1 h.2A label (he (1,3) (by simp [bands]))
| join p q ip iq =>
obtain ⟨P⟩ := ip h.1 (by intro e he' z; exact he e (List.mem_append_left _ he') z)
obtain ⟨Q⟩ := iq h.2.1 (by intro e he' z; exact he e (List.mem_append_right _ he') z)
simpa only [columns,parts,marks,bands,bandStarts,List.map_append,List.toFinset_append] usingNonempty.intro (P.join Q h.2.2)
theorempackingPlan_pos {n d : ℕ} (p : PackingPlan) {lam μ : YoungDiagram}
(hv : p.Valid d) (hb : BandsValid p.bands) (hheight : lam.colLen 0 = d)
(hc : p.columns.Perm lam.transpose.rowLens) (hp : ∀ x ∈ p.parts, 0 < x)
(a : Tableau n lam) (t : Tableau n μ)
(hd : Dominates μ (columnShape p.parts).transpose) : 0 < kronecker a a t :=by
proof · 11
lines
obtain ⟨e,hr,hc'⟩ := place_columns lam hc
havehn : p.columns.sum = n :=by
simpa only [Fintype.card_fin] usingFintype.card_congr (((enumerate p.columns).trans e).trans a.symm)
subst n
letB:= numericBands p.bands hb
obtain ⟨P⟩ := p.realize hv (B.alphabet d) (B.letterLabel d)
(fun e he z => numericBands_iff hb he z)
rw [← hheight] at Plet a' := (enumerate p.columns).trans e
exact kronecker_pos_of_shapes rfl rfl rfl a' a' t a a t
(P.kronecker_pos a' t (standard_placed_self e hr hc') hp (B.letter_ordered _) hd)