AFTD Auto-Formalizing Theoretical Domains

rowView

def

Given a row seating of S sages represented as a permutation π with 2 ≤ S, the local view at position i is the sage π i along with their left neighbor (or none if i = 0) and their right neighbor (or none if i = S - 1).

Statement

def rowView {S : ℕ} (hS : 2 ≤ S) (π : Equiv.Perm (Fin S)) (i : Fin S) : RowLocalView (Fin S)
Defined in
arXiv:2610.33032:178
Verified
27 Oct 2026
Axioms
none listed
Built on 1
  • RowLocalViewFor sages of type α, a local view in an unlabeled row consists of the sage's own identity together with an optional left neighbor and an…
Used by 6
  • rowViewOfSageThe local view of sage x in a row seating π is the local view at the position π.symm x occupied by x.
  • row_solvable_monoIf the anonymous-slip puzzle for S sages in a row with unlabeled seats is solvable with n symbols (RowProblemSolvable S n hS), then it is…
  • row_protocol_solves_of_injectiveIf a protocol with announcements in α solves the row puzzle, then composing it with any injective map α → β gives a protocol with…
  • sages_row_upper_bound_binomialFor every integer S ≥ 3, the anonymous-slip puzzle for S sages in a row with unlabeled seats can be solved using Nat.choose S 2 symbols.
  • RowProtocolSolvesA protocol p : RowLocalView (Fin S) → α solves the anonymous-slip puzzle for S sages in a row with 2 ≤ S without seat labels if for every…
  • rowMultisetGiven a hypothesis 2 ≤ S, the public multiset of values produced by a protocol p : RowLocalView (Fin S) → α on a row seating π :…

Read back from the Lean

For a natural number $S$, a proof $hS$ that $2 \le S$, a permutation $\pi$ of $\mathrm{Fin}(S)$, and an element $i \in \mathrm{Fin}(S)$, rowView hS π i defines a RowLocalView (Fin S) (a triple of type $\mathrm{Fin}(S) \times \mathrm{Option}(\mathrm{Fin}(S)) \times \mathrm{Option}(\mathrm{Fin}(S))$) consisting of: 1. $\pi(i)$; 2. $\mathrm{none}$ if $i = 0$, and $\mathrm{some}(\pi(i - 1))$ otherwise; 3. $\mathrm{none}$ if $i = S - 1$, and $\mathrm{some}(\pi(i + 1))$ otherwise.

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 local view of the sage sitting at seat `i` in row seating `π`. -/
def rowView {S : ℕ} (hS : 2 ≤ S) (π : Equiv.Perm (Fin S)) (i : Fin S) : RowLocalView (Fin S) := (π i,
   if h0 : i.val = 0 then none else some (π ⟨i.val - 1, by omega⟩),
   if hlast : i.val = S - 1 then none else some (π ⟨i.val + 1, by omega⟩))
See it in the graphDiscuss this resultChallenge it