theoremWordPacking.shortBlock {m τ d : ℕ} (hm : 1≤ m) (hτm : τ ≠0→2≤ m) (hd : 3≤ d)
(A : Fin (d*d) →Prop) (label : Fin (d*d) →ℕ)
(he2 : ∀ z, (A z ∧ label z = 2) ↔ output z = 2)
(he3 : τ ≠0→∀ z, (A z ∧ label z = 3) ↔ output z = 3) :
Nonempty (WordPacking (shortColumns m τ) (shortParts m τ) d A label (shortMarks τ)) :=by
proof · 10
lines
by_cases hτ : τ = 0
· obtain ⟨P⟩ :=WordPacking.repeated (m := m) (k :=2) (by omega) (by decide)
(by omega) 2A label he2
simpa only [shortColumns,shortParts,shortMarks,oneIf,ite_eq_left hτ,List.append_nil,
Nat.mul_comm m 2] usingNonempty.intro P
· have hm2 := hτm hτ
obtain ⟨P⟩ :=WordPacking.twosOdd (m := m) (x :=3) (by omega) (by decide)
(by omega) (by omega) hd (balancedParts_sum (2*m+3) 2 (by decide)) (by simp)
23 (by decide) A label he2 (he3 hτ)
simpa only [shortColumns,shortParts,shortMarks,oneIf,ite_eq_right hτ] usingNonempty.intro P
lemmamem_shortMarks {τ k : ℕ} (hk : k ∈ shortMarks τ) : k = 2∨ (τ ≠0∧ k = 3) :=by
proof · 9
lines
unfold shortMarks at hk
split_ifs at hk with hτ
· simp only [Finset.mem_singleton] at hk
exact Or.inl hk
· simpa only [Finset.mem_insert,Finset.mem_singleton,hτ,true_and] using
(show k = 2∨ (τ ≠0∧ k = 3) from
(by rcases Finset.mem_insert.mp hk with h | h
· exact Or.inl h
· exact Or.inr ⟨hτ, Finset.mem_singleton.mp h⟩))