AFTD Auto-Formalizing Theoretical Domains

finite_bi_algebra_is_semigroup_with_left_units

theoremverifiedformalization

Every finite BI-algebra is a semigroup with B and I as left units: let (A, ·) be a finite magma equipped with elements B, I in A such that B is a B-element (((Bx)y)z = x(yz) for all x, y, z in A) and I is an I-element (Ix = x for all x in A). Then the binary operation is associative ((xy)z = x(yz) for all x, y, z in A), and both B and I are left units of (A, ·) (Bx = x and Ix = x for all x in A).

Statement

theorem finite_bi_algebra_is_semigroup_with_left_units
    {A : Type*} [Mul A] [Fintype A]
    (B I : A) (hB : bmi_is_b_element B) (hI : bmi_is_i_element I) :
    (∀ x y z : A, (x * y) * z = x * (y * z)) ∧
    (∀ x : A, B * x = x) ∧
    (∀ x : A, I * x = x)
Formalizes
arXiv:2610.37108 Proposition 3.1
Verified
31 Oct 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 6
  • bmi_is_b_elementAn element $B$ in a magma $(A, \cdot)$ is a $B$-element if $((Bx)y)z = x(yz)$ for all $x, y, z \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$.
  • bmi_is_left_unit_bLet $(A, \cdot)$ be a finite magma equipped with a $B$-element $B$ and an $I$-element $I$. Then $B$ is a left unit: $Bx = x$ for all…
  • bmi_assoc_of_is_b_of_left_unitLet $(A, \cdot)$ be a magma with a $B$-element $B$. If $B$ is a left unit ($Bx = x$ for all $x$), then the operation is associative:…
  • bi_left_translation_surj_stepIn any magma with a B-element B and an I-element I, for any element a, the left translation by ((B * a) * I) coincides with the left…
  • bi_left_translation_iter2_eqIn any magma with a B-element B and an I-element I, the left translations by ((B * I) * I) and ((I * I) * I) are equal: ((B * I) * I) * x…

Read back from the Lean

Let $A$ be a finite type equipped with a binary operation * (multiplication). Let $B, I \in A$. If $B$ satisfies bmi_is_b_element (for all $x, y, z \in A$, $((B * x) * y) * z = x * (y * z)$) and $I$ satisfies bmi_is_i_element (for all $x \in A$, $I * x = x$), then: 1. * is associative: for all $x, y, z \in A$, $(x * y) * z = x * (y * z)$; 2. $B$ is a left identity: for all $x \in A$, $B * x = x$; and 3. $I$ is a left identity: for all $x \in A$, $I * x = x$.

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 proof shows that every finite BI-algebra is an associative semigroup with left units B and I by combining two prior results. First, it uses bmi_is_left_unit_b to deduce that the B-element B must be a left unit in any finite magma with an I-element. Next, because any B-element that is also a left unit makes the magma associative (bmi_assoc_of_is_b_of_left_unit), the operation is associative, yielding all three conjuncts.

  1. B is a left unit: B * x = x for all x in A

    Applying bmi_is_left_unit_b to the finite magma A and the hypotheses hB and hI establishes that B acts as a left unit.

    line 8

    uses bmi_is_left_unit_b

      have hBunit : ∀ x : A, B * x = x := bmi_is_left_unit_b B I hB hI
  2. I is a left unit: I * x = x for all x in A

    This is immediate from the hypothesis hI, which assumes I is an I-element (defined as ∀ x, I * x = x).

    line 9

      have hIunit : ∀ x : A, I * x = x := hI
  3. Multiplication on A is associative, and both B and I are left units

    Using bmi_assoc_of_is_b_of_left_unit with B, the fact that B is a B-element, and the fact that B is a left unit, multiplication is shown to be associative: (x * y) * z = x * (y * z). Combining this with the two left-unit facts satisfies the three conjuncts of the goal.

    line 10

    uses bmi_assoc_of_is_b_of_left_unit

      exact ⟨bmi_assoc_of_is_b_of_left_unit B hB hBunit, hBunit, hIunit⟩
bmi_is_left_unit_b
In a finite magma equipped with a B-element B and an I-element I, B is a left unit: B * x = x for all x.
bmi_assoc_of_is_b_of_left_unit
In any magma, if an element B is both a B-element and a left unit, then multiplication is associative: (x * y) * z = x * (y * z) for all x, y, z.

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

/-- Every finite BI-algebra is a semigroup with B and I as left units. -/theorem finite_bi_algebra_is_semigroup_with_left_units    {A : Type*} [Mul A] [Fintype A]    (B I : A) (hB : bmi_is_b_element B) (hI : bmi_is_i_element I) :    (∀ x y z : A, (x * y) * z = x * (y * z)) ∧    (∀ x : A, B * x = x) ∧    (∀ x : A, I * x = x) := by  have hBunit : ∀ x : A, B * x = x := bmi_is_left_unit_b B I hB hI  have hIunit : ∀ x : A, I * x = x := hI  exact ⟨bmi_assoc_of_is_b_of_left_unit B hB hBunit, hBunit, hIunit⟩
See it in the graphDiscuss this resultChallenge it