Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in

Get started

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

Formal Verification

14 missions · 9 completed

Missions

Open5Completed9All14
🏆Completed
Mathematical LogicTheoretical Computer Science·Captain: Rizwan G Mir

The Cook-Levin Theorem: NP-Completeness of Boolean Satisfiability in Lean 4Research Paper

Introduction

The Cook-Levin theorem states that CNF SAT is NP-complete. This mission formalizes the theorem over a multi-tape Turing machine model in Lean 4.

Main Goal

Prove CookLevin.cook_levin_theorem:

NPCompleteSATNPComplete SATNPCompleteSAT

under the decider and reduction hypotheses.

175 thms9 active usersReviewed
🏆Completed
Theoretical Computer Science·Captain: mikedeng1

Compositional Shape Analysis by Means of Bi-Abduction 2: With Precise Preconditions and Best Anti-Frames, the Canonical Precondition of an Action Sequence Is Its FootprintResearch Paper

Motivation

Automatic program analyses for heap-manipulating code have to infer, for each procedure, a precondition describing the memory the procedure needs. Calcagno, Distefano, O'Hearn and Yang (J. ACM 2011) do this with bi-abduction: at a call site the analysis asks for an anti-frame MMM, the missing memory, and a frame, the memory left untouched, so that the current state together with MMM meets the callee's precondition. Their tool, Abductor, and its successor Infer, derive specifications compositionally, procedure by procedure, without a whole program.

A natural question is what the inferred preconditions mean. The paper's informal answer is that the analysis aims at footprints: descriptions of the cells a program actually uses. §4.2.4 makes this precise for straight-line sequences of actions: if each precondition is precise and the prover always returns the best anti-frame, the inferred precondition is exactly the footprint. That result rests on the semantic theory of best abductive solutions developed in §3.3: with respect to a natural order, the abduction question F∗M⊨GF * M \models GF∗M⊨G has a unique best solution, min⁡(F− ⁣ ⁣∗G)\min(F \mathbin{-\!\!*} G)min(F−∗G).

Setting

A heap is a finite partial map from locations to values; a stack maps variables to values; a state is a stack–heap pair (s,h)(s,h)(s,h). A predicate is an arbitrary set of states. Write h=h0⊎h1h = h_0 \uplus h_1h=h0​⊎h1​ when h0,h1h_0, h_1h0​,h1​ have disjoint domains and hhh is their union, and h′⊆hh' \subseteq hh′⊆h for a subheap. The separating conjunction F∗GF * GF∗G holds of (s,h)(s,h)(s,h) when h=h0⊎h1h = h_0 \uplus h_1h=h0​⊎h1​ with (s,h0)∈F(s,h_0) \in F(s,h0​)∈F and (s,h1)∈G(s,h_1) \in G(s,h1​)∈G; true\mathsf{true}true is the set of all states; the separating implication F− ⁣ ⁣∗GF \mathbin{-\!\!*} GF−∗G holds of (s,h)(s,h)(s,h) when every disjoint h′h'h′ with (s,h′)∈F(s,h') \in F(s,h′)∈F gives (s,h⊎h′)∈G(s, h \uplus h') \in G(s,h⊎h′)∈G. Entailment F⊨GF \models GF⊨G is inclusion.

A solution of the abduction question F∗M⊨GF * M \models GF∗M⊨G is any predicate MMM with F∗M⊨GF * M \models GF∗M⊨G. Solutions are compared by the spatial preorder and the betterness order

M≤M′  ⟺  M′⊨M∗true,M≾M′  ⟺  (M≤M′∧M′≰M)∨(M≤M′∧M′≤M∧M⊨M′).M \le M' \iff M' \models M * \mathsf{true}, \qquad M \precsim M' \iff (M \le M' \wedge M' \not\le M) \vee (M \le M' \wedge M' \le M \wedge M \models M').M≤M′⟺M′⊨M∗true,M≾M′⟺(M≤M′∧M′≤M)∨(M≤M′∧M′≤M∧M⊨M′).

The minimal states of FFF are min⁡(F)\min(F)min(F): the states (s,h)∈F(s,h) \in F(s,h)∈F such that no proper subheap h′⊊hh' \subsetneq hh′⊊h has (s,h′)∈F(s,h') \in F(s,h′)∈F.

An action α\alphaα is given by its specification {Pα} α {Qα}\{P_\alpha\}\,\alpha\,\{Q_\alpha\}{Pα​}α{Qα​}, a pair of predicates. A predicate PPP is precise if every (s,h)(s,h)(s,h) has at most one subheap hf⊆hh_f \subseteq hhf​⊆h with (s,hf)∈P(s,h_f) \in P(s,hf​)∈P. For a nonempty sequence of actions, the safe states and the footprint are

safe(α)=Pα∗true,safe(α;C)=Pα∗(Qα− ⁣ ⁣∗safe(C)),foot(C)=min⁡(safe(C)).\mathrm{safe}(\alpha) = P_\alpha * \mathsf{true},\quad \mathrm{safe}(\alpha;C) = P_\alpha * \big(Q_\alpha \mathbin{-\!\!*} \mathrm{safe}(C)\big),\quad \mathrm{foot}(C) = \min(\mathrm{safe}(C)).safe(α)=Pα​∗true,safe(α;C)=Pα​∗(Qα​−∗safe(C)),foot(C)=min(safe(C)).

The canonical precondition PCP_CPC​ of a sequence, as computed by an ideal bi-abductive prover, is PαP_\alphaPα​ for a single action and Pα∗MP_\alpha * MPα​∗M for α;C\alpha; Cα;C, where MMM is the best solution of Qα∗M⊨PC∗trueQ_\alpha * M \models P_C * \mathsf{true}Qα​∗M⊨PC​∗true.

Formalization targets

Goal: Theorem 4.11 (Deriving Footprint)

If every precondition PβP_\betaPβ​ of the sequence is precise and every anti-frame is a ≾\precsim≾-best solution, then

foot(C)=PC.\mathrm{foot}(C) = P_C .foot(C)=PC​.

Milestones

  1. Lemma 3.10. ≤\le≤ is a preorder; M≤min⁡(M)M \le \min(M)M≤min(M) and min⁡(M)≤M\min(M) \le Mmin(M)≤M; and M,M′M, M'M,M′ are ≤\le≤-equivalent iff min⁡(M)=min⁡(M′)\min(M) = \min(M')min(M)=min(M′).
  2. Lemma 3.11. ≾\precsim≾ is a partial order, and M′≤MM' \le MM′≤M implies min⁡(M′)≾M\min(M') \precsim Mmin(M′)≾M.
  3. Lemma 3.12. F− ⁣ ⁣∗GF \mathbin{-\!\!*} GF−∗G is a ≤\le≤-least solution of F∗M⊨GF * M \models GF∗M⊨G; equivalently F∗M⊨G  ⟺  M⊨F− ⁣ ⁣∗GF * M \models G \iff M \models F \mathbin{-\!\!*} GF∗M⊨G⟺M⊨F−∗G.
  4. Theorem 3.13. The ≾\precsim≾-least solution exists, is unique, and equals min⁡(F− ⁣ ⁣∗G)\min(F \mathbin{-\!\!*} G)min(F−∗G).
  5. Proof of Theorem 4.11, safe states. safe(C)=foot(C)∗true\mathrm{safe}(C) = \mathrm{foot}(C) * \mathsf{true}safe(C)=foot(C)∗true for every sequence.
  6. Proof of Theorem 4.11, precision. If PPP is precise, min⁡(P∗X)=min⁡(P)∗min⁡(X)\min(P * X) = \min(P) * \min(X)min(P∗X)=min(P)∗min(X) for every XXX, and min⁡(P)=P\min(P) = Pmin(P)=P.

Significance

Theorem 3.13 gives the abduction question a canonical semantic answer, and it is the yardstick for every algorithm in the paper: the heuristic procedure of §3.2 is shown not to reach it, and the systematic procedure of §3.4 is proved to compute it on a restricted fragment. Theorem 4.11 connects this semantic optimum to program analysis: on straight-line paths, bi-abduction with an ideal prover infers neither more nor less memory than the program touches. It is the paper's theoretical justification for aiming the analysis at footprints.

Neither result has a machine-checked proof that this mission knows of; the platform has no separation-logic layer at all. The mission produces a self-contained semantic layer for separation logic over a concrete heap model (finite heaps, ∗*∗, − ⁣ ⁣∗\mathbin{-\!\!*}−∗, min⁡\minmin, the orders ≤\le≤ and ≾\precsim≾, precise predicates) that the companion mission on the systematic abduction algorithm, and later work on frame inference or footprint analysis, can share. The paper proves both results; the work here is to formalize those proofs.

Difficulty

Most steps are short once the definitions are fixed, and the paper states several of them as "immediate". Two points are not. First, min⁡(M)≤M\min(M) \le Mmin(M)≤M and the "if" direction of Lemma 3.10(3) need every state of MMM to lie above a minimal one; this holds because heaps are finite, so the subheap order is well founded, and fails for infinite heaps. Second, the inductive step of Theorem 4.11 passes through safe(C)=PC∗true\mathrm{safe}(C) = P_C * \mathsf{true}safe(C)=PC​∗true and through distributing min⁡\minmin over a precise ∗*∗-factor. Precision of PαP_\alphaPα​ is what forces the split of a minimal heap of Pα∗XP_\alpha * XPα​∗X to be unique; without it, the two sides of the displayed chain on p. 50 differ. The induction must carry precision for every action of the tail.

Formalization scope

Lean represents values and variables as natural numbers, with 000 as nil and the nonzero naturals as locations; a heap is a cell map ℕ → Option ℕ with cell 0 = none and finite domain; disjoint union is a relation. Predicates are Set (Stack × Heap), entailment is ⊆, and true\mathsf{true}true is Set.univ. Program and logical variables are not distinguished, and actions carry no parameters, as in §4.2.4; the stack is the same on both sides of every connective. "The minimal solution w.r.t. ≾\precsim≾" is the ≾\precsim≾-least solution, competing against every predicate, not only symbolic heaps. A sequence of actions is a head action plus a tail list, so the empty sequence never occurs. Theorem numbers and pages are those of the accepted manuscript of the J. ACM article (pp. 1–72, footer "Journal of the ACM, Vol. V, No. N, May 2011"), not of the typeset Article 26.

The paper does not define "the canonical spec" in §4.2.4. The formalization reads it from the proof of Theorem 4.11, as an inductive relation whose anti-frames are arbitrary ≾\precsim≾-least solutions. Defining the anti-frame as min⁡(Qα− ⁣ ⁣∗(PC∗true))\min(Q_\alpha \mathbin{-\!\!*} (P_C * \mathsf{true}))min(Qα​−∗(PC​∗true)) would build Theorem 3.13 into the definition, and dropping precision, allowing infinite heaps or restricting the competitors in the definition of a best solution would change the theorem; all of these are ruled out.

Needed infrastructure: the heap model with union and subheap lemmas, well-foundedness of strict subheap inclusion on finite heaps, the adjunction between ∗*∗ and − ⁣ ⁣∗\mathbin{-\!\!*}−∗, and upward closure of safe(C)\mathrm{safe}(C)safe(C). Reusable pieces, such as the heap model, the adjunction and the properties of min⁡\minmin, are welcome as separate lemmas.

Selected references

  • C. Calcagno, D. Distefano, P. W. O'Hearn, H. Yang, Compositional Shape Analysis by means of Bi-Abduction, Journal of the ACM 58(6), 2011. https://doi.org/10.1145/2049697.2049700
  • C. Calcagno, D. Distefano, P. W. O'Hearn, H. Yang, Compositional Shape Analysis by means of Bi-Abduction, POPL 2009. https://doi.org/10.1145/1480881.1480917
  • C. Calcagno, P. W. O'Hearn, H. Yang, Local Action and Abstract Separation Logic, LICS 2007. https://doi.org/10.1109/LICS.2007.30
  • D. Pym, P. W. O'Hearn, H. Yang, Possible Worlds and Resources: The Semantics of BI, Theoretical Computer Science 315(1), 2004. https://doi.org/10.1016/j.tcs.2003.11.020
  • J. C. Reynolds, Separation Logic: A Logic for Shared Mutable Data Structures, LICS 2002. https://doi.org/10.1109/LICS.2002.1029817
9 thms3 active usersReviewed
Mathematical LogicTheoretical Computer Science·Captain: mikedeng1

Compositional Shape Analysis by Means of Bi-Abduction 1: The Best Abductive Solution for Points-To Symbolic Heaps Is a Computable Disjunction of Symbolic HeapsResearch Paper

Motivation

Automatic verification of programs that manipulate pointers needs procedure specifications: preconditions saying which part of the heap a procedure touches and postconditions saying what it leaves behind. Writing them by hand does not scale to millions of lines of code. Calcagno, Distefano, O'Hearn and Yang (J. ACM 58(6), 2011) infer them compositionally with bi-abduction: when symbolic execution reaches a call whose precondition is not implied by the current state, it asks for the missing memory MMM that would make it hold. This abduction question in separation logic,

Δ∗M⊨H,\Delta * M \models H,Δ∗M⊨H,

is the engine behind the Abductor tool and, later, Facebook Infer.

The question has many solutions (M=falseM = \mathsf{false}M=false is always one), so its quality matters. The paper defines an order ≾\precsim≾ on solutions that prefers less memory and then logical strength, shows that a best solution always exists as a semantic object, and then asks whether it can be written down and computed in the language that the analysis actually manipulates: symbolic heaps. For the fragment whose only spatial predicate is points-to, it answers yes. That answer, Theorem 3.25, is the goal of this mission.

Setting

Values are natural numbers; 000 is nil and the nonzero naturals are the locations. A heap hhh is a finite partial map from locations to values; a stack sss assigns a value to every variable; a state is a pair (s,h)(s,h)(s,h). Write h=h0⊎h1h = h_0 \uplus h_1h=h0​⊎h1​ when h0,h1h_0,h_1h0​,h1​ have disjoint domains and hhh is their union. A predicate is an arbitrary set of states. On predicates:

  • s,h⊨F∗Gs,h \models F * Gs,h⊨F∗G iff h=h0⊎h1h = h_0 \uplus h_1h=h0​⊎h1​ with s,h0⊨Fs,h_0 \models Fs,h0​⊨F and s,h1⊨Gs,h_1 \models Gs,h1​⊨G;
  • s,h⊨F− ⁣ ⁣∗Gs,h \models F \mathbin{-\!\!*} Gs,h⊨F−∗G iff for every h′h'h′ disjoint from hhh with s,h′⊨Fs,h' \models Fs,h′⊨F, we have s,h⊎h′⊨Gs,h \uplus h' \models Gs,h⊎h′⊨G;
  • emp\mathsf{emp}emp holds in the empty heap, true\mathsf{true}true everywhere, and ¬\neg¬, ∨\vee∨, ∧\wedge∧, ∃X\exists X∃X, ∀X\forall X∀X are the Boolean and quantifier operations; F⊨GF \models GF⊨G is inclusion.

Symbolic heaps of the Points-to Instantiation. Expressions EEE are variables or natural-number constants. A pure formula Π\PiΠ is a conjunction of E=E′E = E'E=E′ and E≠E′E \neq E'E=E′. A spatial formula Σ\SigmaΣ is a ∗*∗-conjunction of points-to facts E↦E′E \mapsto E'E↦E′, possibly with ∗ true*\,\mathsf{true}∗true; here s,h⊨E↦E′s,h \models E \mapsto E's,h⊨E↦E′ iff [ ⁣[E] ⁣]s≠0[\![E]\!]s \neq 0[[E]]s=0 and hhh is the one-cell heap [ [ ⁣[E] ⁣]s↦[ ⁣[E′] ⁣]s ][\,[\![E]\!]s \mapsto [\![E']\!]s\,][[[E]]s↦[[E′]]s]. A symbolic heap is H=∃X⃗. Π∧ΣH = \exists \vec X.\, \Pi \wedge \SigmaH=∃X.Π∧Σ, and a disjunction D=H1∨⋯∨HnD = H_1 \vee \dots \vee H_nD=H1​∨⋯∨Hn​. In the abduction question (5), Δ∗D⊨H\Delta * D \models HΔ∗D⊨H, the left-hand side Δ=Π∧L1↦R1∗⋯∗Ln↦Rn\Delta = \Pi \wedge L_1 \mapsto R_1 * \dots * L_n \mapsto R_nΔ=Π∧L1​↦R1​∗⋯∗Ln​↦Rn​ is quantifier-free.

Orders. M≤M′M \le M'M≤M′ iff M′⊨M∗trueM' \models M * \mathsf{true}M′⊨M∗true (spatially smaller), and

M≾M′  ⟺  (M≤M′∧M′≰M)∨(M≤M′∧M′≤M∧M⊨M′).M \precsim M' \iff (M \le M' \wedge M' \not\le M) \vee (M \le M' \wedge M' \le M \wedge M \models M').M≾M′⟺(M≤M′∧M′≤M)∨(M≤M′∧M′≤M∧M⊨M′).

min⁡(F)\min(F)min(F) keeps the states of FFF no proper subheap of which (with the same stack) is in FFF. Elsewhere(F)=¬(F− ⁣ ⁣∗false)\mathrm{Elsewhere}(F) = \neg(F \mathbin{-\!\!*} \mathsf{false})Elsewhere(F)=¬(F−∗false) says that some separate heap satisfies FFF, and the compatible preorder is D≤cD′  ⟺  (D∧Elsewhere(Δ))≤(D′∧Elsewhere(Δ))D \le_c D' \iff (D \wedge \mathrm{Elsewhere}(\Delta)) \le (D' \wedge \mathrm{Elsewhere}(\Delta))D≤c​D′⟺(D∧Elsewhere(Δ))≤(D′∧Elsewhere(Δ)). Subtraction is F−G=F∧¬((¬emp)∗G)F - G = F \wedge \neg((\neg\mathsf{emp}) * G)F−G=F∧¬((¬emp)∗G).

Formalization targets

Goal: Theorem 3.25

There is a single algorithm fff such that for every quantifier-free Δ\DeltaΔ and symbolic heap HHH of the Points-to Instantiation, the disjunction D=f(Δ,H)D = f(\Delta, H)D=f(Δ,H) satisfies

Δ∗D⊨HandD≾M  for every predicate M with Δ∗M⊨H.\Delta * D \models H \quad\text{and}\quad D \precsim M \ \text{ for every predicate } M \text{ with } \Delta * M \models H.Δ∗D⊨HandD≾M  for every predicate M with Δ∗M⊨H.

Both halves are part of the goal: the best solution is expressible as a disjunction of symbolic heaps, and it is computable.

Milestones, in the order the paper's argument uses them

  1. Lemma 3.16. If DDD is a minimal solution w.r.t. ≤c\le_c≤c​, then min⁡(D∨¬Elsewhere(Δ))\min(D \vee \neg\mathrm{Elsewhere}(\Delta))min(D∨¬Elsewhere(Δ)) is the minimal solution w.r.t. ≾\precsim≾.
  2. Figure 2 derives solutions (§3.4.2). If Δ∗[D]▹H\Delta * [D] \triangleright HΔ∗[D]▹H is derivable, then Δ∗D⊨H\Delta * D \models HΔ∗D⊨H.
  3. Lemma 3.18. For all Δ,H\Delta, HΔ,H some DDD with Δ∗[D]▹H\Delta * [D] \triangleright HΔ∗[D]▹H is derivable, and the proof search terminates.
  4. Lemma 3.19. If Δ∗[D]▹H\Delta * [D] \triangleright HΔ∗[D]▹H is derivable and Δ∗F⊨H\Delta * F \models HΔ∗F⊨H, then D≤cFD \le_c FD≤c​F.
  5. Lemma 3.20. Incompat(Δ)\mathrm{Incompat}(\Delta)Incompat(Δ) and ¬Elsewhere(Δ)\neg\mathrm{Elsewhere}(\Delta)¬Elsewhere(Δ) are semantically equivalent.
  6. Lemma 3.23. Six algebraic properties of subtraction, including min⁡(F1∨⋯∨Fn)=G1∨⋯∨Gn\min(F_1 \vee \dots \vee F_n) = G_1 \vee \dots \vee G_nmin(F1​∨⋯∨Fn​)=G1​∨⋯∨Gn​ with Gi=((Fi−F1)⋯−Fn)G_i = ((F_i - F_1)\cdots - F_n)Gi​=((Fi​−F1​)⋯−Fn​).
  7. Quantifier removal for pure formulae (§3.4.4). ∃X.Π\exists X.\Pi∃X.Π is equivalent to a computable pure formula without XXX.
  8. Subtraction with quantifiers (§3.4.4). (∃X⃗.Δ)−(∃Y⃗.Δ′)(\exists\vec X.\Delta) - (\exists\vec Y.\Delta')(∃X.Δ)−(∃Y.Δ′) is a computable disjunction of symbolic heaps.

Significance

The result. Semantically the best solution is min⁡(Δ− ⁣ ⁣∗H)\min(\Delta \mathbin{-\!\!*} H)min(Δ−∗H) (Theorem 3.13 of the paper), a formula that nests − ⁣ ⁣∗-\!\!*−∗ and negation around ∗*∗, which no automatic separation-logic prover handles and which says nothing directly about the shape of the missing memory. Theorem 3.25 shows that in the points-to fragment this object collapses to a finite disjunction of symbolic heaps, the format in which an analysis draws "pictures of memory", and that it can be computed. It gives an optimal abduction procedure against which the paper's heuristic procedure can be measured.

Formalizing it. The theorem is proved in the paper, but several steps are given as sketches ("the proof of each of these properties is straightforward", "a straightforward exercise"), Lemma 3.18 has only a proof sketch, and the quantifier-free subtraction display on p. 33 is incomplete as printed (it inspects only the points-to facts and not the pure part of the subtracted heap). A machine-checked development would supply the missing arguments, fix the subtraction step, and give a verified reference implementation of optimal abduction for points-to symbolic heaps. No part of it is known to have been formalized.

Difficulty

The obvious route is to compute min⁡(Δ− ⁣ ⁣∗H)\min(\Delta \mathbin{-\!\!*} H)min(Δ−∗H) directly, but − ⁣ ⁣∗-\!\!*−∗ quantifies over all heaps, and symbolic heaps have no syntax for it. The paper splits the problem into three phases (a ≤c\le_c≤c​-minimal solution from a proof system, the incompatible solutions, and min⁡\minmin), and each phase carries its own difficulty. The proof system's minimality (Lemma 3.19) must hold against arbitrary semantic predicates, not only symbolic heaps, and it fails as soon as Δ\DeltaΔ may denote more than one heap for a given stack (the paper notes that adding list segments breaks it). Computing min⁡\minmin needs subtraction of symbolic heaps with quantifiers, which in turn needs quantifier elimination for Boolean combinations of equalities over an infinite domain, and the paper's quantifier-free subtraction step has to be repaired. Showing that the final disjunction is ≾\precsim≾-least, not merely a solution, needs all three phases.

Formalization scope

All statements live in the namespace BiAbduction.Systematic. Values are ℕ with nil 0, locations are the nonzero naturals, variables are ℕ (program and logical variables form one sort), and heaps are maps ℕ → Option ℕ with 0 unallocated and finite domain. Finiteness of heaps is essential, since min⁡\minmin relies on well-foundedness of the subheap order. Predicates are arbitrary Set (Stack × Heap). The syntax is built from ℕ, Bool, Sum, Prod and List by abbreviations, so "computed by an algorithm" is Mathlib's Computable₂ with the standard Primcodable encodings. The left-hand side Δ\DeltaΔ has no true conjunct, as in the paper's proofs; the right-hand side may have one. Figure 2 is an inductive relation in which psto may match any right-hand points-to fact. The soundness and ≤c\le_c≤c​-minimality statements assume the paper's bound-variable convention (no variable bound in HHH occurs in Δ\DeltaΔ); the goal does not need it.

The goal cannot be met by a degenerate reading. The competitors MMM range over all predicates, not only over disjunctions, and computability refers to fixed standard encodings. The points-to semantics excludes nil addresses, and heaps are finite.

A complete development needs the separation-logic algebra of predicates (associativity and commutativity of ∗*∗, the adjunction between ∗*∗ and − ⁣ ⁣∗-\!\!*−∗), properties of min⁡\minmin under finite heaps, the soundness and minimality of the proof system, quantifier elimination for equality logic, and a computability argument for list-manipulating procedures. The semantic layer and the quantifier-elimination result are reusable beyond this mission. Contributions to any milestone, and to the supporting lemmas of §3.3 (Lemmas 3.10–3.11, Theorem 3.13), are welcome.

Theorem numbers and page references are those of the accepted manuscript of the J. ACM article (72 pages), not of the typeset journal version.

Selected references

  • C. Calcagno, D. Distefano, P. W. O'Hearn, H. Yang, Compositional Shape Analysis by means of Bi-Abduction, Journal of the ACM 58(6), Article 26, 2011. https://doi.org/10.1145/2049697.2049700
  • C. Calcagno, D. Distefano, P. W. O'Hearn, H. Yang, Compositional Shape Analysis by means of Bi-Abduction, POPL 2009. https://doi.org/10.1145/1480881.1480917
  • J. Berdine, C. Calcagno, P. W. O'Hearn, Symbolic Execution with Separation Logic, APLAS 2005. https://doi.org/10.1007/11575467_5
  • J. C. Reynolds, Separation Logic: A Logic for Shared Mutable Data Structures, LICS 2002. https://doi.org/10.1109/LICS.2002.1029817
  • D. Pym, P. W. O'Hearn, H. Yang, Possible Worlds and Resources: The Semantics of BI, Theoretical Computer Science 315(1), 2004. https://doi.org/10.1016/j.tcs.2003.11.020
13 thms2 active usersReviewed
🏆Completed
Theoretical Computer Science·Captain: mikedeng1

Reaching Agreement in the Presence of Faults 3: With Authenticated Messages, the S_pq Procedure Assures Interactive Consistency for m Faults for Every n ≥ mResearch Paper

Motivation

Processors in a distributed system may hold separate readings of a sensor, clock, or diagnostic result while some processors give misleading reports. The aim of interactive consistency is for every functioning processor to compute the same vector of reported values and to put each functioning processor's actual private value in its corresponding position. A shared vector can then be used for a common decision. Pease, Shostak, and Lamport formulated this problem for isolated processors communicating by two-party messages; their paper discusses clock synchronization, input stabilization, and diagnostic tests as concrete applications Pease–Shostak–Lamport 1980.

In the paper's oral-message model, faulty processors can invent reports about values they received from others. The other two missions in this series formalize the recursive majority procedure for n≥3m+1n\ge 3m+1n≥3m+1 and the matching impossibility result below that bound. Section 5 changes the communication assumption: a faulty processor may refuse to pass on a received value but cannot pass on an altered value as if it came from its original sender. Under that assumption, the authors give a procedure for every n≥mn\ge mn≥m, including configurations outside the oral-message threshold Pease–Shostak–Lamport 1980, §§3–5.

Setting

Let PPP be a finite set of nnn processors and VVV a type of private values. Each processor q∈Pq\in Pq∈P has a value σ(q)∈V\sigma(q)\in Vσ(q)∈V. A scenario σ\sigmaσ records the values reported along chains of processors. A string p1p2⋯prp_1p_2\cdots p_rp1​p2​⋯pr​ is read from receiver to originator: p1p_1p1​ receives a report ultimately attributed to prp_rpr​. A recorded value may be NIL, meaning that no authenticated value is available. The view available to receiver ppp is its ppp-scenario, the restriction w↦σ(pw)w\mapsto\sigma(pw)w↦σ(pw); it contains no report that begins with a different receiver.

Choose a set N⊆PN\subseteq PN⊆P of nonfaulty processors. At most mmm processors may be faulty, expressed as ∣P∣≤∣N∣+m|P|\le |N|+m∣P∣≤∣N∣+m. An authenticated scenario consistent with NNN obeys two conditions whenever the displayed strings are in the (m+1)(m+1)(m+1)-level scenario. If p∈Np\in Np∈N and q∈Pq\in Pq∈P, the report made by nonfaulty relay ppp is truthful: σ(qpw)=σ(pw)\sigma(qpw)=\sigma(pw)σ(qpw)=σ(pw). For any prefix w′w'w′, a chain passing through nonfaulty ppp carries either the value at ppp or NIL: σ(w′pw)∈{σ(pw),NIL}\sigma(w'pw)\in\{\sigma(pw),\mathrm{NIL}\}σ(w′pw)∈{σ(pw),NIL}. The second condition allows omission by later relays while excluding a changed value falsely attributed to ppp Pease–Shostak–Lamport 1980, p. 233.

For each receiver ppp and originator qqq, the procedure forms SpqS_{pq}Spq​, the set of all non-NIL values in ppp's view on strings pwqpwqpwq. The intermediate string www has at most mmm distinct letters, all in P∖{p,q}P\setminus\{p,q\}P∖{p,q}. Receiver ppp records the sole value in SpqS_{pq}Spq​ when this set is a singleton; otherwise it records NIL. The resulting entries, one for each q∈Pq\in Pq∈P, form ppp's proposed consistency vector Pease–Shostak–Lamport 1980, p. 233.

Formalization targets

The first milestone covers a nonfaulty originator qqq: every nonfaulty receiver ppp sees exactly its true value. The second covers a faulty originator: the set of non-NIL values seen by one nonfaulty receiver is contained in the set seen by another. The same statement with the receivers exchanged gives equality of their sets.

The goal is the procedure's full interactive-consistency guarantee, for every choice of NNN and every authenticated scenario satisfying the conditions above:

Rp(q)=σ(q)(p,q∈N),Rp(r)=Rp′(r)(p,p′∈N, r∈P).\begin{aligned} R_p(q)&=\sigma(q) &&(p,q\in N),\\ R_p(r)&=R_{p'}(r) &&(p,p'\in N,\ r\in P). \end{aligned}Rp​(q)Rp​(r)​=σ(q)=Rp′​(r)​​(p,q∈N),(p,p′∈N, r∈P).​

Here Rp(r)R_p(r)Rp​(r) is the optional value recorded by processor ppp for processor rrr. Both clauses matter: agreement alone could be achieved by always recording NIL, while correct nonfaulty entries alone would leave faulty entries inconsistent.

Significance

The result identifies an exact communication assumption under which the paper's 3m+13m+13m+1 oral-message bound no longer governs the procedure. Even if a faulty originator gives conflicting values, nonfaulty receivers finish with identical entries for that originator; if an originator is nonfaulty, they retain its actual value. The paper describes authenticators as a practical approximation to the assumption, but the guarantee here is a mathematical statement about scenarios satisfying its two conditions, not a probability claim about a cryptographic implementation Pease–Shostak–Lamport 1980, §5.

Formalizing this result supplies precise interfaces for authenticated scenario consistency, local views, the set SpqS_{pq}Spq​, and the recording rule. The paper proves the result on pp. 233–234; this mission asks for a machine-checked proof of those statements in Lean. The scenario and local-view definitions can support later formalizations of message-passing protocols with truthful or omissible relays. Contributions that establish the two source milestones and the final guarantee, or develop reusable list and finite-set facts needed by them, are within scope.

Difficulty

The case of a faulty originator is the central difficulty. Its private value has no required relationship to what different nonfaulty receivers hear, so simply asserting that every receiver obtains the same direct report is unjustified. A faulty relay may also omit a report, which makes equality of raw scenario entries too strong. The target must compare sets of non-NIL values obtained along admissible relay chains. At the longest allowed chain, the length bound prevents adding another relay, and the number of faulty processors is needed to establish that an admissible nonfaulty relay occurs in the chain Pease–Shostak–Lamport 1980, p. 234.

Formalization scope

Lean represents processors by a finite set P : Finset α, values by a type V, strings by List α, and NIL by none : Option V. A scenario is a total function from strings to optional values. Only strings over PPP of length at most m+2m+2m+2 are constrained by authenticated consistency, matching the (m+1)(m+1)(m+1)-level scenario that the procedure reads. A single-letter string has a non-NIL private value for every processor in PPP. Conditions (i) and (ii) constrain nonfaulty relays only; condition (ii) allows either the original value or NIL for every prefix over PPP, including an empty prefix.

The procedure is applied only to ppp's view w↦σ(pw)w\mapsto\sigma(pw)w↦σ(pw), so it has no access to the full scenario or to NNN. Its intermediate strings are repetition-free, exclude both ppp and qqq, and have length at most mmm. The set SpqS_{pq}Spq​ contains values in VVV, not NIL; an empty set and a set with multiple values both cause a NIL record. The formal theorem retains the printed n≥mn\ge mn≥m condition, although it is not needed in the proof of the stated set relationships. It also covers p=qp=qp=q, m=0m=0m=0, and empty or singleton processor sets when their quantified conditions apply. These conventions rule out an always-NIL decision rule and the trivial rule that reads σ(q)\sigma(q)σ(q) from outside the receiver's view.

The cryptographic maps ApA_pAp​, their message encodings, and the paper's assertion that practical authenticators can meet the assumption with arbitrarily high probability are outside scope. The formal result assumes the two exact authenticated-scenario conditions. A complete development needs finite-set cardinality and list facts, especially about distinct relay strings and bounded concatenation; these facts can be reused for other authenticated relay models.

Selected references

  • M. Pease, R. Shostak, and L. Lamport, Reaching Agreement in the Presence of Faults, Journal of the ACM 27(2), 1980, 228–234. DOI: 10.1145/322186.322188.
5 thms2 active usersReviewed
🏆Completed
Theoretical Computer Science·Captain: mikedeng1

Reaching Agreement in the Presence of Faults 2: If |V| ≥ 2 and 3 ≤ n ≤ 3m, No Family {F_p} Assures Interactive Consistency for m Faults, However Many Rounds Are UsedResearch Paper

Motivation

A fault-tolerant system built from several processors must let its working processors act on the same data, even though some processors may have failed in ways nobody can predict: a failed processor may stop relaying information, relay something it invented, or tell different processors different things. Pease, Shostak and Lamport (J. ACM 27 (1980) 228–234) isolated the core question in the setting of the SIFT aircraft-control computer: each of nnn processors holds a private value, at most mmm processors are faulty, and processors communicate only by two-party messages. Can the nonfaulty processors each compute a vector of values, one entry per processor, such that all nonfaulty processors compute the same vector and the entry of each nonfaulty processor is its true private value? This requirement is called interactive consistency.

The paper answers with a sharp threshold. Interactive consistency can be achieved when n≥3m+1n\ge 3m+1n≥3m+1 (Section 3), and it cannot be achieved when n≤3mn\le 3mn≤3m, however many rounds of message exchange are allowed (Section 4). With unforgeable signatures it can be achieved for every n≥mn\ge mn≥m (Section 5). The impossibility half is the origin of the "3m+13m+13m+1" bound that appears throughout Byzantine fault tolerance, popularised two years later as the Byzantine Generals Problem (Lamport, Shostak, Pease, ACM TOPLAS 4 (1982)). This mission is the impossibility theorem.

Timeline:

  • 1980: Pease, Shostak and Lamport prove the threshold n≥3m+1n\ge 3m+1n≥3m+1 for interactive consistency with oral messages, including the impossibility for n≤3mn\le 3mn≤3m stated in terms of scenarios.
  • 1982: Lamport, Shostak and Pease restate the problem as the Byzantine Generals Problem, with the same bound.
  • 1985–1986: Fischer, Lynch and Merritt give a short "hexagon" proof of the same bound for several agreement problems (Distributed Computing 1 (1986)).

Setting

Let PPP be a finite set of nnn processors and VVV a set of values. Write P∗P^*P∗ for the set of strings over PPP (the empty string included) and P+P^+P+ for the nonempty strings. A string p1p2⋯prp_1p_2\cdots p_rp1​p2​⋯pr​ is read as a chain of reports: p1p_1p1​ was told by p2p_2p2​ that …\dots… pr−1p_{r-1}pr−1​ was told by prp_rpr​ that prp_rpr​'s private value is the recorded value.

A scenario is a map σ:P+→V\sigma: P^+\to Vσ:P+→V. The value σ(p)\sigma(p)σ(p) is processor ppp's private value, and σ(p1⋯pr)\sigma(p_1\cdots p_r)σ(p1​⋯pr​) is the value p1p_1p1​ received for the chain p2⋯prp_2\cdots p_rp2​⋯pr​. For p∈Pp\in Pp∈P, the ppp-scenario σp\sigma_pσp​ is the restriction of σ\sigmaσ to the strings beginning with ppp: everything ppp ever learns.

For a set N⊆PN\subseteq PN⊆P of nonfaulty processors, σ\sigmaσ is consistent with NNN if

σ(pqw)=σ(qw)for all q∈N, p∈P, w∈P∗,\sigma(pqw)=\sigma(qw)\qquad\text{for all }q\in N,\ p\in P,\ w\in P^*,σ(pqw)=σ(qw)for all q∈N, p∈P, w∈P∗,

that is, every nonfaulty processor reports truthfully what it knows or hears. Faulty processors are unconstrained.

A decision family assigns to each p∈Pp\in Pp∈P a map FpF_pFp​ that takes a ppp-scenario and a processor qqq and returns a value Fp(σp,q)∈VF_p(\sigma_p,q)\in VFp​(σp​,q)∈V: the entry ppp computes for qqq. The family assures interactive consistency for mmm faults if for every N⊆PN\subseteq PN⊆P with ∣N∣≥n−m|N|\ge n-m∣N∣≥n−m and every scenario σ\sigmaσ consistent with NNN,

  1. Fp(σp,q)=σ(q)F_p(\sigma_p,q)=\sigma(q)Fp​(σp​,q)=σ(q) for all p,q∈Np,q\in Np,q∈N;
  2. Fp(σp,r)=Fq(σq,r)F_p(\sigma_p,r)=F_q(\sigma_q,r)Fp​(σp​,r)=Fq​(σq​,r) for all p,q∈Np,q\in Np,q∈N, r∈Pr\in Pr∈P.

In the Lean development these are InteractiveConsistency.Impossibility.ConsistentWith P N σ and AssuresIC P m F, with restrict σ p the ppp-scenario.

Formalization targets

Goal: the THEOREM of Section 4

If ∣V∣≥2|V|\ge 2∣V∣≥2 and

3≤n≤3m,3\le n\le 3m,3≤n≤3m,

then no family {Fp∣p∈P}\{F_p\mid p\in P\}{Fp​∣p∈P} assures interactive consistency for mmm faults. Since scenarios are defined on strings of every length, no bound on the number of rounds is assumed.

Milestones, in the order the proof of the paper uses them

  1. If 3≤n≤3m3\le n\le 3m3≤n≤3m, then PPP is the disjoint union of three nonempty sets AAA, BBB, CCC, each with at most mmm members (p. 232).
  2. For such a partition and values v,v′v,v'v,v′, the scenarios α,β,σ\alpha,\beta,\sigmaα,β,σ that the page defines by recursion on the length of strings are consistent with A∪CA\cup CA∪C, B∪CB\cup CB∪C and A∪BA\cup BA∪B respectively (p. 233).
  3. For the same scenarios, α(aw)=σ(aw)\alpha(aw)=\sigma(aw)α(aw)=σ(aw) and β(bw)=σ(bw)\beta(bw)=\sigma(bw)β(bw)=σ(bw) for all a∈Aa\in Aa∈A, b∈Bb\in Bb∈B, w∈P∗w\in P^*w∈P∗ (p. 233).

Significance

The theorem shows that the algorithm of Section 3 is optimal in its fault tolerance: with oral messages, n≥3m+1n\ge 3m+1n≥3m+1 processors are not only sufficient but necessary. Every later lower bound for Byzantine agreement, Byzantine broadcast and approximate agreement with unauthenticated messages rests on this bound or a variant of its argument, and it is the reason replicated state machines tolerating mmm Byzantine faults use 3m+13m+13m+1 replicas. It also explains why Section 5 needs authentication: the argument depends on faulty processors being able to relay fabricated values.

The result has been proved since 1980; what is open here is its formalization. Nothing on Prove2Me models message-passing agreement, and this mission states the theorem in the paper's own model: scenarios on unbounded strings and decision functions of a single ppp-scenario. The mission produces a reusable vocabulary (scenarios, consistency, interactive consistency) and the explicit three-scenario construction.

Difficulty

The obvious attempt is to argue round by round about what a processor can know after kkk rounds; with unboundedly many rounds this never terminates in a contradiction. The paper's argument instead needs three entire scenarios, each a legitimate behaviour for a different set of faulty processors, that two processors cannot tell apart from their own views. Writing these scenarios down so that consistency holds on every string while the indistinguishability survives on every string is the delicate part: the faulty set of each scenario must relay exactly the values that keep the other scenario's view intact, and one of the defining equations (β(paw)=α(aw)\beta(paw)=\alpha(aw)β(paw)=α(aw)) looks like a misprint but is what the argument requires. The counting step is elementary but carries the hypothesis n≥3n\ge 3n≥3 that the printed theorem leaves implicit.

Formalization scope

Processors are a Finset P in a type with decidable equality; strings are lists read left to right (p1p_1p1​ is the head of the list); a scenario is a total function List α → V whose values on the empty list and on lists with a letter outside PPP carry no meaning: every condition quantifies only over strings whose letters lie in PPP. Decision functions have type α → (List α → V) → α → V and are applied only to the ppp-scenario fun w => σ (p :: w), never to σ\sigmaσ; giving FpF_pFp​ the whole scenario would make the problem trivial (output σ(q)\sigma(q)σ(q)). Consistency with NNN constrains only relays by members of NNN, and includes the empty www. The quorum ∣N∣≥n−m|N|\ge n-m∣N∣≥n−m is written ∣P∣≤∣N∣+m|P|\le |N|+m∣P∣≤∣N∣+m, which avoids truncated subtraction on N\mathbb NN. ∣V∣≥2|V|\ge 2∣V∣≥2 is the existence of two distinct values.

Explicit readings of the page:

  • The printed hypothesis "n≥3mn\ge 3mn≥3m" is a misprint for n≤3mn\le 3mn≤3m (the proof opens "Since n≤3mn\le 3mn≤3m", and the section title is "Proof of Impossibility for n<3m+1n<3m+1n<3m+1"); with n≥3mn\ge 3mn≥3m the statement is false.
  • The hypothesis n≥3n\ge 3n≥3 is implicit in the proof's "three nonempty sets". It is necessary: for n≤2n\le 2n≤2 the family Fp(σp,q)=σ(pq)F_p(\sigma_p,q)=\sigma(pq)Fp​(σp​,q)=σ(pq) assures interactive consistency.
  • In the construction, each letter aaa, bbb, ccc ranges independently over AAA, BBB, CCC (so "α(cc)\alpha(cc)α(cc)" covers α(c′c)\alpha(c'c)α(c′c)); the value σ(c′cw)\sigma(c'cw)σ(c′cw), which the page leaves unspecified, is fixed to σ(cw)\sigma(cw)σ(cw).
  • The construction is stated as a definition, and the two "easy" claims about it (consistency, indistinguishability) are separate milestones.

A complete development needs only finite sets and lists from Mathlib. The vocabulary of p. 232 is shared with the other two missions of this series, Reaching Agreement in the Presence of Faults 1 (the algorithm for n≥3m+1n\ge 3m+1n≥3m+1) and 3 (authenticated messages, n≥mn\ge mn≥m), each of which defines it in its own namespace. Proofs of the milestones and of the goal are welcome, as is a proof of the goal by a different route.

Selected references

  • M. Pease, R. Shostak, L. Lamport, Reaching agreement in the presence of faults, Journal of the ACM 27(2) (1980) 228–234. https://doi.org/10.1145/322186.322188
  • L. Lamport, R. Shostak, M. Pease, The Byzantine Generals Problem, ACM Transactions on Programming Languages and Systems 4(3) (1982) 382–401. https://doi.org/10.1145/357172.357176
  • M. J. Fischer, N. A. Lynch, M. Merritt, Easy impossibility proofs for distributed consensus problems, Distributed Computing 1 (1986) 26–39. https://doi.org/10.1007/BF01843568
6 thms2 active usersReviewed
🏆Completed
Theoretical Computer Science·Captain: mikedeng1

Reaching Agreement in the Presence of Faults 1: With n ≥ 3m + 1 Processors, the Recursive Majority Procedure on (m + 1)-Level Scenarios Assures Interactive Consistency for m FaultsResearch Paper

Motivation

A fault-tolerant system often replicates a computation on several processors and needs the nonfaulty ones to act on the same data, even though some processors may fail in arbitrary ways: send wrong values, send different values to different recipients, or lie about what they were told. Pease, Shostak and Lamport posed the question in 1980, motivated by the SIFT fault-tolerant aircraft-control computer under development at SRI (Wensley et al. 1978), where it arises in clock synchronization among other places: nnn processors, at most mmm of them faulty, communicate by two-party messages whose sender is always identifiable, and each holds a private value. Can the nonfaulty processors all compute the same vector of values, one entry per processor, whose entry for every nonfaulty processor is that processor's true value? The paper (J. ACM 27 (1980) 228–234) calls this interactive consistency and settles it: possible if and only if n≥3m+1n \ge 3m+1n≥3m+1 when messages can be forged in relay, and possible for every n≥mn \ge mn≥m when they cannot. The same problem, under the name Byzantine generals, became the standard model of arbitrary ("Byzantine") failures in distributed computing (Lamport, Shostak & Pease 1982); the 3m+13m+13m+1 bound underlies the quorum sizes of later replication protocols.

This mission covers the positive half of the paper's characterization: Section 3's recursive procedure, which achieves interactive consistency with n≥3m+1n\ge 3m+1n≥3m+1 processors in m+1m+1m+1 rounds of message exchange.

Setting

Let PPP be a finite set of n=∣P∣n = |P|n=∣P∣ processors and VVV a set of values. A string over a set SSS is a finite sequence p1p2⋯prp_1p_2\cdots p_rp1​p2​⋯pr​ of elements of SSS, repetitions allowed. For k≥1k\ge 1k≥1 a kkk-level scenario is a map σ\sigmaσ from the nonempty strings over PPP of length at most k+1k+1k+1 to VVV. The value σ(p)\sigma(p)σ(p) is ppp's private value VpV_pVp​; for r≥2r\ge 2r≥2, σ(p1p2⋯pr)\sigma(p_1p_2\cdots p_r)σ(p1​p2​⋯pr​) is the value p2p_2p2​ tells p1p_1p1​ that p3p_3p3​ told p2p_2p2​ … that prp_rpr​ told pr−1p_{r-1}pr−1​ is prp_rpr​'s private value. A kkk-level scenario records the outcome of kkk rounds of message exchange.

Faults are modeled by a set N⊆PN\subseteq PN⊆P of nonfaulty processors, unknown to the processors. Nonfaulty processors relay truthfully, so σ\sigmaσ is consistent with NNN when

σ(pqw)=σ(qw)(q∈N, p∈P, w a string over P, ∣pqw∣≤k+1).\sigma(pqw) = \sigma(qw)\qquad (q\in N,\ p\in P,\ w \text{ a string over } P,\ |pqw|\le k+1).σ(pqw)=σ(qw)(q∈N, p∈P, w a string over P, ∣pqw∣≤k+1).

Faulty processors are otherwise unconstrained. A processor ppp sees only its view σp\sigma_pσp​, the restriction of σ\sigmaσ to strings beginning with ppp.

The procedure (p. 230). Processor ppp computes the entry for processor qqq as follows, with nnn and mmm the current processor count and fault bound:

  1. If some Q⊆PQ\subseteq PQ⊆P with ∣Q∣>(n+m)/2|Q|>(n+m)/2∣Q∣>(n+m)/2 and some vvv satisfy σp(pwq)=v\sigma_p(pwq)=vσp​(pwq)=v for every string www over QQQ of length ≤m\le m≤m, record vvv.
  2. Otherwise apply the procedure for m−1m-1m−1, n−1n-1n−1 to the processor set P−{q}P-\{q\}P−{q} and the view σ^p(pw)=σp(pwq)\hat\sigma_p(pw)=\sigma_p(pwq)σ^p​(pw)=σp​(pwq), obtaining a vector of n−1n-1n−1 entries. If at least ⌊(n+m)/2⌋\lfloor (n+m)/2\rfloor⌊(n+m)/2⌋ of them agree, record the common value; otherwise record NIL.

In Lean this is InteractiveConsistency.OralAlgorithm.record m P τ q with τ = fun w => σ (p :: w), values in Option V with none for NIL.

Formalization targets

Goal: the procedure assures interactive consistency

For n≥3m+1n\ge 3m+1n≥3m+1, for every N⊆PN\subseteq PN⊆P with ∣N∣≥n−m|N|\ge n-m∣N∣≥n−m and every (m+1)(m+1)(m+1)-level scenario σ\sigmaσ consistent with NNN,

record(m,P,σp,q)=σ(q)(p,q∈N),record(m,P,σp,r)=record(m,P,σp′,r)(p,p′∈N, r∈P).\mathrm{record}(m,P,\sigma_p,q)=\sigma(q)\quad(p,q\in N),\qquad \mathrm{record}(m,P,\sigma_p,r)=\mathrm{record}(m,P,\sigma_{p'},r)\quad(p,p'\in N,\ r\in P).record(m,P,σp​,q)=σ(q)(p,q∈N),record(m,P,σp​,r)=record(m,P,σp′​,r)(p,p′∈N, r∈P).

This is procedure_assures_ic. It is the paper's claim about this procedure, not an existence statement.

Milestones, in the order the paper's proof uses them

  1. Nonfaulty qqq (p. 231): for p,q∈Np,q\in Np,q∈N, step (1) succeeds and ppp records VqV_qVq​.
  2. Two step-(1) quorums agree (p. 231): if p,p′∈Np,p'\in Np,p′∈N find quorums Q1,Q2Q_1,Q_2Q1​,Q2​ with values v,v′v,v'v,v′, then v=v′v=v'v=v′.
  3. The subscenario (p. 230): for faulty qqq, σ^(w)=σ(wq)\hat\sigma(w)=\sigma(wq)σ^(w)=σ(wq) is an mmm-level scenario on P−{q}P-\{q\}P−{q} consistent with NNN, and ∣N∣≥(n−1)−(m−1)|N|\ge (n-1)-(m-1)∣N∣≥(n−1)−(m−1).
  4. The Q^\hat QQ^​ claim (p. 231): if Q,vQ,vQ,v satisfy step (1) for p′p'p′ and qqq, then Q^=Q−{q}\hat Q=Q-\{q\}Q^​=Q−{q} has at least ⌊(n+m)/2⌋\lfloor(n+m)/2\rfloor⌊(n+m)/2⌋ members and Q^,v\hat Q, vQ^​,v satisfy step (1) of the recursive call for every q′∈Q^q'\in\hat Qq′∈Q^​.

Significance

The theorem is the upper bound in the tight characterization n≥3m+1n\ge 3m+1n≥3m+1 of when interactive consistency is achievable with unauthenticated messages; the matching impossibility (the paper's Section 4 THEOREM) shows that no procedure, with any number of rounds, does better. The procedure is the ancestor of the "oral messages" algorithm OM(m)\mathrm{OM}(m)OM(m) of the Byzantine generals paper, and its quorum arithmetic (∣Q∣>(n+m)/2|Q|>(n+m)/2∣Q∣>(n+m)/2, intersections of two quorums containing a nonfaulty member) recurs throughout Byzantine fault-tolerant replication.

The result is proved in the paper, in a half-page induction. What this mission adds is a machine-checked proof against an explicit model of scenarios, views and consistency with a bounded number of rounds. Machine-checked proofs exist for the related OM(m)\mathrm{OM}(m)OM(m) algorithm of the later Byzantine generals paper in other proof systems; this procedure, with its quorum-based step (1), has to our knowledge not been formalized in Lean, and nothing on message-passing agreement exists on this platform.

Difficulty

Each step of the paper's proof is short, but the bookkeeping is where an argument breaks. The recursion changes three things at once: the processor set loses qqq, the fault bound drops by one, and the scenario becomes σ^(w)=σ(wq)\hat\sigma(w)=\sigma(wq)σ^(w)=σ(wq) of one level less. The induction hypothesis must therefore be stated for every finite processor set and every scenario, and applied to a subscenario whose consistency is inherited only for strings of the right length. The mixed case, where one nonfaulty processor exits at step (1) and another recurses, is the delicate one: the two processors' computations take different branches, and since qqq is faulty nothing forces either value to be qqq's private value. The thresholds are exact: ∣Q∣>(n+m)/2|Q|>(n+m)/2∣Q∣>(n+m)/2 in step (1) and ⌊(n+m)/2⌋\lfloor(n+m)/2\rfloor⌊(n+m)/2⌋ agreeing entries in step (2), both in the current nnn and mmm; off-by-one changes in either break the case analysis. Finally, step (2)'s majority value must be shown unique, so that two processors with the same vector record the same value.

Formalization scope

Processors form a Finset α with decidable equality; strings are List α, read left to right (the receiver first, the originator last), so σp(pwq)\sigma_p(pwq)σp​(pwq) is σ (p :: (w ++ [q])). A scenario is a total function List α → V; consistency with NNN (ConsistentUpTo P N (m + 1) σ) constrains it only on strings over PPP of length at most m+2m+2m+2, the domain of an (m+1)(m+1)(m+1)-level scenario and all the procedure reads. The procedure receives only the view fun w => σ (p :: w), never σ\sigmaσ or NNN. The fault hypothesis ∣N∣≥n−m|N|\ge n-m∣N∣≥n−m is P.card ≤ N.card + m; m=0m=0m=0 is included.

Explicit readings of the paper's prose: "size >(n+m)/2>(n+m)/2>(n+m)/2" is P.card + m < 2 * Q.card; ⌊(n+m)/2⌋\lfloor(n+m)/2\rfloor⌊(n+m)/2⌋ is natural-number division; "strings over QQQ of length ≤m\le m≤m" includes the empty string and allows repetitions; the step-(2) vector is indexed by P.erase q and includes ppp's own entry; the recorded value in step (1) is σp(pq)\sigma_p(pq)σp​(pq) (the empty string forces it); when several values reach the step-(2) threshold one is chosen deterministically from the vector (under the goal's hypotheses at most one does); for m=0m=0m=0 a failing step (1) records NIL (never reached under the hypotheses). Two printed slips are corrected in the Lean: "records VqV_qVq​ and qqq" (for "for qqq") and "σp′(p′wq′)\sigma_{p'}(p'wq')σp′​(p′wq′)" (for σ^p′\hat\sigma_{p'}σ^p′​).

Trivializing formalizations are ruled out: the procedure never sees σ\sigmaσ itself (with it, recording σ(q)\sigma(q)σ(q) would be trivial), consistency constrains only relays by nonfaulty processors, and NNN ranges over every subset of size at least n−mn-mn−m.

The development needs only finite sets and lists; no library beyond Mathlib is required. The quorum-intersection lemmas and the subscenario construction are reusable for other oral-message protocols. Contributions welcome: proofs of the four milestones, the goal by induction on mmm, and a computable version of the procedure for concrete instances. This is mission 1 of a series of three on this paper; mission 2 formalizes the impossibility THEOREM for n≤3mn\le 3mn≤3m (Section 4), and mission 3 the authenticated-message procedure for every n≥mn\ge mn≥m (Section 5).

Selected references

  • M. Pease, R. Shostak, L. Lamport, Reaching agreement in the presence of faults, Journal of the ACM 27(2), 1980, 228–234. https://doi.org/10.1145/322186.322188
  • L. Lamport, R. Shostak, M. Pease, The Byzantine generals problem, ACM Transactions on Programming Languages and Systems 4(3), 1982, 382–401. https://doi.org/10.1145/357172.357176
  • J. H. Wensley et al., SIFT: Design and analysis of a fault-tolerant computer for aircraft control, Proceedings of the IEEE 66(10), 1978, 1240–1255. https://doi.org/10.1109/PROC.1978.11114
7 thms2 active usersReviewed
🏆Completed
Theoretical Computer Science·Captain: mikedeng1

Consensus in the Presence of Partial Synchrony II: With Synchronous Processors, Partially Synchronous Communication and t Fail-Stop Faults, No Consensus Protocol Exists When 2 ≤ N ≤ 2tResearch Paper

Motivation

Consensus asks NNN processors, each holding an initial value, to agree on one value despite some of them failing. It underlies replicated databases, atomic commit and state-machine replication. Its solvability depends on the timing assumptions. With fully synchronous processors and communication, ttt fail-stop faults can be tolerated for any t<Nt < Nt<N. With fully asynchronous communication, Fischer, Lynch and Paterson showed that no deterministic protocol tolerates even one fail-stop fault (JACM 1985).

Dwork, Lynch and Stockmeyer (JACM 1988) introduced partial synchrony, a model between these two extremes. Message delays have an upper bound Δ\DeltaΔ, but either the bound is unknown to the protocol, or it holds only from an unknown time on. For each fault type they found the exact number of faults that can be tolerated. This mission formalizes the lower bound for fail-stop faults: when the processors are synchronous and communication is partially synchronous, no consensus protocol tolerates ttt faults once N≤2tN \le 2tN≤2t.

Timeline. 1985: Fischer, Lynch, Paterson, impossibility of consensus with one fail-stop fault under asynchrony. 1987: Dolev, Dwork, Stockmeyer, which combinations of synchrony assumptions admit consensus (JACM 1987). 1988: Dwork, Lynch, Stockmeyer, partial synchrony, with matching upper and lower bounds on resiliency for fail-stop, omission, authenticated Byzantine and Byzantine faults. The global stabilization time of the 1988 paper became a common liveness assumption for later fault-tolerant agreement protocols.

Setting

There are NNN processors p1,…,pNp_1, \dots, p_Np1​,…,pN​. Each processor holds an initial value vi∈{0,1}v_i \in \{0, 1\}vi​∈{0,1}. Each runs a deterministic protocol: a transition diagram over a possibly infinite set of states. In each state the next instruction is either Send(m,pj)\mathrm{Send}(m, p_j)Send(m,pj​), which puts message mmm in pjp_jpj​'s buffer, or Receive(pi)\mathrm{Receive}(p_i)Receive(pi​), which removes a set SSS of messages from pip_ipi​'s buffer and delivers it. The next state depends on the current state and, for a Receive, on SSS. A step never both sends and receives. Each state may record a decision, and the first decision a processor records is final.

Real time is the ticks 1,2,3,…1, 2, 3, \dots1,2,3,…. A run fixes the initial values and, at each tick, which processors take a step and which messages each Receive delivers. A message is delivered only after the tick at which it was sent, only to its addressee, and at most once.

  • Synchronous processors (Φ=1\Phi = 1Φ=1): every correct processor takes a step at every tick.
  • Fail-stop faults: a faulty processor follows the protocol until it stops, and it never restarts. A processor that stops at time 000 is initially dead.
  • Δ\DeltaΔ holds in [T,∞)[T, \infty)[T,∞): a message sent at a tick s1≥Ts_1 \ge Ts1​≥T is delivered no later than any Receive of its addressee at a tick s2≥s1+Δs_2 \ge s_1 + \Deltas2​≥s1​+Δ.
  • Delta holds eventually: Δ\DeltaΔ is a fixed positive integer known to the protocol. In every run, Δ\DeltaΔ holds in [T,∞)[T, \infty)[T,∞) for some unknown global stabilization time TTT. Messages sent before TTT may be delayed arbitrarily or lost.
  • Delta is unknown: the protocol is fixed first. In every run, some positive Δ\DeltaΔ holds in [1,∞)[1, \infty)[1,∞).

A protocol is a ttt-resilient consensus protocol achieving weak unanimity if the following holds for every set CCC of at least N−tN - tN−t processors and every allowed run in which the processors of CCC are correct and the others fail-stop. No two processors of CCC decide differently (consistency). Every processor of CCC decides (termination). If all initial values are vvv and no processor is faulty, every decision is vvv (weak unanimity).

Formalization targets

Goal: Theorem 4.3

For integers t≤Nt \le Nt≤N with

2≤N≤2t,2 \le N \le 2t,2≤N≤2t,

there is no ttt-resilient consensus protocol achieving weak unanimity for binary values with fail-stop faults and synchronous processors. This holds for every positive Δ\DeltaΔ when Δ\DeltaΔ holds eventually, and when delta is unknown.

Milestones: the three scenarios of the proof

Split the processors into groups PPP and QQQ with 1≤∣P∣,∣Q∣≤t1 \le |P|, |Q| \le t1≤∣P∣,∣Q∣≤t.

  • Scenario A: all inputs 000 and QQQ initially dead. The processors of PPP decide by some time TAT_ATA​, and they decide 000.
  • Scenario B: all inputs 111 and PPP initially dead. The processors of QQQ decide 111 by some time TBT_BTB​.
  • Scenario C: all processors alive, PPP starting with 000 and QQQ with 111, and messages between the groups held back past a time TTT. Up to time TTT, every processor of PPP is in the same state as in Scenario A, and every processor of QQQ in the same state as in Scenario B.

Significance

The result. Theorem 4.3 shows that the resiliency N≥2t+1N \ge 2t + 1N≥2t+1 of the paper's fail-stop and omission protocols (Theorems 4.1 and 4.2) is optimal. It holds even under three restrictions: binary values, weak unanimity, and processors in perfect lock-step. Partial synchrony costs a majority of correct processors, whereas full synchrony costs nothing. The same scenarios give the authenticated Byzantine bound N≥3t+1N \ge 3t + 1N≥3t+1 (Theorem 4.4). The halting remark of Section 4.2 rests on an argument of the same kind.

The formalization. The theorem is proved in the paper, and its proof is short. It is not machine-checked anywhere known to the mission. No message-passing model is on the platform. This mission supplies one: a step-level model with buffers, per-message timing, fail-stop faults and both partially synchronous communication models. It also gives a machine-checked impossibility on top of that model. FLP, Theorem 4.4 and the lower bounds of Section 6 are natural follow-ups on the same definitions.

Difficulty

The informal proof is an indistinguishability argument. Making it formal means comparing different runs of the same deterministic protocol. Two points need care.

First, the scenarios must be allowed runs. Scenario C holds messages between the groups back past max⁡(TA,TB)\max(T_A, T_B)max(TA​,TB​). With delta unknown, this needs a Δ\DeltaΔ larger than that delay. When Δ\DeltaΔ holds eventually, Δ\DeltaΔ is fixed before the protocol, and the protocol fixes TAT_ATA​ and TBT_BTB​. So the delay is legal only for messages sent before the global stabilization time, which must therefore be placed after max⁡(TA,TB)\max(T_A, T_B)max(TA​,TB​). Read literally, "every message between the groups takes more than max⁡(TA,TB)\max(T_A, T_B)max(TA​,TB​) steps" is not an allowed run in this model.

Second, "the processors of PPP act exactly as they do in Scenario A" is a claim about whole runs. Two runs must agree on states, on which messages are in which buffer, and on when each message is delivered, tick by tick up to TTT. With one-to-one sends and atomic steps, "delivered in exactly time 1" also needs a reading: a processor that sends at the next tick cannot receive at that tick.

Formalization scope

All declarations live in the namespace DLSConsensus.LowerBound. Processor pip_ipi​ is the index i−1i - 1i−1 of Fin N. Values are Bool. The protocol's state type and message type are arbitrary types in Type, finite or infinite. R.state i n is the state after tick nnn. A message instance is identified in the run by its sender and send tick. A Receive hands the protocol each delivered message as (sender, content); the absolute send tick is not exposed.

Explicit readings and conventions:

  • "Fail-stop or omission faults": the goal is the fail-stop impossibility. It implies the omission case, because a fail-stop processor looks to the others like one whose sends are all omitted. The omission case is not a separate item.
  • A fail-stop processor may skip ticks before its final stop. The processor timing bound Φ=1\Phi = 1Φ=1 applies to correct processors.
  • "Decides": the first state that records a decision. Irreversibility therefore holds by definition.
  • "Delivered in exactly time 1": the message is delivered no later than the addressee's first Receive at least one tick after the send.
  • "Within time TAT_ATA​" and "for some finite TBT_BTB​": an explicit ∃\exists∃ before the decision bound.
  • "Messages between the groups take more than max⁡(TA,TB)\max(T_A, T_B)max(TA​,TB​) steps": no message between the groups is delivered at a tick ≤T\le T≤T, for any given TTT.
  • "Act exactly as they do": equal local states at every tick n≤Tn \le Tn≤T.
  • Quantifier order: when Δ\DeltaΔ holds eventually, Δ\DeltaΔ is chosen first, then the protocol, then the run with its stabilization time. When delta is unknown, the protocol is chosen first and each run carries its own Δ\DeltaΔ. In both models Δ>0\Delta > 0Δ>0.

Trivializing formalizations are ruled out. The model has allowed runs for every protocol, so Resilient is never vacuously true. Correct processors step at every tick, so termination does not fail for the wrong reason. Unanimity is the weak form, applied only when no processor is faulty.

Contributions welcome: a general simulation lemma (equal inputs up to a tick give equal states up to that tick), the construction of runs from a delivery schedule, and proofs of the scenarios. These parts are reusable for the other lower bounds of the paper.

Selected references

  • C. Dwork, N. Lynch, L. Stockmeyer, Consensus in the presence of partial synchrony, Journal of the ACM 35(2), 1988, 288–323. https://doi.org/10.1145/42282.42283
  • M. J. Fischer, N. A. Lynch, M. S. Paterson, Impossibility of distributed consensus with one faulty process, Journal of the ACM 32(2), 1985, 374–382. https://doi.org/10.1145/3149.214121
  • D. Dolev, C. Dwork, L. Stockmeyer, On the minimal synchronism needed for distributed consensus, Journal of the ACM 34(1), 1987, 77–97. https://doi.org/10.1145/7531.7533
5 thms2 active usersReviewed
🏆Completed
Theoretical Computer Science·Captain: mikedeng1

Consensus in the Presence of Partial Synchrony I: For N ≥ 2t + 1, Algorithm 1 Achieves Consistency, Strong Unanimity and Termination in the Basic Round Model with Fail-Stop or Omission FaultsResearch Paper

Motivation

Consensus asks NNN processors, each starting with a value, to agree on one value although some of them may be faulty. It underlies replicated databases, atomic commitment and state-machine replication. Two classical models bracket the problem. In a fully synchronous system, with known bounds on message delay and processor speed, consensus is solvable for many fault types. In a fully asynchronous system, Fischer, Lynch and Paterson showed in 1985 that no deterministic protocol tolerates even one fail-stop fault (FLP, J. ACM 1985).

Dwork, Lynch and Stockmeyer (J. ACM 35(2), 1988, 288–323) introduced partial synchrony between these extremes: message delays are bounded, but either the bound is unknown, or it holds only from an unknown global stabilization time (GST) on. This model, and the GST abstraction in particular, became the standard assumption under which practical consensus protocols (Paxos-style and Byzantine fault-tolerant replication) are proved live. The paper determines, for each fault type, the largest number ttt of faults that consensus can tolerate under partial synchrony. This mission formalizes its first positive result: for fail-stop and omission faults, N≥2t+1N \ge 2t+1N≥2t+1 processors suffice.

Setting

There are NNN processors p1,…,pNp_1,\dots,p_Np1​,…,pN​, an integer t≤Nt \le Nt≤N, and an arbitrary set VVV of values; processor pip_ipi​ starts with init(pi)∈V\mathrm{init}(p_i)\in Vinit(pi​)∈V.

In the basic round model (Section 3.1 of the paper), computation proceeds in rounds r=1,2,3,…r = 1, 2, 3, \dotsr=1,2,3,…. In each round every processor sends messages, each message is either delivered in that round or lost, and every processor then performs a state transition on the messages it received. Losses are described by a predicate deliv(r,q,p)\mathrm{deliv}(r,q,p)deliv(r,q,p). A set CCC of processors (the correct ones) and a round GST\mathrm{GST}GST constrain it: every message sent at a round r≥GSTr \ge \mathrm{GST}r≥GST from a processor of CCC to a processor of CCC is delivered. Before GST any message may be lost, and messages from or to processors outside CCC may be lost at any time. Processors outside CCC follow the protocol but lose sends and receptions (omission faults, which include fail-stop faults).

Algorithm 1 (Section 3.2.1) works as follows. Every processor keeps a set PROPER\mathrm{PROPER}PROPER, initially {init(p)}\{\mathrm{init}(p)\}{init(p)}, attaches it to every message, and merges in every PROPER set it receives. A processor may hold locks, each a value with an associated phase number; vvv is acceptable to ppp if ppp has no lock on a value other than vvv. Phase k≥1k \ge 1k≥1 belongs to pip_ipi​ when k≡i(modN)k \equiv i \pmod Nk≡i(modN). Trying phase kkk occupies rounds 4k−34k-34k−3, 4k−24k-24k−2, 4k−14k-14k−1:

  1. every processor sends the owner the list of its acceptable values that are in its PROPER set; the owner proposes, by an arbitrary choice, a value appearing in at least N−tN-tN−t of the lists received, if there is one;
  2. the owner broadcasts (lock v,k)(\mathrm{lock}\ v, k)(lock v,k); each receiver locks vvv with phase kkk;
  3. each receiver acknowledges; with at least t+1t+1t+1 acknowledgements the owner decides vvv.

Lock-release phase kkk is round 4k4k4k: every processor broadcasts its locks (v,h)(v,h)(v,h), and a lock on vvv with phase hhh is released on receipt of some (w,h′)(w,h')(w,h′) with w≠vw \ne vw=v and h′≥hh' \ge hh′≥h.

The correctness conditions (Section 2.4) for the set CCC are consistency (no two decisions of processors in CCC differ), termination (every processor in CCC decides), and strong unanimity (if all NNN initial values equal vvv, every decision in CCC is vvv).

Formalization targets

Goal: Theorem 3.1

For all N,tN, tN,t with N≥2t+1N \ge 2t+1N≥2t+1, every value type VVV, all initial values, every CCC with ∣C∣≥N−t|C| \ge N-t∣C∣≥N−t, every GST\mathrm{GST}GST, every delivery pattern allowed for CCC and GST\mathrm{GST}GST, and every admissible choice of proposals,

Algorithm 1 achievesConsistency(C) ∧ StrongUnanimity(C) ∧ Termination(C).\text{Algorithm 1 achieves}\quad \text{Consistency}(C)\ \wedge\ \text{StrongUnanimity}(C)\ \wedge\ \text{Termination}(C).Algorithm 1 achievesConsistency(C) ∧ StrongUnanimity(C) ∧ Termination(C).

This is the theorem as printed; it fixes no constants.

Milestones

  • Lemma 3.1: no two distinct values acquire locks with the same associated phase.
  • Lemma 3.2: if vvv is decided at the first phase kkk at which any decision is made, then at least t+1t+1t+1 processors lock vvv at phase kkk, and each keeps, from then on, a lock on vvv with phase at least kkk.
  • Lemma 3.3: immediately after a lock-release round 4k≥GST4k \ge \mathrm{GST}4k≥GST, the processors of CCC together hold locks on at most one value.
  • Round bound (Section 3.2.1, p. 298): every processor of CCC decides at some phase kkk with
4k−1≤GST+4(N+1).4k-1 \le \mathrm{GST} + 4(N+1).4k−1≤GST+4(N+1).

Significance

Theorem 3.1 shows that, against omission and fail-stop faults, partially synchronous communication costs nothing in resilience compared with a majority bound: N≥2t+1N \ge 2t+1N≥2t+1 suffices, and Section 4 of the paper shows that N≤2tN \le 2tN≤2t does not. The lock-and-release structure of Algorithm 1 (a value is decided only after a quorum locks it, and locks are released only on evidence of a later competing lock) recurs in later partially synchronous protocols, where safety must hold regardless of timing and liveness is obtained only after stabilization. The result separates the two concerns cleanly: consistency and strong unanimity hold in every run, while termination uses GST.

The result is proved in the paper; to the best of the available information it has not been formalized in Lean, and no distributed-computing model exists on Prove2Me. The mission produces a machine-checked model of the basic round model with a GST delivery guarantee, a full executable specification of Algorithm 1, and proofs of its safety and liveness. The paper's own proof of Lemma 3.3 is one line and the termination argument relies on "sufficient communication"; a formal proof must make these steps explicit.

Difficulty

The safety argument is an invariant over an unbounded number of phases with an arbitrary loss pattern: a lock on the decided value must be shown never to be released without being replaced by a higher lock on the same value, while competing locks on other values may exist at faulty or slow processors. The obvious argument ("after a decision, every later proposal must equal the decided value") is circular without a persistence statement for locks such as Lemma 3.2. Liveness requires reasoning about what every correct processor knows after GST (its PROPER set and the locks of the others), and it depends on processors sending lock-release and list messages even when these carry no locks or no acceptable values. Quorum counting with N−tN-tN−t and t+1t+1t+1 must be carried out over distinct senders.

Formalization scope

  • Processors are Fin N; the paper's pip_ipi​ is the processor of index i−1i-1i−1. Rounds start at 111; exec … 0 is the initial state and exec … r the state after round rrr. Phases start at 111.
  • The paper's "chooses one arbitrarily" is a parameter pick : ℕ → Set V → V, required only to pick an element of every nonempty candidate set, and universally quantified in every theorem.
  • The paper's "the behavior of the processors not in CCC is allowed by the fault type FFF" is read as: processors outside CCC run Algorithm 1, and any message from or to them may be lost (omission faults, containing fail-stop).
  • The GST guarantee covers a processor's messages to itself when it is in CCC; before GST self-messages may be lost like any other.
  • Every processor sends its list in round 4k−34k-34k−3 and its lock-release message in round 4k4k4k even when they are empty, since both carry the PROPER set (Section 3.2: PROPER sets are piggybacked on all messages).
  • A decision is the event DecidesAt p k v (owner of phase kkk, proposed vvv, at least t+1t+1t+1 acknowledgements in round 4k−14k-14k−1); consistency requires all such events of processors in CCC to agree.
  • "Decide by round GST+4(N+1)\mathrm{GST}+4(N+1)GST+4(N+1)" is read as: the deciding phase kkk satisfies 4k−1≤GST+4(N+1)4k-1 \le \mathrm{GST}+4(N+1)4k−1≤GST+4(N+1).
  • Not formalized: Remark 1's asymptotic claims, the PROPER simplifications for weak unanimity, Algorithms 2 and 3.

A formalization in which a run cannot exist, the delivery constraint is unsatisfiable, the choice of proposals is fixed, or faulty processors are absent (CCC = all processors) would trivialize the theorem; the model here admits runs in which processors decide, and CCC ranges over all sets of at least N−tN-tN−t processors.

Reusable beyond this mission: the round-based message-passing model with a GST delivery guarantee and omission faults. Contributions of general lemmas about runs (monotonicity of PROPER sets, persistence of locks, quorum intersection over Finset) are welcome.

Selected references

  • C. Dwork, N. Lynch, L. Stockmeyer, Consensus in the presence of partial synchrony, Journal of the ACM 35(2), 1988, 288–323. https://doi.org/10.1145/42282.42283
  • M. J. Fischer, N. A. Lynch, M. S. Paterson, Impossibility of distributed consensus with one faulty process, Journal of the ACM 32(2), 1985, 374–382. https://doi.org/10.1145/3149.214121
6 thms2 active usersReviewed
🏆Completed
Category TheoryLogicMathematical Logic+3·Captain: Alien60

Barrett–Halvorson 2016: Morita Equivalence Implies Categorical EquivalenceResearch Paper

Motivation

When are two scientific theories "the same theory in different words"? Philosophers of science have used two formal criteria. Definitional equivalence (Glymour) is strict: it requires a common definitional extension and therefore cannot relate theories with different numbers of sorts. Categorical equivalence (Halvorson, Weatherall) is liberal: it asks only that the categories of models be equivalent. It has been applied to classical mechanics, electromagnetism and Newtonian gravitation (Weatherall 2016; survey in Weatherall 2019).

Barrett and Halvorson (2016) proposed Morita equivalence as a syntactic criterion between these two. It allows definitions of new sorts (products, coproducts, subsorts, quotients) in addition to the usual definitions of new predicates and function symbols. Their main results place the new criterion strictly between the other two:

  • Morita equivalence implies categorical equivalence (their Theorem 5.1).
  • The converse fails (their Theorem 5.2).

This mission formalizes that comparison: the semantic core of Morita extensions, the implication, the separating example, and the paper's motivating "two kinds of things" example.

Setting

A signature Σ\SigmaΣ (Sig) consists of a type of sorts, function symbols f:σ1×⋯×σm→σf : \sigma_1\times\dots\times\sigma_m\to\sigmaf:σ1​×⋯×σm​→σ and predicate symbols p⊆σ1×⋯×σmp\subseteq\sigma_1\times\dots\times\sigma_mp⊆σ1​×⋯×σm​. Formulas (Formula L Γ) are built in a typed context Γ\GammaΓ from ⊥\bot⊥, ===, predicates, →\to→ and ∀\forall∀. A structure (Str) assigns a nonempty set to each sort and interprets the symbols. A theory TTT is a set of formulas in context, each read as its universal closure; a model of TTT is a structure satisfying them all.

The category Mod(T)\mathrm{Mod}(T)Mod(T) (Model T) has the models of TTT as objects and elementary embeddings as arrows: maps on every sort that preserve and reflect every formula. Theories T1,T2T_1,T_2T1​,T2​ are categorically equivalent (CategoricallyEquivalent) if Mod(T1)≃Mod(T2)\mathrm{Mod}(T_1)\simeq\mathrm{Mod}(T_2)Mod(T1​)≃Mod(T2​).

A Morita extension of a Σ\SigmaΣ-theory TTT (MoritaData L T) adds to Σ\SigmaΣ:

  • new sorts, each with its defining symbols:
    • a product σ\sigmaσ of σ1,σ2\sigma_1,\sigma_2σ1​,σ2​, with projections π1,π2\pi_1,\pi_2π1​,π2​;
    • a coproduct, with injections ρ1,ρ2\rho_1,\rho_2ρ1​,ρ2​;
    • a subsort cut out by a Σ\SigmaΣ-formula φ(x)\varphi(x)φ(x), with an injection iii;
    • a quotient by a Σ\SigmaΣ-formula φ(x1,x2)\varphi(x_1,x_2)φ(x1​,x2​), with a projection ε\varepsilonε;
  • new predicates and function symbols, each explicitly defined by a Σ\SigmaΣ-formula.

Each new symbol gets one defining axiom, and the symbols of one new sort share a single axiom. The extension T+T^+T+ (D.ext) is TTT together with these axioms. Each definition must satisfy its admissibility condition in every model of TTT:

DefinitionCondition
subsort∃x φ(x)\exists x\,\varphi(x)∃xφ(x)
quotientφ\varphiφ is an equivalence relation
function symbol∀x ∃!y φ(x,y)\forall x\,\exists!y\,\varphi(x,y)∀x∃!yφ(x,y)

The reduct gives a functor Π:Mod(T+)→Mod(T)\Pi:\mathrm{Mod}(T^+)\to\mathrm{Mod}(T)Π:Mod(T+)→Mod(T) (D.proj).

T1T_1T1​ and T2T_2T2​ are Morita equivalent (MoritaEquivalent) if two finite chains of Morita extensions T1⇝T1′T_1\rightsquigarrow T_1'T1​⇝T1′​ and T2⇝T2′T_2\rightsquigarrow T_2'T2​⇝T2′​ (MoritaReach) end in logically equivalent theories, that is, theories with the same models, over a common signature.

Formalization targets

Goal: Morita equivalence implies categorical equivalence

T1 Morita equivalent to T2  ⟹  Mod(T1)≃Mod(T2).T_1 \text{ Morita equivalent to } T_2 \;\Longrightarrow\; \mathrm{Mod}(T_1)\simeq\mathrm{Mod}(T_2).T1​ Morita equivalent to T2​⟹Mod(T1​)≃Mod(T2​).

Milestones

  1. Unique expansion. Every model MMM of TTT has an expansion N⊨T+N\models T^+N⊨T+ with ΠN≅M\Pi N\cong MΠN≅M, and any two such expansions are isomorphic.
  2. Π\PiΠ is faithful.
  3. Π\PiΠ is full.
  4. Conservativity. For every Σ\SigmaΣ-formula α\alphaα: T⊨αT\models\alphaT⊨α iff T+⊨αT^+\models\alphaT+⊨α.
  5. Translation. Every Σ+\Sigma^+Σ+-formula whose free variables all have old sorts is T+T^+T+-equivalent to a Σ\SigmaΣ-formula.
  6. Two kinds of things. T1={∃x p(x), ∃x q(x), ∀x (p(x)∨q(x)), ∀x ¬(p(x)∧q(x))}T_1=\{\exists x\,p(x),\ \exists x\,q(x),\ \forall x\,(p(x)\vee q(x)),\ \forall x\,\neg(p(x)\wedge q(x))\}T1​={∃xp(x), ∃xq(x), ∀x(p(x)∨q(x)), ∀x¬(p(x)∧q(x))} over one sort is Morita equivalent to the empty theory over two sorts.
  7. Separating example, first half. T1={∃=1x (x=x)}T_1=\{\exists^{=1}x\,(x=x)\}T1​={∃=1x(x=x)} and T2=T1∪{∀y (p0(y)→pi(y)):i∈N}T_2=T_1\cup\{\forall y\,(p_0(y)\to p_i(y)) : i\in\mathbb N\}T2​=T1​∪{∀y(p0​(y)→pi​(y)):i∈N}, over one sort and countably many unary predicates, are categorically equivalent.
  8. Separating example, second half. These two theories are not Morita equivalent.

Milestones 1–3 together say that Π\PiΠ is an equivalence of categories. Milestones 6–8 are not needed for the goal; they record the paper's examples, which show that Morita equivalence relates theories with different numbers of sorts and is strictly stronger than categorical equivalence.

Significance

The result itself. The goal makes Morita equivalence a syntactic sufficient condition for categorical equivalence: an explicit dictionary of definitions yields an equivalence of model categories. Milestone 8 shows the converse fails, so categorical equivalence is strictly weaker. Milestone 6 shows that Morita equivalence, unlike definitional equivalence, can relate theories with different numbers of sorts. Together these locate the criterion that later philosophy-of-physics work uses to compare formulations with different ontologies, such as different numbers of kinds of objects.

Formalizing it. The results are proved on paper and, as far as is known, have no machine-checked proofs. Mathlib's ModelTheory library is single-sorted, so none of this is available there. The mission produces a reusable many-sorted first-order logic with:

  • syntax, semantics and signature maps;
  • elementary embeddings and the category of models;
  • Morita extensions with their reduct functors.

The paper's arguments for conservativity and translation are informal in places; for example, the translation in the appendix uses coding of new-sorted variables. A formal proof fixes these details.

Difficulty

The obvious route to the goal composes the reduct functors along the chains. The work lies in showing that each reduct is an equivalence when the arrows are elementary embeddings.

  • Fullness. An elementary embedding of reducts extends uniquely to the new sorts. Showing that the extension is again elementary requires the translation of Milestone 5: every Σ+\Sigma^+Σ+-formula has to be pulled back to a Σ\SigmaΣ-formula, including formulas that quantify over the new sorts.
  • Coproduct and quotient sorts. Quantifiers over these sorts must be eliminated in favour of quantifiers over the old sorts.

For Milestone 8 the difficulty is reversed. One must rule out every pair of chains, including chains that introduce arbitrary new sorts. The paper's proof argues with a single common Morita extension. The definition, however, allows chains, and the paper notes that a chain need not collapse to a single extension. The argument must therefore be run through conservativity and translation along each chain.

Formalization scope

  • Self-contained logic. Signatures have dependent arities (Fin m → Srt). Terms and formulas use de Bruijn variables in typed contexts Γ : Fin n → Srt; Formula.all binds variable 0.
  • Theories. A theory is a Set (Axiom L), each axiom being a formula in context read as its universal closure. Because sorts are nonempty, this agrees with the sentence version.
  • Nonempty sorts. Every structure has nonempty carriers. This is the paper's convention, and without it Milestone 6 is false: the empty theory over two sorts would have models with an empty sort.
  • Morita extensions are built, not recognized. MoritaData L T lists the new sorts and symbols and their defining Σ\SigmaΣ-formulas. The signature Σ+\Sigma^+Σ+ (D.sig) and the axioms are generated from it, and admissibility is stated semantically, over all models of TTT. Any Morita extension in the paper's sense is of this form up to renaming of the new symbols.
  • A common signature up to renaming. MoritaEquivalent asks for a bijective signature map F between the two chain ends such that a structure is a model of T2′T_2'T2′​ iff its F-reduct is a model of T1′T_1'T1′​.
  • Universes. Models live in Type.
  • Separating example. The paper writes T2T_2T2​ with fresh symbols qiq_iqi​; here T1T_1T1​ and T2T_2T2​ share the signature with predicates pip_ipi​, which only renames symbols.
  • No trivialization. None of the targets holds vacuously: Morita extensions require genuine admissibility proofs, and the arrows are elementary embeddings, not arbitrary maps. Milestone 6 needs explicit chains and an explicit renaming, with arity casts.

A complete development will need:

  • the substitution and weakening lemmas for de Bruijn formulas;
  • the realization of signature maps;
  • the construction of expansions;
  • a translation function from Σ+\Sigma^+Σ+-formulas to Σ\SigmaΣ-formulas.

These pieces are reusable for any later work on interpretations or theoretical equivalence. Alternative proofs of Milestone 8, for example by counting finitely axiomatized subtheories, are welcome.

Selected references

  • T. W. Barrett, H. Halvorson, Morita Equivalence, Rev. Symb. Logic 9 (2016) 556–582. arXiv:1506.04675. Source of all targets: §3–§5 and the appendix; Example 4 and Theorems 4.1–4.3, 5.1, 5.2.
  • J. O. Weatherall, Are Newtonian Gravitation and Geometrized Newtonian Gravitation Theoretically Equivalent?, Erkenntnis 81 (2016) 1073–1091. arXiv:1411.5757.
  • J. O. Weatherall, Theoretical Equivalence in Physics, Philos. Compass 14 (2019). arXiv:1810.08192.
  • H. Halvorson, The Logic in Philosophy of Science, Cambridge University Press, 2019. doi:10.1017/9781316275603.
20 thms1 active userReviewed
Theoretical Computer ScienceTheory of Computation·Captain: mikedeng1

Multiparty Asynchronous Session Types 3: Progress — Every Reduct of a Simple, Well-Linked Typed Program Is ≡ 0 or Reduces FurtherResearch Paper

Motivation

Distributed programs often establish a conversation among several participants, then exchange messages without waiting for each send to be received. A specification of each participant in isolation does not by itself say whether their actions will fit together. Multiparty asynchronous session types address this by describing the intended conversation once as a global type and checking each participant against a projected local type. Honda, Yoshida and Carbone develop this calculus and state a progress result for a restricted class of well-typed programs: if execution has not finished, another reduction is available. The restriction matters because independently initiated sessions can interfere and deadlock even when their communications are individually typed. Honda, Yoshida and Carbone (2016)

Setting

A program is a process before execution: it contains no message queues or restricted session channels, even after structural rearrangement, and it has no free session channels or process variables. A requester on a shared name aaa starts a session with participants numbered 222 through nnn. Each participant receives the same vector s~\widetilde ss of fresh session channels. An asynchronous send appends a message to the appropriate FIFO queue; a receive reads the queue head. Requests, sends, delegations and selections are emitting prefixes. Accepts, receives and branches are receiving prefixes. The reduction relation P⟶QP\longrightarrow QP⟶Q includes these communications, conditionals, guarded declaration unfolding, and closure under parallel composition, restriction and structural congruence ≡\equiv≡. Honda, Yoshida and Carbone (2016), Figs. 1–3 and Def. 2.1

A global type GGG specifies which numbered role sends a value or choice to another role on channel index kkk, followed by the remainder of the conversation. It may also contain parallel components and guarded recursion. A partial projection G↾pG\upharpoonright pG↾p gives role ppp its endpoint type. Global types must be linear: causally ordered actions on a common channel have both input and output dependency chains. A global type is coherent when it is linear and projects to all its participants; the runtime typing Δ\DeltaΔ is coherent when each session family comes from such a global type. Honda, Yoshida and Carbone (2016), Defs. 3.12, 4.1–4.2 and 5.9

The runtime judgement Γ⊢P▹s~Δ\Gamma\vdash P\triangleright_{\widetilde s}\DeltaΓ⊢P▹s​Δ records the types of the process and the queue channels it mentions. Type contexts remember messages already in transit and compose with endpoint types. A process is queue-full when the channels in s~\widetilde ss equal the channels occurring in Δ\DeltaΔ. A prefix is active when it is outside another prefix and outside either branch of a conditional, after permitted declaration unfolding. A process is well-linked when every reachable process has each active shared-name prefix in a redex. A process is simple when it has a typing derivation whose session environments obey the singleton and emptiness restrictions of Definition 5.25, with no delegation input or output rule. Honda, Yoshida and Carbone (2016), pp. 28–37

Formalization targets

The goal is Corollary 5.30. For every simple, well-linked program PPP whose free names have shared sorts, and every reachable process P′P'P′,

P⟶∗P′⟹P′≡0 ∨ ∃P′′  P′⟶P′′.P\longrightarrow^*P'\quad\Longrightarrow\quad P'\equiv 0\ \lor\ \exists P''\;P'\longrightarrow P''.P⟶∗P′⟹P′≡0 ∨ ∃P′′P′⟶P′′.

Here 000 is inaction, and P′≡0P'\equiv 0P′≡0 includes completed sessions whose empty queues disappear by structural congruence. The milestones are the closed-typing preservation clause of Theorem 5.19(3), the linearity and message agreement clauses of Theorem 5.22, and the immediate-step claim of Proposition 5.29(1). Those are statements of the paper and give separate targets before the progress corollary. Honda, Yoshida and Carbone (2016), pp. 34–37

Significance

For the specified class of programs, progress excludes a reachable state that is neither finished nor reducible. It combines static endpoint information with the operational facts about queues and shared-name synchronisation. The communication-safety milestone also states that a value receive is paired with a value message of matching arity, channel reception with a channel vector of matching length, and branching with an offered label. These claims describe behavior of the paper's asynchronous multiparty calculus, rather than a property of a particular implementation. Honda, Yoshida and Carbone (2016), Theorem 5.22 and Corollary 5.30

The paper supplies mathematical proofs, but this mission's statements have no completed machine-checked proofs. Formalizing the result requires a precise account of the calculus, including queue messages, scope, recursive calls, type contexts, projection and the limited form of simplicity. The definitions can support later work on subject reduction and session fidelity in the same model. A contribution may prove any milestone or the goal, or improve the shared definitions while preserving the source's hypotheses and conclusions.

Difficulty

Typing each participant does not immediately give a reduction of their parallel composition. A send can be present while a receive is blocked by an earlier queue message, and a session initiation can be blocked by a shared-name prefix in a different session. Communication safety must relate active prefixes to a unique queue and its actual head message. Progress additionally needs the restrictions on derivations and shared-name links to rule out interference among sessions. The rules for structural congruence and declaration unfolding make the location of a redex depend on more than the outer syntactic constructor. Honda, Yoshida and Carbone (2016), §§5.4–5.5

Formalization scope

Lean uses natural numbers for role identifiers, shared names, channels, labels and process variables. Channel indices are one based, following s[1..m]s[1..m]s[1..m]. A global type, value sort and endpoint type are separate syntax classes; finite branch families are lists with nonempty, distinct labels where a well-formed type is required. Recursion is read equi-recursively by an endpoint bisimulation, and global-type linearity is checked on every finite unfolding. Projection returns an optional endpoint type so undefined projections cannot acquire a default value. The session typings are finite maps represented by association lists, with distinct roles and disjoint channel domains. The judgement's subscript s~\widetilde ss lists queue channels, while the domain of Δ\DeltaΔ lists all sessions under typing.

The formalization uses named process binders and a structural-congruence relation containing alpha conversion. Received-value and call substitution is capture avoiding under explicit freshness conditions. Expression evaluation is fixed to the ordinary Boolean connectives used in the paper's typing rules. Runtime typing includes the queue rules and the partial composition of type contexts. The restricted typing system for simplicity retains runtime queue rules and excludes both delegation directions. The paper prints “[RCV]” in Definition 5.25(2), but its appendix explicitly excludes “[SREC]”; this draft follows the appendix and records that reading in its audit notes. The result quantifies over actual programs and makes simplicity imply typability, so a free, blocked input or an untyped syntax check cannot satisfy the goal. Honda, Yoshida and Carbone (2016), Def. 5.25 and Appendix B.8

Every prefix rule acts on a singleton entry s~:T@p\widetilde s:T@ps:T@p (Notation 4.5); process-variable signatures carry one singleton entry per session vector, as in [VAR]; [SREC] receives the channel names it binds, without substitution (Remark 2.2). Proposition 5.29(1) and Corollary 5.30 are false as printed for open terms: a free name of sort bool used as a conditional guard, or a free process variable, is a stuck simple process. The formal statements therefore add that the free names of the process have shared sorts and, for Proposition 5.29(1), that it has no free process variables (a program has none by definition).

The development needs Mathlib's finite sets, lists and reflexive-transitive closure, plus its own definitions of the process calculus and typing judgements. The Lean declarations in this proposal are draft statements and definitions for review; they are not proofs of the paper's results.

Selected references

  • Kohei Honda, Nobuko Yoshida and Marco Carbone, Multiparty Asynchronous Session Types, Journal of the ACM 63(1), Article 9, 2016. DOI 10.1145/2827695
12 thms1 active userReviewed
Theoretical Computer ScienceTheory of Computation·Captain: mikedeng1

Multiparty Asynchronous Session Types 1: A Global Type's One-Time Unfolding Is Linear iff Its n-th Unfolding Is Linear, for Every n ≥ 1Research Paper

Motivation

Multiparty communication protocols involve several participants who send messages over shared session channels. An implementation may send a later message before an earlier one has been received, so a written sequence of interactions does not by itself prevent a receiver from taking the wrong message. Honda, Yoshida, and Carbone use global types to specify the whole conversation and a linearity condition to rule out conflicting uses of a channel. Their condition is part of the type system that supports subject reduction and session fidelity in the same paper. Honda, Yoshida, and Carbone, 2016

Global types can contain recursion. Reading their full behaviour as a regular tree may therefore involve infinitely many copies of the same interaction. Proposition 3.13(1) says that checking just one finite unfolding suffices to determine whether every later finite unfolding satisfies the paper's linearity condition. This mission formalizes that proposition and the definitions on which its statement depends. Honda, Yoshida, and Carbone, 2016, §3.5 and Appendix A

Setting

A global type GGG describes actions among roles p,qp,qp,q on channels identified by positive indices kkk. Its constructors are a value communication p→q:k⟨U⟩.G′p\to q:k\langle U\rangle.G'p→q:k⟨U⟩.G′, a labelled branch p→q:k{ℓj:Gj}j∈Jp\to q:k\{\ell_j:G_j\}_{j\in J}p→q:k{ℓj​:Gj​}j∈J​, parallel composition G1∣G2G_1\mid G_2G1​∣G2​, recursion μt.G′\mu t.G'μt.G′, a recursion variable ttt, and termination end\mathrm{end}end. The carried value type UUU may contain shared names whose sorts include another global type, or it may be a located end-point type. The formal syntax represents end-point sends, receives, selections, branches, recursion, variables, and termination because shared global types can occur within the sorts carried by those types. Honda, Yoshida, and Carbone, 2016, Figs. 4 and 6

An action node is an occurrence of a communication or branching action in the tree of a finite unfolding. Each node has a sender, receiver, and channel index. The action order n1≺n2n_1\prec n_2n1​≺n2​ holds when one action lies before another in the same continuation or branch, according to Definition 3.7. Actions in different branches or parallel components have no order solely because they appear next to each other in the syntax. Honda, Yoshida, and Carbone, 2016, pp. 15–16

The paper refines that order into three dependency relations. An II step matches receivers; an IO step connects a receiver to a later sender; and an OO step matches both sender and channel. An input dependency is a chain of IO steps ending in II. An output dependency is a nonempty chain of OO or IO steps. A finite type is linear when every ordered pair of actions on the same channel has both dependencies, including the corresponding condition on the global types carried within its values. The last II step matters because a chain ending at an output has not checked the ordering of the final input. Honda, Yoshida, and Carbone, 2016, Defs. 3.11–3.12

Write G(n)G^{(n)}G(n) for the finite result of unfolding every recursion in GGG nnn times and replacing remaining recursion variables by end\mathrm{end}end. For a single recursion G=μt.HG=\mu t.HG=μt.H, the paper gives G(0)=H[end/t]G^{(0)}=H[\mathrm{end}/t]G(0)=H[end/t] and G(n+1)=H[G(n)/t]G^{(n+1)}=H[G^{(n)}/t]G(n+1)=H[G(n)/t]. Unfolding does not enter carried types. The one-time unfolding is G(1)G^{(1)}G(1). Honda, Yoshida, and Carbone, 2016, p. 20 and Notation A.1

Formalization targets

The milestone is the direction the paper calls the “if-direction”: for a well-formed global type and a positive unfolding index, linearity at that index implies linearity at the first one.

WellFormed⁡(G) ∧ n≥1 ∧ Linear⁡(G(n))⟹Linear⁡(G(1)).\operatorname{WellFormed}(G)\ \land\ n\ge 1\ \land\ \operatorname{Linear}(G^{(n)}) \quad\Longrightarrow\quad \operatorname{Linear}(G^{(1)}).WellFormed(G) ∧ n≥1 ∧ Linear(G(n))⟹Linear(G(1)).

The mission goal is Proposition 3.13(1), the equivalence between the first unfolding and any positive unfolding.

∀G well formed ∀n≥1,Linear⁡(G(1))⟺Linear⁡(G(n)).\forall G\text{ well formed}\,\forall n\ge 1,\qquad \operatorname{Linear}(G^{(1)}) \quad\Longleftrightarrow\quad \operatorname{Linear}(G^{(n)}).∀G well formed∀n≥1,Linear(G(1))⟺Linear(G(n)).

The lower bound n≥1n\ge1n≥1 is essential. The paper explicitly begins its Appendix A induction at n=1n=1n=1 and gives examples that satisfy linearity at the zeroth unfolding but fail after one unfolding. Proposition 3.13(2), the paper's decidability claim, is outside this mission: formalizing computational decidability would require an effective representation and decision procedure rather than a classical Decidable instance. Honda, Yoshida, and Carbone, 2016, p. 20 and Appendix A

Significance

The proposition turns a property stated over arbitrarily deep recursive behaviour into a fixed finite test. It supports the paper's decidability result and supplies the channel-ordering premise used later in coherent global types and runtime typing. Without the stabilization claim, checking a recursive global type by inspecting one finite copy would leave later channel conflicts unresolved. Honda, Yoshida, and Carbone, 2016, Props. 3.13–3.14 and Def. 4.2

The result is already proved in the paper. The formalization work is to give the paper's finite unfolding, action order, dependency chains, and recursive carried-type condition exact Lean meanings, then verify the equivalence against those meanings. The local mission currently contains open theorem statements and compiled definitions; it does not claim a machine-checked proof of Proposition 3.13(1). Those definitions can also be reused when formalizing the paper's coherence and subject-reduction results.

Difficulty

The main obstacle is the interaction between recursion and causality. Unfolding creates further occurrences of actions, while an input dependency requires a chain with a specific final II edge and an output dependency allows only OO or IO edges. The action order also depends on a node's place in a branch, continuation, or parallel component. Merely comparing channel labels across two unfoldings does not establish the required dependencies. The carried-type condition adds another level: unfolding the outer type leaves its carried types intact, but their own linearity must still be checked. Honda, Yoshida, and Carbone, 2016, Defs. 3.7, 3.11–3.12 and Appendix A

Formalization scope

Lean represents roles, labels, type variables, and channel indices by natural numbers, with channel indices interpreted as one-based. Branches are lists; WellFormed G records nonempty branches with distinct labels, closed guarded recursion, positive channel indices, and distinct sender and receiver, also checking carried global types. Both theorem statements assume it to make the paper's standing syntax conventions explicit. The sort grammar includes Boolean and natural-number sorts, shared-name sorts, and coded additional base sorts for the paper's ellipsis. The recursion constructor is named mu and the sort type SType because rec and Sort have special meanings in Lean.

Node names are finite child-index paths. Prec is the transitive closure of the five clauses of Definition 3.7. Every II, IO, or OO step includes this order. Input dependency requires at least one step, resolving the printed n≥0n\ge0n≥0 against the same sentence's mandatory final II step. Carried types are reached through value and end-point type syntax, and nested carriers are included transitively. Linear checks each such carried type at every finite unfolding. The definitions also encode the paper's positive-index and non-reflexive interaction conventions in WellFormed. A linearity predicate that ignores carried types or treats separate parallel components as ordered would change the target theorem. Honda, Yoshida, and Carbone, 2016, pp. 12–13, 16, 19–20

Useful contributions include results about finite unfolding and the action order, preservation of labels at recurring positions, and dependency-chain properties under unfolding. The two folding claims in Appendix A are not listed as milestones here because a faithful folding operation for nested recursion and multiple occurrences has not yet been specified. Their absence is a scope limit on the attack path, not an assumption in the goal.

Selected references

  • Kohei Honda, Nobuko Yoshida, and Marco Carbone, Multiparty Asynchronous Session Types, Journal of the ACM 63(1), Article 9, 2016. DOI: 10.1145/2827695.
4 thms1 active userReviewed
Mathematical LogicTheory of Computation·Captain: mikedeng1

Monitoring Metric First-Order Temporal Properties: The Monitor M_Φ Outputs Exactly the Violations (¬Φ)^(D̄,τ̄,i) of a Bounded MFOTL Formula Φ, as Regular Sets, at Every Time Point iResearch Paper

Motivation

Runtime monitoring checks a running system against a specification by inspecting its trace of events as it is produced. Policies on data, such as "every published report was approved within the last 10 days" or "each value stored in in reaches out within 5 time units", quantify over data values and constrain the time between events. Metric first-order temporal logic (MFOTL) expresses such policies: it extends first-order logic with past and future temporal operators that carry intervals of allowed time differences.

Basin, Klaedtke, Müller and Zălinescu (J. ACM 62(2), Article 15, 2015) give a monitor for MFOTL properties □Φ\square\Phi□Φ with Φ\PhiΦ bounded. It allows negation and quantification over the infinite domain N\mathbb NN without restriction, because every relation it manipulates is represented by a finite automaton: the input structures are automatic structures. The paper implements it in the prototype tool MonPoly-Reg (§6). Its correctness rests on Theorem 3.9: the monitor reports exactly the violations of Φ\PhiΦ, at every time point.

Setting

A signature S=(C,R,ι)S=(C,R,\iota)S=(C,R,ι) has finitely many constants and predicates with arities. Formulas are built from t≈t′t\approx t't≈t′ and r(t1,…,tι(r))r(t_1,\dots,t_{\iota(r)})r(t1​,…,tι(r)​) by ¬\neg¬, ∨\vee∨, ∃x\exists x∃x and the temporal operators ∙I\bullet_I∙I​ (previous), ∘I\circ_I∘I​ (next), SI\mathsf S_ISI​ (since) and UI\mathsf U_IUI​ (until), where I=[b,b′)I=[b,b')I=[b,b′) is a nonempty interval of N\mathbb NN with b′∈N∪{∞}b'\in\mathbb N\cup\{\infty\}b′∈N∪{∞}. A formula is bounded if every UI\mathsf U_IUI​ in it has b′<∞b'<\inftyb′<∞.

A temporal structure (Dˉ,τˉ)(\bar{\mathcal D},\bar\tau)(Dˉ,τˉ) assigns to each time point i∈Ni\in\mathbb Ni∈N relations rDi⊆Nι(r)r^{\mathcal D_i}\subseteq\mathbb N^{\iota(r)}rDi​⊆Nι(r) and a time stamp τi∈N\tau_i\in\mathbb Nτi​∈N; constants are rigid, τ0≤τ1≤⋯\tau_0\le\tau_1\le\cdotsτ0​≤τ1​≤⋯, and τˉ\bar\tauτˉ exceeds every bound. Satisfaction (Dˉ,τˉ,v,i)⊨φ(\bar{\mathcal D},\bar\tau,v,i)\models\varphi(Dˉ,τˉ,v,i)⊨φ is Definition 2.2; for example ψ UI ψ′\psi\,\mathsf U_I\,\psi'ψUI​ψ′ holds at iii if ψ′\psi'ψ′ holds at some j≥ij\ge ij≥i with τj−τi∈I\tau_j-\tau_i\in Iτj​−τi​∈I and ψ\psiψ holds at all k∈[i,j)k\in[i,j)k∈[i,j). For φ\varphiφ with free variables x1<⋯<xnx_1<\dots<x_nx1​<⋯<xn​, the satisfying set is

φ(Dˉ,τˉ,i)={dˉ∈Nn∣(Dˉ,τˉ,v[xˉ↦dˉ],i)⊨φ for some v}.\varphi^{(\bar{\mathcal D},\bar\tau,i)}=\{\bar d\in\mathbb N^n\mid(\bar{\mathcal D},\bar\tau,v[\bar x\mapsto\bar d],i)\models\varphi\ \text{for some }v\}.φ(Dˉ,τˉ,i)={dˉ∈Nn∣(Dˉ,τˉ,v[xˉ↦dˉ],i)⊨φ for some v}.

A domain representation is a regular language L\mathcal LL over a finite alphabet with a surjection ν:L→N\nu:\mathcal L\to\mathbb Nν:L→N whose equality relation is regular. A relation A⊆NkA\subseteq\mathbb N^kA⊆Nk is regular if the words u1⊗⋯⊗uku_1\otimes\cdots\otimes u_ku1​⊗⋯⊗uk​ (the letter-by-letter convolution, padded with #\##) with (ν(u1),…,ν(uk))∈A(\nu(u_1),\dots,\nu(u_k))\in A(ν(u1​),…,ν(uk​))∈A form a regular language.

The monitor MΦ\mathsf M_\PhiMΦ​ (Fig. 2) reads (D0,τ0),(D1,τ1),…(\mathcal D_0,\tau_0),(\mathcal D_1,\tau_1),\dots(D0​,τ0​),(D1​,τ1​),… one element per loop iteration. It extends each Dj\mathcal D_jDj​ to D^j\hat{\mathcal D}_jD^j​ with auxiliary relations pαp_\alphapα​ (and rαr_\alpharα​, sαs_\alphasα​ for since and until) for every temporal subformula α\alphaα, built incrementally by the constructions of §3.4 once a list QQQ of pending triples (α,j,S)(\alpha,j,S)(α,j,S) says that enough of the future has been read. When D^i\hat{\mathcal D}_iD^i​ is complete it outputs the set (¬Φ^)D^i(\neg\hat\Phi)^{\hat{\mathcal D}_i}(¬Φ^)D^i​ with τi\tau_iτi​, where Φ^\hat\PhiΦ^ is Φ\PhiΦ with each top-level temporal subformula α\alphaα replaced by the atom pα(xˉ)p_\alpha(\bar x)pα​(xˉ).

Formalization targets

Goal: Theorem 3.9

For every input satisfying the restrictions of §3.1 and every bounded Φ\PhiΦ:

(i)(n,O,t) output by line 9 ⟹ O=(¬Φ)(Dˉ,τˉ,n), O regular, t=τn;\text{(i)}\quad (n,O,t)\ \text{output by line 9}\ \Longrightarrow\ O=(\neg\Phi)^{(\bar{\mathcal D},\bar\tau,n)},\ O\ \text{regular},\ t=\tau_n;(i)(n,O,t) output by line 9 ⟹ O=(¬Φ)(Dˉ,τˉ,n), O regular, t=τn​; (ii)∀n∈N,n=0 or some output at index n−1 occurs,\text{(ii)}\quad \forall n\in\mathbb N,\quad n=0\ \text{or some output at index }n-1\text{ occurs},(ii)∀n∈N,n=0 or some output at index n−1 occurs,

where each output is followed by line 11 setting iii to the next index. This records counter values reached inside the while loop, including values that may never appear at a loop entry. Part (ii) excludes the vacuous reading of (i).

Milestones

  1. Lemma 3.4: φ^D^i=φ(Dˉ,τˉ,i)\hat\varphi^{\hat{\mathcal D}_i}=\varphi^{(\bar{\mathcal D},\bar\tau,i)}φ^​D^i​=φ(Dˉ,τˉ,i) once the auxiliary relations of tsub(φ)\mathit{tsub}(\varphi)tsub(φ) are correct, and regularity is preserved.
  2. Lemmas 3.5–3.8: the constructions for ∙I\bullet_I∙I​, ∘I\circ_I∘I​, SI\mathsf S_ISI​ and bounded UI\mathsf U_IUI​ produce regular relations equal to the satisfying sets, with the stated characterizations of rαr_\alpharα​ and sαs_\alphasα​.
  3. Observations (1)–(3) of the proof of Theorem 3.9 on the list QQQ and the counter iii.
  4. The claim that line 7 can always be executed, in the form: if (α,j,∅)∈Qk(\alpha,j,\emptyset)\in Q_k(α,j,∅)∈Qk​ then the build stores pαD^j=α(Dˉ,τˉ,j)p_\alpha^{\hat{\mathcal D}_j}=\alpha^{(\bar{\mathcal D},\bar\tau,j)}pαD^j​​=α(Dˉ,τˉ,j), which is regular.

Significance

Theorem 3.9 makes MΦ\mathsf M_\PhiMΦ​ a sound and complete monitor for the safety fragment □Φ\square\Phi□Φ, Φ\PhiΦ bounded: every violation at every time point is reported, nothing else is, and every output is a finitely represented (regular) set even though it may be infinite. It covers unrestricted negation and quantification, which finite-relation monitors (§4 of the paper) cannot handle. The incremental constructions of §3.4 are the template reused by later MFOTL monitors.

The paper gives a mathematical proof of its monitor's correctness. This mission asks for a Lean proof that checks the MFOTL semantics, automatic relations over N\mathbb NN, and the correctness of this particular monitor, including the until construction whose printed version is defective (see Formalization scope).

Difficulty

Two parts are hard. The regularity claims need the fundamental property of automatic structures: first-order definable relations are regular, which requires closure of padded convolution languages under Boolean operations, cylindrification, permutation of tracks and projection, the last with removal of trailing padding. The arithmetic constraints of the since and until constructions additionally need successor and offset relations definable from ≺\prec≺.

The scheduling argument is the other part. Correctness of a build at (α,j)(\alpha,j)(α,j) requires that every input relation, at time points up to j+ℓjj+\ell_jj+ℓj​ for until, was built before and not discarded since. Following only the syntax of α\alphaα does not settle this: a needed relation for a subformula at a later time point may be built in the same iteration as α\alphaα's.

Formalization scope

The domain is N\mathbb NN, as §3.1 assumes. Relations are sets of lists of natural numbers, ordered by the sorted free variables. Interval upper bounds are in N∞\mathbb N_\inftyN∞​; intervals carry the proof that they are nonempty. The representation (L,ν)(\mathcal L,\nu)(L,ν) is a single parameter shared by the hypothesis "every rDir^{\mathcal D_i}rDi​ is regular" and the regularity claims of the conclusions; it is never chosen existentially. The binary predicate ≺\prec≺ interpreted as <<< is a hypothesis.

Two hypotheses on Φ\PhiΦ besides boundedness are the paper's own "without loss of generality" assumptions: each temporal subformula occurs once in Φ\PhiΦ (§3.6), and the direct subformulas of each SI\mathsf S_ISI​, UI\mathsf U_IUI​ subformula have the same free variables (§3.4; achieved by padding with x≈xx\approx xx≈x, as in §3.5). No other restriction is placed on Φ\PhiΦ.

The printed until construction (§3.4.4) is repaired: the guard of UrU_rUr​ is "aˉ∈β^D^i+k\bar a\in\hat\beta^{\hat{\mathcal D}_{i+k}}aˉ∈β^​D^i+k​ for all ℓi−1≤k≤ℓi\ell_{i-1}\le k\le\ell_iℓi−1​≤k≤ℓi​", since the printed guard empties rαr_\alpharα​ in the paper's own example of §3.5; UsU_sUs​ keeps only tuples with j′≥1j'\ge1j′≥1, since otherwise a γ\gammaγ-witness at time point i−1i-1i−1 survives to time point iii when τi=τi−1\tau_i=\tau_{i-1}τi​=τi−1​; and time-stamp equations are encoded additively. Lemma 3.8(i) reads aˉ∈Nn\bar a\in\mathbb N^naˉ∈Nn and adds j≤ℓij\le\ell_ij≤ℓi​. "Effectively computable" in Theorem 3.9(i) is not formalized. Part (ii) uses the output at index n−1n-1n−1 as the record of the line-11 increment to nnn; for n=0n=0n=0, the counter is initialized by line 2. Loop-entry states alone can skip counter values reached within one iteration.

The monitor is a state machine whose builds and outputs are computed only from its store of relations; it never consults the satisfaction relation or satisfying sets. A formalization in which line 7 reads the semantics would turn Theorem 3.9(i) into a restatement of Lemma 3.4, and is ruled out. A build whose input is missing stores nothing, so a monitor that silently fails would violate (ii).

Contributions welcome: the theory of automatic relations (reusable beyond this mission), the semantic halves of Lemmas 3.4–3.8, and the scheduling invariants.

Selected references

  • D. Basin, F. Klaedtke, S. Müller, E. Zălinescu, Monitoring metric first-order temporal properties, J. ACM 62(2), Article 15, 2015. https://doi.org/10.1145/2699444
14 thms1 active userReviewed
CombinatoricsDynamical Systems·Captain: Rizwan G Mir

Bound L4: 33,070,982 <= R Reversible Binary 2D Moore RulesOpen Problem

Bound L4L_4L4​: 33,070,982≤R33,070,982 \le R33,070,982≤R

This mission formalizes the lower bound 33,070,982≤R33,070,982 \le R33,070,982≤R on the number of reversible binary cellular automata on the 3×33 \times 33×3 Moore neighborhood. Extending the conserved-landscape marker families to both centered and off-centered rules.

1 thm1 active userReviewed
🏆Completed
Combinatorics·Captain: Rizwan G Mir

Reversible Binary 2D Cellular Automata: Disproof of R = 18 and Lower Bound R >= 33,076,358Open Problem

Reversible Binary 2D Cellular Automata: Disproof of R=18R = 18R=18 and Lower Bound R≥33,076,358R \ge 33,076,358R≥33,076,358

Problem Statement & Context

A two-dimensional binary cellular automaton (CA) on the infinite grid Z2\mathbb{Z}^2Z2 with the standard 3×33 \times 33×3 Moore neighborhood M={−1,0,1}2M = \{-1,0,1\}^2M={−1,0,1}2 updates configurations c:Z2→{0,1}c : \mathbb{Z}^2 \to \{0,1\}c:Z2→{0,1} via a local rule f:{0,1}M→{0,1}f : \{0,1\}^M \to \{0,1\}f:{0,1}M→{0,1} according to:

Ff(c)(z)=f((c(z+u))u∈M)F_f(c)(z) = f\Big(\big(c(z + u)\big)_{u \in M}\Big)Ff​(c)(z)=f((c(z+u))u∈M​)

A local rule fff is reversible (or bijective) if its global map FfF_fFf​ is a bijection of the configuration space {0,1}Z2\{0,1\}^{\mathbb{Z}^2}{0,1}Z2.

Let RRR denote the exact number of reversible binary local rules on the 3×33 \times 33×3 Moore neighborhood. A longstanding open conjecture asserted that R=18R = 18R=18, corresponding solely to the 18 trivial single-cell shifts and complemented shifts:

f(c)=c(z+u)orf(c)=1−c(z+u)(u∈M)f(c) = c(z + u) \quad \text{or} \quad f(c) = 1 - c(z + u) \quad (u \in M)f(c)=c(z+u)orf(c)=1−c(z+u)(u∈M)

In this mission, we formally disprove R=18R = 18R=18 by constructing an explicit non-trivial conserved-landscape rule f⋆f_\starf⋆​ whose global map Ff⋆F_{f_\star}Ff⋆​​ is an involution on Z2\mathbb{Z}^2Z2, proving 19≤R19 \le R19≤R. We further extend this result to establish R≥33,076,358R \ge 33,076,358R≥33,076,358.


Ladder of Proven Bounds

Bound LevelProven BoundDescription / Mathematical Mechanism
L0\mathbf{L_0}L0​R≥18R \ge 18R≥18Trivial single-cell shifts and complemented shifts (2×9=182 \times 9 = 182×9=18).
L1\mathbf{L_1}L1​R≥19R \ge 19R≥19Disproof of R=18R = 18R=18 via explicit non-trivial conserved-landscape rule f⋆f_\starf⋆​.
L2\mathbf{L_2}L2​R≥33,070,982R \ge 33,070,982R≥33,070,982Conserved-landscape marker rule family (24,57624,57624,576 centered rules).
L3\mathbf{L_3}L3​R≥33,076,358R \ge 33,076,358R≥33,076,358Incorporation of 5,3765,3765,376 off-centre marker rules reading center cell x0x_0x0​.
SymmetryRrot90=74R_{\text{rot90}} = 74Rrot90​=74Exactly 74 rules invariant under 90∘90^\circ90∘ spatial rotations.
Torus$\mathcal{R}_{2,3}
Upper LimitR≤2511R \le 2^{511}R≤2511Derived from constant divergence condition f(0)≠f(1)f(\mathbf{0}) \ne f(\mathbf{1})f(0)=f(1).

Key Milestone Theorems

  1. Theorem 1 (Trivial Rule Reversibility): All 18 single-cell shift and negated-shift rules are bijective global maps.
  2. Theorem 2 (Conserved-Landscape Involution f⋆f_\starf⋆​): The rule f⋆f_\starf⋆​ complements a cell iff its W and SE neighbors are 111 and the other six are 000. Ff⋆∘Ff⋆=idF_{f_\star} \circ F_{f_\star} = \text{id}Ff⋆​​∘Ff⋆​​=id.
  3. Theorem 3 (Non-Triviality & 19≤R19 \le R19≤R): f⋆f_\starf⋆​ differs from every trivial rule, establishing 19≤R19 \le R19≤R and disproving R=18R = 18R=18.
  4. Theorem 4 (Constant Divergence Condition): Every reversible rule satisfies f(0)≠f(1)f(\mathbf{0}) \ne f(\mathbf{1})f(0)=f(1).
7 thms1 active userReviewed

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