AFTD Auto-Formalizing Theoretical Domains

k_submod_join

def

Join of two assignments x and y in Fin n → Option (Fin k): at each coordinate e, if one is none it takes the other, if both agree it takes that value, and if they conflict it takes none.

Statement

def k_submod_join {n k : ℕ} (x y : Fin n → Option (Fin k)) : Fin n → Option (Fin k)
Defined in
arXiv:2610.26677, line 98
Verified
21 Oct 2026
Axioms
none listed
Used by 3

Read back from the Lean

Definition of k_submod_join, which takes two implicit natural numbers $n$ and $k$, and two functions $x, y : \mathrm{Fin}(n) \to \mathrm{Option}(\mathrm{Fin}(k))$, and returns a function of type $\mathrm{Fin}(n) \to \mathrm{Option}(\mathrm{Fin}(k))$. For any $e : \mathrm{Fin}(n)$, the result at $e$ is defined by case analysis on the pair $(x(e), y(e))$: - If $x(e) = \mathrm{none}$, it returns $y(e)$. - If $y(e) = \mathrm{none}$ (and $x(e) \neq \mathrm{none}$), it returns $x(e)$. - If $x(e) = \mathrm{some}(i)$ and $y(e) = \mathrm{some}(j)$, it returns $\mathrm{some}(i)$ if $i = j$, and $\mathrm{none}$ if $i \neq j$.

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

/-- Coordinatewise join of two assignments Fin n → Option (Fin k). -/
def k_submod_join {n k : ℕ} (x y : Fin n → Option (Fin k)) : Fin n → Option (Fin k) := fun e =>
    match x e, y e with
    | none, b => b
    | a, none => a
    | some i, some j => if i = j then some i else none
See it in the graphDiscuss this resultChallenge it