AFTD Auto-Formalizing Theoretical Domains

algebraic_bipartite_graph

def

The algebraic bipartite graph $\Lambda_{k, R}$ with left vertices $\{l \in R^{k+1} \mid l_1 = l_2 \text{ if } 2 \le k\}$ and right vertices $\{r \in R^{k+1} \mid r_1 = 0 \text{ if } 1 \le k\}$, where a left vertex $l$ and a right vertex $r$ are adjacent if and only if for all $2 \le i \le k$, $l_i + r_i = r_0 l_{i-2}$ when $i \equiv 2, 3 \pmod 4$ and $l_i + r_i = l_0 r_{i-2}$ when $i \equiv 0, 1 \pmod 4$.

Statement

def algebraic_bipartite_graph (k : ℕ) (R : Type*) [CommRing R] :
    SimpleGraph ({ l : Fin (k + 1) → R // ∀ (h : 2 ≤ k), l ⟨1, by omega⟩ = l ⟨2, by omega⟩ } ⊕
                 { r : Fin (k + 1) → R // ∀ (h : 1 ≤ k), r ⟨1, by omega⟩ = 0 })
Defined in
arXiv:2611.32201:130-137
Verified
29 Nov 2026
Axioms
none listed
Used by 1

Read back from the Lean

Given a natural number $k$ and a commutative ring $R$, algebraic_bipartite_graph k R is the simple graph whose vertex set is the disjoint union $V_L \oplus V_R$, where: - $V_L$ is the set of functions $l : \mathrm{Fin}(k + 1) \to R$ satisfying the condition that if $2 \le k$, then $l(1) = l(2)$. - $V_R$ is the set of functions $r : \mathrm{Fin}(k + 1) \to R$ satisfying the condition that if $1 \le k$, then $r(1) = 0$. Two vertices $u, v \in V_L \oplus V_R$ are adjacent if and only if one is in $V_L$ and the other is in $V_R$ (with no edges between two vertices of $V_L$ or two vertices of $V_R$), and the pair $(l, r) \in V_L \times V_R$ satisfies: for all natural numbers $i$ such that $2 \le i \le k$, - if $i \equiv 2 \pmod 4$ or $i \equiv 3 \pmod 4$, then $$l(i) + r(i) = r(0) \cdot l(i - 2)$$ - otherwise (i.e., if $i \equiv 0 \pmod 4$ or $i \equiv 1 \pmod 4$), then $$l(i) + r(i) = l(0) \cdot r(i - 2)$$

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

Lean source view module on GitHub

/-- The algebraic bipartite graph Lambda_{k, R} on L_k + R_k. -/
def algebraic_bipartite_graph (k : ℕ) (R : Type*) [CommRing R] :
    SimpleGraph ({ l : Fin (k + 1) → R // ∀ (h : 2 ≤ k), l ⟨1, by omega⟩ = l ⟨2, by omega⟩ } ⊕
                 { r : Fin (k + 1) → R // ∀ (h : 1 ≤ k), r ⟨1, by omega⟩ = 0 }) := {
  Adj := fun
    | .inl l, .inr r | .inr r, .inl l =>
      ∀ (i : ℕ) (hi : 2 ≤ i) (hik : i ≤ k),
        if i % 4 = 2 ∨ i % 4 = 3 then
          l.1 ⟨i, by omega⟩ + r.1 ⟨i, by omega⟩ = r.1 ⟨0, by omega⟩ * l.1 ⟨i - 2, by omega⟩
        else
          l.1 ⟨i, by omega⟩ + r.1 ⟨i, by omega⟩ = l.1 ⟨0, by omega⟩ * r.1 ⟨i - 2, by omega⟩
    | _, _ => False
  symm := ⟨by
    intro u v h
    rcases u with l | r <;> rcases v with l' | r'
    · contradiction
    · exact h
    · exact h
    · contradiction⟩
  loopless := ⟨by
    intro u h
    rcases u with l | r <;> exact h⟩
}
See it in the graphDiscuss this resultChallenge it