AFTD Auto-Formalizing Theoretical Domains

bmi_idempotent_of_assoc_of_is_m_of_is_i

theoremverifiedformalization

Let $(A, \cdot)$ be an associative magma with an $M$-element $M$ and an $I$-element $I$. Then every element $x \in A$ is idempotent: $xx = x$.

Statement

theorem bmi_idempotent_of_assoc_of_is_m_of_is_i {A : Type*} [Mul A]
    (h_assoc : ∀ x y z : A, (x * y) * z = x * (y * z))
    (M I : A) (hM : bmi_is_m_element M) (hI : bmi_is_i_element I) :
    ∀ x : A, x * x = x
Formalizes
arXiv:2610.37108 Theorem 3.3 -- Finite BM-algebras and fixed-point combinators
Verified
28 Oct 2026
Axioms
none — Lean reports it depends on no axioms
Built on 2
  • bmi_is_m_elementAn element $M$ in a magma $(A, \cdot)$ is an $M$-element if $Mx = xx$ for all $x \in A$ .
  • bmi_is_i_elementAn element $I$ in a magma $(A, \cdot)$ is an $I$-element (a left unit) if $Ix = x$ for all $x \in A$.
Used by 2

Read back from the Lean

Let $A$ be a type with a multiplication operation $\cdot$. If multiplication is associative (i.e., $(x \cdot y) \cdot z = x \cdot (y \cdot z)$ for all $x, y, z \in A$), and there exist elements $M, I \in A$ such that $M$ is an m-element (bmi_is_m_element M) and $I$ is an i-element (bmi_is_i_element I), then every element $x \in A$ is idempotent (i.e., $x \cdot x = x$ for all $x \in A$).

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

To prove that every element $x \in A$ is idempotent, we relate $x * x$ to products involving the elements $M$ and $I$. Using the defining property of the $M$-element and the left-identity property of $I$, we rewrite $x * x = M * x = M * (I * x) = (M * I) * x = (I * I) * x$. Reassociating this expression to $I * (I * x)$ and applying the left-identity property of $I$ twice reduces it directly to $x$, establishing $x * x = x$.

  1. Let $x \in A$ be arbitrary; it suffices to show that $x * x = x$.

    We introduce an arbitrary element $x$ of the magma $A$ (`intro x`), reducing the universal quantification to showing that this fixed $x$ is idempotent.

    line 6

      intro x
  2. $x * x = x$

    We establish that $x * x = x$ by a calculation chain (`calc`): 1. By the defining property of the $M$-element (`hM`), $M * x = x * x$, so by symmetry $x * x = M * x$ (line 7). 2. Since $I$ is an $I$-element (`hI`), $I * x = x$, so rewriting gives $M * (I * x)$ (line 8). 3. By associativity (`h_assoc`), this regroups to $(M * I) * x$ (line 9). 4. Applying the defining property of the $M$-element to $I$ gives $M * I = I * I$, rewriting the expression to $(I * I) * x$ (line 10). 5. Associativity rewrites this as $I * (I * x)$ (line 11). 6. The left-identity property of $I$ applied to $I * x$ reduces this to $I * x$ (line 12). 7. A second application of the left-identity property reduces $I * x$ to $x$ (line 13).

    lines 7–13

      calc x * x = M * x := (hM x).symm
        _ = M * (I * x) := by rw [hI x]
        _ = (M * I) * x := (h_assoc M I x).symm
        _ = (I * I) * x := by rw [hM I]
        _ = I * (I * x) := h_assoc I I x
        _ = I * x := hI (I * x)
        _ = x := hI x

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

/-- In any associative magma with an M-element and an I-element, every element is idempotent. -/theorem bmi_idempotent_of_assoc_of_is_m_of_is_i {A : Type*} [Mul A]    (h_assoc : ∀ x y z : A, (x * y) * z = x * (y * z))    (M I : A) (hM : bmi_is_m_element M) (hI : bmi_is_i_element I) :    ∀ x : A, x * x = x := by  intro x  calc x * x = M * x := (hM x).symm    _ = M * (I * x) := by rw [hI x]    _ = (M * I) * x := (h_assoc M I x).symm    _ = (I * I) * x := by rw [hM I]    _ = I * (I * x) := h_assoc I I x    _ = I * x := hI (I * x)    _ = x := hI x
See it in the graphDiscuss this resultChallenge it