{
  "id": "7977",
  "ident": "NS.07977",
  "slug": "wikipedia-hadamard",
  "title": "Hadamard's conjecture",
  "status": "open",
  "statement_status": "reviewed",
  "statement_md": "There exists a Hadamard matrix for all $n = 4k$.",
  "subjects": [
    "math.RA",
    "msc:15"
  ],
  "tags": [],
  "collection": "wikipedia",
  "source_url": null,
  "solved_on_platform": false,
  "needs_answer": false,
  "version": 1,
  "decl_name": "Hadamard.HadamardConjecture",
  "statement_lean": "theorem HadamardConjecture (k : ℕ) : ∃ M, IsHadamard (n := 4 * k) M",
  "challenge_source": "/-\nCopyright 2025 The Formal Conjectures Authors.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    https://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n-/\nmodule\n\npublic import FormalConjecturesUtil\n\n/-!\n# Hadamard's conjecture\n\n*References:*\n - [Wikipedia](https://en.wikipedia.org/wiki/Hadamard_matrix#Hadamard_conjecture)\n - [Tao's optimization constant 23a](https://teorth.github.io/optimizationproblems/constants/23a.html)\n - [Résolution d'une question relative aux déterminants](https://gallica.bnf.fr/ark:/12148/bpt6k486252g/f400.image.r) by *Jacques Hadamard*,  Bull. des sciences math., p.245, 1893\n-/\n\n@[expose] public section\n\nnamespace Hadamard\n\n/--\nA square matrix $M$ with $±1$-entries that satisfies the equality $|M| ≤ n^\\frac{n}{2}$ is called a *Hadamard matrix*.\n-/\ndef IsHadamard {n : ℕ} (M : Matrix (Fin n) (Fin n) ℝ) : Prop :=\n    (∀ (i j : Fin n), M i j ∈ ({1, -1} : Finset ℝ)) ∧\n    |M.det| = n ^ ((n : ℝ) / 2)\n\n/--\nEquivalently, a square matrix $M$ with $±1$-entries $|A| ≤ n^\\frac{n}{2}.$ if it satisfies the equality\n$M^TM = n \\cdot 1$, where $1$ denotes the unit matrix.\n-/\ndef IsHadamard' {n : ℕ} (M : Matrix (Fin n) (Fin n) ℝ) : Prop :=\n    (∀ (i j : Fin n), M i j ∈ ({1, -1} : Finset ℝ)) ∧\n    M.transpose * M = ↑n\n\n/--\nBoth definitions are equivalent.\n\nTODO(firsching): complete and golf the proof\n-/\n@[category test, AMS 15]\ntheorem isHadamard_equiv_isHadamard' (n : ℕ) (M : Matrix (Fin n) (Fin n) ℝ) : IsHadamard' M ↔ IsHadamard M := by\n  simp [IsHadamard, IsHadamard']\n  intro h\n  let N := M.transpose * M\n  constructor\n  · intro h\n    have h_det : (M.transpose * M).det = n^((n : ℝ)) := by\n      have : Matrix.diagonal (fun x : Fin n => (n : ℝ)) = (n : Matrix (Fin n) (Fin n) ℝ) := by\n        rfl\n      rw [h, ← this]\n      norm_num\n    simp only [Matrix.det_mul, Matrix.det_transpose] at h_det\n    rw [← Real.sqrt_mul_self_eq_abs M.det, h_det]\n    have : √(↑n ^ (n : ℝ)) = (↑n ^ (n : ℝ)) ^ ((1 : ℝ)/2) := by\n      rw [Real.rpow_div_two_eq_sqrt]\n      · simp only [Real.rpow_natCast, Real.rpow_one]\n      · simp only [Real.rpow_natCast, Nat.cast_nonneg, pow_nonneg]\n    rw [this]\n    simp\n    refine ((fun {x y z} hx hy hz ↦ (Real.eq_rpow_inv hx hy hz).mpr) ?_ ?_ ?_ ?_).symm\n    · exact Real.rpow_nonneg (Nat.cast_nonneg' n) _\n    · simp only [Nat.cast_nonneg, pow_nonneg]\n    · norm_num\n    · rw [← Real.rpow_mul <| Nat.cast_nonneg' n]\n      norm_num\n  · sorry\n\n/- Note: the conjecture was originally formulated by\nHadamard as a question: \"For which values of $n=4k$ does\na Hadamard matrix exist.\" However the expectation seems\nto be that all such matrices are Hadamard, and the\nformalisation has been written with this in mind. -/\n\n/--\nThere exists a Hadamard matrix for all $n = 4k$.\n-/\n@[category research open, AMS 15]\ntheorem HadamardConjecture (k : ℕ) : ∃ M, IsHadamard (n := 4 * k) M := by\n  sorry\n\n/--\nThe **smallest unsolved order** of the Hadamard conjecture: the smallest $n = 4k$ such that there\nis no Hadamard matrix of order $n$, or $\\infty$ if there is none.\n-/\n@[optimization_constant \"23a\"]\nnoncomputable def hadamardConstant : ℕ∞ :=\n  ⨅ (k : ℕ) (_ : ¬ ∃ M, IsHadamard (n := 4 * k) M), (4 * k : ℕ∞)\n\n@[category test, AMS 15]\ntheorem exists_hadamard_zero : ∃ M, IsHadamard (n := 0) M := by\n  use 0\n  simp [IsHadamard]\n\n/--\nHadamard constructs a 12 x 12 matrix ...\n-/\ndef H12 : Matrix (Fin 12) (Fin 12) ℝ :=\n!![  1,  1,  1,   1,  1,  1,   1,  1,  1,   1,  1,  1;\n     1,  1,  1,  -1, -1, -1,  -1, -1, -1,   1,  1,  1;\n     1,  1,  1,  -1, -1, -1,   1,  1,  1,  -1, -1, -1;\n     1, -1, -1,   1, -1, -1,  -1,  1,  1,  -1,  1,  1;\n     1, -1, -1,  -1,  1, -1,   1, -1,  1,   1, -1,  1;\n     1, -1, -1,  -1, -1,  1,   1,  1, -1,   1,  1, -1;\n     1, -1,  1,  -1,  1,  1,  -1,  1, -1,  -1, -1,  1;\n     1, -1,  1,   1, -1,  1,  -1, -1,  1,   1, -1, -1;\n     1, -1,  1,   1,  1, -1,   1, -1, -1,  -1,  1, -1;\n     1,  1, -1,  -1,  1,  1,  -1, -1,  1,  -1,  1, -1;\n     1,  1, -1,   1, -1,  1,   1, -1, -1,  -1, -1,  1;\n     1,  1, -1,   1,  1, -1,  -1,  1, -1,   1, -1, -1 ]\n/--\nwhich satisfies the condition.\n-/\n@[category test, AMS 15]\ntheorem isHadamard_H12 : IsHadamard H12 := by\n  have h : H12.transpose * H12 = (12 : ℝ) • 1 := by\n    rw [← Matrix.ext_iff]\n    norm_num +decide [Fin.forall_fin_succ, Matrix.mul_apply, Fin.sum_univ_succ, H12,\n      Matrix.one_apply]\n  have hd : H12.det ^ 2 = 12 ^ 12 := by simpa [Matrix.det_smul, ← sq] using congrArg Matrix.det h\n  refine ⟨by simp [Fin.forall_fin_succ, H12], ?_⟩\n  rw [← Real.sqrt_sq_eq_abs, hd]\n  norm_num\n\n/--\nFor all $k ≤ 166$, it is known there that there is a Hadamard matrix of size $4 * k$.\nSo `hadamardConstant` is at least $668$.\n-/\n@[category research solved, AMS 15]\ntheorem HadamardConjecture.variants.first_cases : 668 ≤ hadamardConstant := by\n  sorry\n\n/--\nThe smallest order for which no Hadamard matrix is presently known is $668 = 4 * 167$.\nIs `hadamardConstant` larger than $668$?\n-/\n@[category research open, AMS 15]\ntheorem HadamardConjecture.variants.«167» : 668 < hadamardConstant := by\n  sorry\n\nend Hadamard\n",
  "statement_hash": "df7b3441d2851787788a77ab597974cf7f744700f669762be995a0cb3ae1afe4",
  "toolchain": "leanprover/lean4:v4.33.1",
  "upstream_commit": "f9b3868d5ca994a7bf95039bcec05338c0c21e2f",
  "workspace": "formal-conjectures",
  "field": "math",
  "formalization": "formal",
  "verification": "lean-kernel",
  "license": "Apache-2.0",
  "attribution": "google-deepmind/formal-conjectures contributors",
  "metric_name": null,
  "metric_direction": null,
  "critiques": [],
  "public_partial_proofs": [],
  "research_threads": [],
  "instructions": "Read research_threads first: other people's public repositories and what they already tried. Write Solution.lean starting from challenge_source. Keep every definition identical, prove decl_name with exactly the same type, no sorry in its dependency closure, no new axioms, no native_decide, no metaprogramming. Submit with POST /api/v1/submissions."
}