AFTD Auto-Formalizing Theoretical Domains

cyclic_latin_rank_sum

def

Given an order n with [NeZero n], a bijection a : Fin n ≃ ZMod n, and a matching permutation π : Equiv.Perm (ZMod n), the aggregate proposer rank cyclic_latin_rank_sum n a π is the sum over all men i : ZMod n of the rank (a.symm (i + π i) : ℕ).

Statement

open scoped BigOperators in
def cyclic_latin_rank_sum (n : ℕ) [NeZero n] (a : Fin n ≃ ZMod n)
    (π : Equiv.Perm (ZMod n)) : ℕ
Defined in
OP-1351
Verified
10 Nov 2026
Axioms
none listed
Used by 3

Read back from the Lean

Given a natural number $n$ with $n \neq 0$ ([NeZero n]), an equivalence $a : \mathrm{Fin}(n) \simeq \mathbb{Z}/n\mathbb{Z}$, and a permutation $\pi$ of $\mathbb{Z}/n\mathbb{Z}$, cyclic_latin_rank_sum n a π is defined as the sum over all $i \in \mathbb{Z}/n\mathbb{Z}$ of the natural number value of $a^{-1}(i + \pi(i))$ (where $a^{-1}(i + \pi(i)) \in \mathrm{Fin}(n)$ is coerced to $\mathbb{N}$).

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

open scoped BigOperators in
/-- Aggregate proposer rank of a matching under cyclic Latin ordering a. -/
def cyclic_latin_rank_sum (n : ℕ) [NeZero n] (a : Fin n ≃ ZMod n)
    (π : Equiv.Perm (ZMod n)) : ℕ := ∑ i : ZMod n, (a.symm (i + π i) : ℕ)
See it in the graphDiscuss this resultChallenge it