AFTD Auto-Formalizing Theoretical Domains

ranking_swap_apply_left

theoremverified

After swapping positions k and l, position k holds the good that was at position l.

Statement

theorem ranking_swap_apply_left {G : Type*} {m : ℕ} (r : Fin m ≃ G) (k l : Fin m) :
    ranking_swap r k l k = r l
Source
Sanity lemma for ranking_swap (arXiv:2610.23040 Definition 3.5).
Verified
19 Oct 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 1
  • ranking_swapThe ranking obtained from r by exchanging the goods in positions k and l.
Used by 1
  • sixteen_spin_diff_pattern_mkOn a concrete unordered pair {u, v}, the π/8 difference pattern of a spin configuration sp says exactly that sp differs in components 1…

The proof, explained

The theorem asserts that after swapping positions k and l, position k is assigned the item originally at position l. The proof unfolds the definition of ranking_swap as the composition of the transposition swap k l with the ranking r. The simplifier then evaluates the transposition at k, which gives l, and concludes that the composite maps k to r l.

  1. The swapped ranking maps position k to r l.

    By definition, ranking_swap r k l is the composition (Equiv.swap k l).trans r. Applying this equivalence to position k first swaps k with l (yielding l) and then applies the ranking r, resulting in r l. The simp tactic unfolds ranking_swap and evaluates this composition directly.

    line 3

    uses ranking_swap

      simp [ranking_swap]
ranking_swap
The ranking obtained by first swapping the positions k and l, then applying r; defined as the composition (Equiv.swap k l).trans r.

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

theorem ranking_swap_apply_left {G : Type*} {m : ℕ} (r : Fin m ≃ G) (k l : Fin m) :    ranking_swap r k l k = r l := by  simp [ranking_swap]
See it in the graphDiscuss this resultChallenge it