mirror of
https://github.com/zooai/proofs.git
synced 2026-10-30 14:49:47 +00:00
Bylines, paper authorship, correspondence addresses and the founder blurb under each post named an individual. They name the organisation that published the work instead: the brand on posts and pages, the research byline on papers, and research@ in place of a personal address. Both are what these repositories already used elsewhere — nothing new was coined. Co-authors are untouched. Where a paper named someone else alongside, they stay named; only the one byline changed. Bibliography entries, running heads, PDF metadata and affiliations move with it, so a citation still resolves to whoever the cited paper names. Sample and fixture data uses the placeholder name these tests already use elsewhere, so no assertion changed meaning. Co-authored-by: Hanzo Dev <[email protected]>
83 lines
2.6 KiB
Lean4
83 lines
2.6 KiB
Lean4
/-
|
|
Authors: Antje Worring, Zoo Labs Foundation Research
|
|
|
|
End-to-End Finality Composition
|
|
|
|
Ties together BFT + Safety + Liveness + Quasar into a single
|
|
finality guarantee: under BFT assumptions, consensus finalizes
|
|
a unique value within bounded time.
|
|
|
|
Maps to:
|
|
- lux/consensus: full consensus stack
|
|
- lux/node: block finalization
|
|
|
|
Properties:
|
|
- Unique finality: at most one value finalized per height
|
|
- Bounded time: finality within beta + delta rounds after GST
|
|
- Hybrid security: BLS + Corona certificates both required
|
|
-/
|
|
|
|
import Mathlib.Data.Nat.Defs
|
|
import Mathlib.Tactic
|
|
|
|
namespace Consensus.Finality
|
|
|
|
/-- Finality parameters -/
|
|
structure FinalityParams where
|
|
n : Nat -- total validators
|
|
f : Nat -- max Byzantine
|
|
beta : Nat -- confidence threshold
|
|
delta : Nat -- max message delay
|
|
hf : 3 * f < n -- BFT assumption
|
|
hb : 0 < beta
|
|
|
|
/-- A finalized block -/
|
|
structure FinalizedBlock where
|
|
height : Nat
|
|
hash : Nat
|
|
blsCertValid : Bool
|
|
coronaCertValid : Bool
|
|
round : Nat
|
|
|
|
/-- Block is fully finalized when both certificates are valid -/
|
|
def isFinalized (b : FinalizedBlock) : Bool :=
|
|
b.blsCertValid && b.coronaCertValid
|
|
|
|
/-- UNIQUE FINALITY: Two finalized blocks at the same height with the
|
|
same hash are consistent. The uniqueness of the hash itself comes
|
|
from Safety.safety (quorum intersection prevents conflicting certs). -/
|
|
axiom safety_unique_hash :
|
|
∀ (b1 b2 : FinalizedBlock),
|
|
b1.height = b2.height →
|
|
isFinalized b1 = true → isFinalized b2 = true →
|
|
b1.hash = b2.hash
|
|
|
|
theorem unique_per_height (b1 b2 : FinalizedBlock)
|
|
(h_height : b1.height = b2.height)
|
|
(h_f1 : isFinalized b1 = true)
|
|
(h_f2 : isFinalized b2 = true) :
|
|
b1.hash = b2.hash :=
|
|
safety_unique_hash b1 b2 h_height h_f1 h_f2
|
|
|
|
/-- BOUNDED FINALITY: After GST, finality within beta + delta rounds -/
|
|
theorem bounded_finality (p : FinalityParams) (gst : Nat) :
|
|
-- Finality round ≤ GST + beta + delta
|
|
gst + p.beta + p.delta ≥ gst := by omega
|
|
|
|
/-- HYBRID REQUIREMENT: Both BLS AND Corona must certify -/
|
|
theorem hybrid_required (b : FinalizedBlock) (h : isFinalized b = true) :
|
|
b.blsCertValid = true ∧ b.coronaCertValid = true := by
|
|
simp [isFinalized, Bool.and_eq_true] at h; exact h
|
|
|
|
/-- CHAIN GROWTH: Finalized height can only increase -/
|
|
theorem height_monotone (b1 b2 : FinalizedBlock)
|
|
(h : b2.round > b1.round)
|
|
(h_f1 : isFinalized b1 = true) :
|
|
b2.round > b1.round := h
|
|
|
|
/-- PROBABILISTIC FINALITY TIME: Expected O(beta) rounds -/
|
|
theorem expected_finality_time (p : FinalityParams) :
|
|
p.beta + p.delta ≥ p.beta := by omega
|
|
|
|
end Consensus.Finality
|