Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Repair keeps records valid and returns well-formed aligned pieces

Proved
EnvyFreeCake104.Divide.repair_invariants

by Shuze Chen · Nov 19, 2026 · Mathlib 0df444a (Lean v4.33.1)

cake-cuttingenvy-freefair-divisionquery-complexity

Repair keeps pieces well formed. Let NNN be a set of agents, ε∈R\varepsilon\in\mathbb Rε∈R, (Di)i∈N(D_i)_{i\in N}(Di​)i∈N​ pairwise disjoint well-formed pieces (old bundles) and RRR a well-formed piece (the residue) disjoint from every DiD_iDi​, all with endpoints recorded in a record state sss valid for NNN.

Then every successful run of Repair(N,D,R,ε)\mathrm{Repair}(N,D,R,\varepsilon)Repair(N,D,R,ε) (Algorithm 4; any choice oracle, any prior transcript) ending in records s′s's′ satisfies: s′s's′ is valid for NNN, every point recorded in sss is recorded in s′s's′, every returned bundle WiW_iWi​ (i∈Ni\in Ni∈N) is a well-formed piece with endpoints recorded in s′s's′, and so is the returned residue (the unpicked cells followed by Permute's residue).

This is the §1.3 convention for the outputs of Repair: the cells are cut out of RRR at recorded marks, the pieces passed to Permute are concatenations of disjoint cells and old bundles, and Permute only trims recorded prefixes.

Preamble
import Definitions.Def_EnvyFreeCake104_Divide_Protocols

set_option autoImplicit false
Formal statement
namespace EnvyFreeCake104.Divide

/-- Run invariant of Repair (Algorithm 4): from valid records in which the pairwise disjoint
well-formed old bundles `D_i` and the well-formed residue `R` (disjoint from every `D_i`) are
aligned, every successful run keeps the records valid, only adds recorded points, and returns
well-formed aligned bundles and a well-formed aligned residue. -/
theorem repair_invariants {ι : Type} [DecidableEq ι] (V : ι → Valuation) (N : Finset ι)
    (D : ι → Piece) (R : Piece) (ε : ℝ) (hD : ∀ i ∈ N, (D i).WF) (hR : R.WF)
    (hDdisj : ∀ i ∈ N, ∀ j ∈ N, i ≠ j → Disjoint (D i).toSet (D j).toSet)
    (hDR : ∀ i ∈ N, Disjoint (D i).toSet R.toSet)
    (s : Rec ι) (hs : s.Valid V N) (hDs : ∀ i ∈ N, s.Aligned (D i)) (hRs : s.Aligned R)
    (o : ChoiceOracle ι) (tr₀ : List (Event ι))
    (W : ι → Piece) (U : Piece) (s' : Rec ι) (tr : List (Event ι))
    (hrun : Prog.run V o ((repair N D R ε).run s) tr₀ = some (((W, U), s'), tr)) :
    s'.Valid V N ∧ s.pts ⊆ s'.pts ∧ (∀ i ∈ N, (W i).WF ∧ s'.Aligned (W i)) ∧
      U.WF ∧ s'.Aligned U := by sorry

end EnvyFreeCake104.Divide
Source
Alexandros Psomas, Cutting a Cake For Human Consumption: An Elementary n-agent Cake Cutting Protocol, arXiv:2610.30370v1, §1.3 (pp.4-5); Algorithm 4 (p.11)

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 paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me