Prove2Me
Navigate
DiscoverFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Preservation of the Smetaniuk switching-stage invariant

Proved
ProofsInTheBook.Chapter33.smetRectStep_invariant

by xiangyazi24 · Sep 12, 2026 · Mathlib c5ea003 (Lean v4.30.0)

auxiliary-lemmabook-chapter-36combinatoricslatin-squareslean4proofs-from-the-book

Write [n]={0,…,n−1}[n]=\{0,\ldots,n-1\}[n]={0,…,n−1} for n∈Nn\in\mathbb Nn∈N, with [0]=∅[0]=\varnothing[0]=∅. Let N,t∈NN,t\in\mathbb NN,t∈N, L0:[N]2→[N]L_0:[N]^2\to[N]L0​:[N]2→[N], and R:[N]×[N+1]→[N+1]R:[N]\times[N+1]\to[N+1]R:[N]×[N+1]→[N+1]. For L0:[N]2→[N]L_0:[N]^2\to[N]L0​:[N]2→[N] and R:[N]×[N+1]→[N+1]R:[N]\times[N+1]\to[N+1]R:[N]×[N+1]→[N+1], define It(L0,R)\mathcal I_t(L_0,R)It​(L0​,R) by these seven conditions: each row of RRR is injective; each column j<Nj<Nj<N is injective; column NNN is injective on rows i≥N−ti\ge N-ti≥N−t; R(i,N)=NR(i,N)=NR(i,N)=N for i<N−ti<N-ti<N−t; R(i,j)=L0(i,j)R(i,j)=L_0(i,j)R(i,j)=L0​(i,j) for t<j<Nt<j<Nt<j<N; R(i,j)=L0(i,j)R(i,j)=L_0(i,j)R(i,j)=L0​(i,j) for j<Nj<Nj<N and i+j<Ni+j<Ni+j<N; and R(i,N−i)=NR(i,N-i)=NR(i,N−i)=N for i≥N−ti\ge N-ti≥N−t. All rows range over [N][N][N], and natural-number subtraction is truncated at zero. For t+1<Nt+1<Nt+1<N, put c=t+1c=t+1c=t+1 and b=N−(t+1)b=N-(t+1)b=N−(t+1). Let T⊆[N]T\subseteq[N]T⊆[N] be the least set containing bbb and closed under this rule: if q∈Tq\in Tq∈T, r≥br\ge br≥b, and R(r,N)=R(q,c)R(r,N)=R(q,c)R(r,N)=R(q,c), then r∈Tr\in Tr∈T. Define R′R^{\prime}R′ by interchanging columns ccc and NNN in each row of TTT, leaving the other entries unchanged. Assume t+1<Nt+1<Nt+1<N and It(L0,R)\mathcal I_t(L_0,R)It​(L0​,R). Then

It+1(L0,R′).\mathcal I_{t+1}(L_0,R^{\prime}).It+1​(L0​,R′).

No independent Latin assumption on L0L_0L0​ is made; all seven invariant conditions are inputs.

Preamble
import Init
import Mathlib
import Definitions.Def_P2MAssembly_Chapter33
set_option autoImplicit true
open Finset
open Classical
open ProofsInTheBook.Chapter33
Formal statement
lemma ProofsInTheBook.Chapter33.smetRectStep_invariant {N t : ℕ}
    {L₀ : Fin N → Fin N → Fin N}
    {R : Fin N → Fin (N + 1) → Fin (N + 1)}
    (ht : t + 1 < N)
    (inv : SmetRectStageInvariant L₀ t R) :
    SmetRectStageInvariant L₀ (t + 1) (smetRectStep R t) := by sorry
Source
Original formalization: https://github.com/xiangyazi24/proof_in_the_book/blob/88d88d141768cded75e782c525ef1bf04b8fe220/ProofsInTheBook/Chapter33Smetaniuk.lean#L2615. Topic: Aigner and Ziegler, Proofs from THE BOOK, 6th edition, Chapter 36, “Completing Latin squares”, pp. 253–258 (https://doi.org/10.1007/978-3-662-57265-8_36).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paper
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me