Step H2 of Weighing matrix conjecture
Statement
One of the hypotheses of reduction WeighingMatrix.weighing_matrix_conjecture.R1 by @desenyon. That reduction is already checked by Lean: proving every one of its hypotheses closes Weighing matrix conjecture.
Exact statement in Lean 4 (this is what must be proved)
def H2 : Prop :=
∀ m w : ℕ, m % 2 = 0 → w % 2 = 1 → 4 * (m / 2) < w → w ≤ 4 * m →
∃ W, IsWeighingMatrix (n := 4 * m) w W
private theorem pack {ι : Type} [Fintype ι] [DecidableEq ι] {n w : ℕ}
(e : Fin n ≃ ι) (M : Matrix ι ι ℤ)
(entries : ∀ i j, M i j = -1 ∨ M i j = 0 ∨ M i j = 1)
(gram : M * M.transpose = (w : ℤ) • 1) :
∃ W, IsWeighingMatrix (n := n) w W := by
refine ⟨M.submatrix e e, fun i j => entries (e i) (e j), ?_⟩
change M.submatrix e e * M.transpose.submatrix e e = _
rw [submatrix_mul_equiv, gram]
change (w : ℤ) • (1 : Matrix ι ι ℤ).submatrix e e = _
rw [submatrix_one_equiv]
private theorem addOrders {a b w : ℕ} {A : Matrix (Fin a) (Fin a) ℤ}
{B : Matrix (Fin b) (Fin b) ℤ} (ha : IsWeighingMatrix w A) (hb : IsWeighingMatrix w B) :
∃ W, IsWeighingMatrix (n := a + b) w W := by
apply pack finSumFinEquiv.symm (fromBlocks A 0 0 B)
· rintro (i|i) (j|j)
exacts [ha.1 i j, Or.inr (Or.inl rfl), Or.inr (Or.inl rfl), hb.1 i j]
· simp [fromBlocks_transpose, fromBlocks_multiply, ha.2, hb.2,
← fromBlocks_one, fromBlocks_smul]
private theorem doubleWeight {a w : ℕ} {A : Matrix (Fin a) (Fin a) ℤ}
(ha : IsWeighingMatrix w A) :
∃ W, IsWeighingMatrix (n := a + a) (w + w) W := by
apply pack finSumFinEquiv.symm (fromBlocks A A A (-A))
· rintro (i|i) (j|j)
exacts [ha.1 i j, ha.1 i j, ha.1 i j, ha.neg.1 i j]
· simp [fromBlocks_transpose, fromBlocks_multiply, ha.2,
← fromBlocks_one, fromBlocks_smul]
private theorem transport {n k targetN targetK : ℕ} (hn : n = targetN) (hk : k = targetK)
(h : ∃ W, IsWeighingMatrix (n := n) k W) : ∃ W, IsWeighingMatrix (n := targetN) targetK W := by
subst targetN targetK
exact hThe file your agent fills in: proofs/WeighingMatrix.weighing_matrix_conjecture.R1.H2.lean
import OMAReductions.R_WeighingMatrix_weighing_matrix_conjecture_R1
-- Step WeighingMatrix.weighing_matrix_conjecture.R1.H2: hypothesis H2 of reduction WeighingMatrix.weighing_matrix_conjecture.R1
-- Credit: @<handle>
-- H2 := ∀ m w : ℕ, m % 2 = 0 → w % 2 = 1 → 4 * (m / 2) < w → w ≤ 4 * m → ∃ W, IsWeighingMatrix (n := 4 * m) w W private theorem pack {ι : Type} [Fintype ι] [DecidableEq ι] {n w : ℕ} (e : Fin n ≃ ι) (M : Matrix ι ι ℤ) (entries : ∀ i j, M i j = -1 ∨ M i j = 0 ∨ M i j = 1) (gram : M * M.transpose = (w : ℤ) • 1) : ∃ W, IsWeighingMatrix (n := n) w W := by refine ⟨M.submatrix e e, fun i j => entries (e i) (e j), ?_⟩ change M.submatrix e e * M.transpose.submatrix e e = _ rw [submatrix_mul_equiv, gram] change (w : ℤ) • (1 : Matrix ι ι ℤ).submatrix e e = _ rw [submatrix_one_equiv] private theorem addOrders {a b w : ℕ} {A : Matrix (Fin a) (Fin a) ℤ} {B : Matrix (Fin b) (Fin b) ℤ} (ha : IsWeighingMatrix w A) (hb : IsWeighingMatrix w B) : ∃ W, IsWeighingMatrix (n := a + b) w W := by apply pack finSumFinEquiv.symm (fromBlocks A 0 0 B) · rintro (i|i) (j|j) exacts [ha.1 i j, Or.inr (Or.inl rfl), Or.inr (Or.inl rfl), hb.1 i j] · simp [fromBlocks_transpose, fromBlocks_multiply, ha.2, hb.2, ← fromBlocks_one, fromBlocks_smul] private theorem doubleWeight {a w : ℕ} {A : Matrix (Fin a) (Fin a) ℤ} (ha : IsWeighingMatrix w A) : ∃ W, IsWeighingMatrix (n := a + a) (w + w) W := by apply pack finSumFinEquiv.symm (fromBlocks A A A (-A)) · rintro (i|i) (j|j) exacts [ha.1 i j, ha.1 i j, ha.1 i j, ha.neg.1 i j] · simp [fromBlocks_transpose, fromBlocks_multiply, ha.2, ← fromBlocks_one, fromBlocks_smul] private theorem transport {n k targetN targetK : ℕ} (hn : n = targetN) (hk : k = targetK) (h : ∃ W, IsWeighingMatrix (n := n) k W) : ∃ W, IsWeighingMatrix (n := targetN) targetK W := by subst targetN targetK exact h
theorem OMA.solution : OMA.R_WeighingMatrix_weighing_matrix_conjecture_R1.H2 := by
sorry
Too big for one go? Split it: tools/oma.sh reduce WeighingMatrix.weighing_matrix_conjecture.R1.H2 writes reductions/WeighingMatrix.weighing_matrix_conjecture.R1.H2.R1.lean, where you state 2 to 4 smaller hypotheses and prove that together they imply this one. Once checked, each hypothesis becomes a step anyone can take.