AFTD Auto-Formalizing Theoretical Domains

op_2178_order_two_ternary_det_sq_attained

theoremverifiedformalization

There exists a 2 by 2 matrix M with entries in the complex third roots of unity whose squared determinant Complex.normSq M.det equals 3.

Statement

theorem op_2178_order_two_ternary_det_sq_attained :
    ∃ (M : Matrix (Fin 2) (Fin 2) ℂ),
      (∀ i j, ∃ u : rootsOfUnity 3 ℂ, ((u : ℂˣ) : ℂ) = M i j) ∧
      Complex.normSq M.det = 3
Formalizes
arXiv:2611.27591: Determinantal upper bounds for ternary matrices, Table 1
Verified
23 Nov 2026
Axioms
Classical.choiceQuot.soundpropext

Read back from the Lean

There exists a $2 \times 2$ matrix $M$ with complex entries such that: 1. Every entry $M_{i,j}$ of $M$ (for all $i, j \in \{0, 1\}$) is a third root of unity in $\mathbb{C}$ (i.e., there exists $u \in \text{rootsOfUnity } 3\ \mathbb{C}$ equal to $M_{i,j}$), and 2. The squared complex absolute value of the determinant of $M$ equals 3 (i.e., $\operatorname{normSq}(\det(M)) = 3$).

Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.

The proof, explained

The theorem is proved constructively by exhibiting the matrix $M = \begin{pmatrix} 1 & 1 \\ \omega & 1 \end{pmatrix}$, where $\omega = \frac{-1 + \sqrt{3}I}{2}$ is a primitive third root of unity. After showing $\omega^3 = 1$ by algebraic expansion, each entry of $M$ is verified to be a third root of unity by exhaustive case analysis on the indices. The determinant $\det M = 1 - \omega$ is then computed, and its squared complex norm is shown to equal $(3/2)^2 + (-\sqrt{3}/2)^2 = 3$.

  1. Define the primitive third root of unity $\omega = \frac{-1 + \sqrt{3}I}{2}$, setting $s = \sqrt{3} \in \mathbb{C}$ and establishing $s^2 = 3$ and $I^2 = -1$.

    We introduce $\omega$ as $\frac{-1 + \sqrt{3}I}{2}$ and define the shorthand $s = \sqrt{3} \in \mathbb{C}$. We prove $s^2 = 3$ by rewriting the complex square to a real square via `ofReal_pow` and simplifying $(\sqrt{3})^2 = 3$ with `Real.sq_sqrt`. The identity $I^2 = -1$ is recorded directly via `I_sq`.

    lines 6–13

    uses ofReal_pow, Real.sq_sqrt, I_sq

      open Matrix Complex in
      let ω : ℂ := (-1 + (Real.sqrt 3 : ℂ) * I) / 2
      have h3 : (Real.sqrt 3 : ℂ) ^ 2 = 3 := by
        rw [← ofReal_pow, Real.sq_sqrt (by norm_num)]
        push_cast
        rfl
      have hI : I ^ 2 = -1 := I_sq
      set s := (Real.sqrt 3 : ℂ)
  2. $\omega^3 = 1$.

    We first verify $(-1 + sI)^3 = 8$ using an algebraic polynomial identity combined with $s^2 = 3$ and $I^2 = -1$. Cubing $\omega = \frac{-1 + sI}{2}$ gives $\frac{(-1 + sI)^3}{8} = \frac{8}{8} = 1$.

    lines 14–22

      have h_cube : (-1 + s * I) ^ 3 = 8 := by
        have h_id : (-1 + s * I) ^ 3 - 8 = (s * I - 3) * (s ^ 2 * (I ^ 2 + 1) - (s ^ 2 - 3)) := by ring
        linear_combination h_id + (s * I - 3) * s ^ 2 * hI - (s * I - 3) * h3
      have ω_pow_three : ω ^ 3 = 1 := by
        calc
          ω ^ 3 = ((-1 + s * I) / 2) ^ 3 := rfl
          _ = (-1 + s * I) ^ 3 / 8 := by ring
          _ = 8 / 8 := by rw [h_cube]
          _ = 1 := by norm_num
  3. $1$ and $\omega$ are realized as elements $u_1, u_\omega$ of the subgroup of third roots of unity $\mu_3(\mathbb{C})$.

    We define $u_1 = 1 \in \mu_3(\mathbb{C})$, which coerces to $1 \in \mathbb{C}$ by definition. Using $\omega^3 = 1$, we construct $u_\omega \in \mu_3(\mathbb{C})$ via `rootsOfUnity.mkOfPowEq`, and verify that its coercion back to $\mathbb{C}$ equals $\omega$ via `rootsOfUnity.coe_mkOfPowEq`.

    lines 23–27

    uses rootsOfUnity.mkOfPowEq, rootsOfUnity.coe_mkOfPowEq

      let u_one : rootsOfUnity 3 ℂ := 1
      let u_ω : rootsOfUnity 3 ℂ := rootsOfUnity.mkOfPowEq ω ω_pow_three
      have hu_one : (((u_one : ℂˣ) : ℂ)) = 1 := rfl
      have hu_ω : (((u_ω : ℂˣ) : ℂ)) = ω :=
        rootsOfUnity.coe_mkOfPowEq ω_pow_three
  4. It suffices to show that the matrix $M = \begin{pmatrix} 1 & 1 \\ \omega & 1 \end{pmatrix}$ has entries in $\mu_3(\mathbb{C})$ and that $|\det M|^2 = 3$.

    We supply the explicit candidate matrix $M = \begin{pmatrix} 1 & 1 \\ \omega & 1 \end{pmatrix}$ to instantiate the existential goal, and split the resulting conjunction into two goals.

    lines 28–29

      use !![1, 1; ω, 1]
      constructor
  5. Every entry of $M$ is a complex third root of unity.

    We check all four index pairs $(i, j) \in \{0, 1\} \times \{0, 1\}$ by case analysis. The entry $M_{1, 0} = \omega$ is witnessed by $u_\omega$, while the other three entries $M_{0, 0} = M_{0, 1} = M_{1, 1} = 1$ are witnessed by $u_1$.

    lines 30–35

      · intro i j
        fin_cases i <;> fin_cases j
        · exact ⟨u_one, hu_one⟩
        · exact ⟨u_one, hu_one⟩
        · exact ⟨u_ω, hu_ω⟩
        · exact ⟨u_one, hu_one⟩
  6. The determinant of $M$ is $1 - \omega$, so it suffices to show $\operatorname{normSq}(1 - \omega) = 3$.

    Applying the $2 \times 2$ determinant formula `det_fin_two_of`, we evaluate $\det M = 1 \cdot 1 - 1 \cdot \omega = 1 - \omega$ and substitute this into the squared-norm condition.

    lines 36–39

    uses det_fin_two_of

      · have hdet : (!![1, (1 : ℂ); ω, 1]).det = 1 - ω := by
          rw [det_fin_two_of]
          ring
        rw [hdet]
  7. $\operatorname{Re}(1 - \omega) = \frac{3}{2}$ and $\operatorname{Im}(1 - \omega) = -\frac{\sqrt{3}}{2}$.

    Unfolding the definition $\omega = \frac{-1 + \sqrt{3}I}{2}$, we compute $1 - \omega = 1 - \left(-\frac{1}{2} + \frac{\sqrt{3}}{2}I\right) = \frac{3}{2} - \frac{\sqrt{3}}{2}I$. Taking real and imaginary parts confirms $\operatorname{Re}(1 - \omega) = \frac{3}{2}$ and $\operatorname{Im}(1 - \omega) = -\frac{\sqrt{3}}{2}$.

    lines 40–47

        have hre : (1 - ω).re = 3 / 2 := by
          dsimp [ω]
          simp
          ring
        have him : (1 - ω).im = - Real.sqrt 3 / 2 := by
          dsimp [ω]
          simp
          ring
  8. $\operatorname{normSq}(M.\det) = 3$, completing the proof.

    Using `normSq_apply`, the squared norm is $\operatorname{Re}(1-\omega)^2 + \operatorname{Im}(1-\omega)^2 = (3/2)^2 + (-\sqrt{3}/2)^2 = 9/4 + (\sqrt{3})^2/4$. Combining this with $(\sqrt{3})^2 = 3$ from `Real.sq_sqrt`, non-linear arithmetic verifies that $9/4 + 3/4 = 3$.

    lines 48–50

    uses normSq_apply, Real.sq_sqrt

        rw [normSq_apply, hre, him]
        have hs3 : (Real.sqrt 3) ^ 2 = 3 := Real.sq_sqrt (by norm_num)
        nlinarith
ofReal_pow
The coercion of a real power $r^n$ to $\mathbb{C}$ equals the coercion of $r$ raised to the $n$-th power.
Real.sq_sqrt
For any non-negative real number $x$, the square of its square root is $x$, i.e., $(\sqrt{x})^2 = x$.
I_sq
The square of the imaginary unit $I$ is $-1$.
rootsOfUnity.mkOfPowEq
Given an element $\zeta$ satisfying $\zeta^n = 1$, constructs the corresponding element of the subgroup of $n$-th roots of unity.
rootsOfUnity.coe_mkOfPowEq
The complex value of an element of `rootsOfUnity n ℂ` formed by `mkOfPowEq` is the original element $\zeta$.
det_fin_two_of
The determinant of a $2 \times 2$ matrix with entries $a, b, c, d$ is $ad - bc$.
normSq_apply
The squared complex norm of $z$ equals $(\operatorname{Re} z)^2 + (\operatorname{Im} z)^2$.

Written by a model (gemini-3.8-flash) from the Lean proof and the goal states Lean reported at each step. Lean verified the proof; this explanation is a reading aid and is not itself machine-checked.

Lean source view module on GitHub

/-- There exists a 2 by 2 matrix with entries in the complex third roots of unity whose squared determinant is 3. -/theorem op_2178_order_two_ternary_det_sq_attained :    ∃ (M : Matrix (Fin 2) (Fin 2) ℂ),      (∀ i j, ∃ u : rootsOfUnity 3 ℂ, ((u : ℂˣ) : ℂ) = M i j) ∧      Complex.normSq M.det = 3 := by  open Matrix Complex in  let ω : ℂ := (-1 + (Real.sqrt 3 : ℂ) * I) / 2  have h3 : (Real.sqrt 3 : ℂ) ^ 2 = 3 := by    rw [← ofReal_pow, Real.sq_sqrt (by norm_num)]    push_cast    rfl  have hI : I ^ 2 = -1 := I_sq  set s := (Real.sqrt 3 : ℂ)  have h_cube : (-1 + s * I) ^ 3 = 8 := by    have h_id : (-1 + s * I) ^ 3 - 8 = (s * I - 3) * (s ^ 2 * (I ^ 2 + 1) - (s ^ 2 - 3)) := by ring    linear_combination h_id + (s * I - 3) * s ^ 2 * hI - (s * I - 3) * h3  have ω_pow_three : ω ^ 3 = 1 := by    calc      ω ^ 3 = ((-1 + s * I) / 2) ^ 3 := rfl      _ = (-1 + s * I) ^ 3 / 8 := by ring      _ = 8 / 8 := by rw [h_cube]      _ = 1 := by norm_num  let u_one : rootsOfUnity 3 ℂ := 1  let u_ω : rootsOfUnity 3 ℂ := rootsOfUnity.mkOfPowEq ω ω_pow_three  have hu_one : (((u_one : ℂˣ) : ℂ)) = 1 := rfl  have hu_ω : (((u_ω : ℂˣ) : ℂ)) = ω :=    rootsOfUnity.coe_mkOfPowEq ω_pow_three  use !![1, 1; ω, 1]  constructor  · intro i j    fin_cases i <;> fin_cases j    · exact ⟨u_one, hu_one⟩    · exact ⟨u_one, hu_one⟩    · exact ⟨u_ω, hu_ω⟩    · exact ⟨u_one, hu_one⟩  · have hdet : (!![1, (1 : ℂ); ω, 1]).det = 1 - ω := by      rw [det_fin_two_of]      ring    rw [hdet]    have hre : (1 - ω).re = 3 / 2 := by      dsimp [ω]      simp      ring    have him : (1 - ω).im = - Real.sqrt 3 / 2 := by      dsimp [ω]      simp      ring    rw [normSq_apply, hre, him]    have hs3 : (Real.sqrt 3) ^ 2 = 3 := Real.sq_sqrt (by norm_num)    nlinarith
See it in the graphDiscuss this resultChallenge it