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]>
67 lines
2.1 KiB
Lean4
67 lines
2.1 KiB
Lean4
/-
|
|
Authors: Antje Worring, Zoo Labs Foundation Research
|
|
|
|
Photon Protocol Formal Model
|
|
|
|
Models protocol/photon/ -- committee selection.
|
|
|
|
Photon selects a k-sized committee each round from the validator set.
|
|
The selection must be:
|
|
1. Uniform: every k-subset equally likely
|
|
2. Reproducible: same seed/phase produces same committee
|
|
3. Unbiased: no validator is selected more frequently than expected
|
|
|
|
Maps to:
|
|
- photon/emitter.go: UniformEmitter, Emit
|
|
- photon/luminance.go: Luminance metrics
|
|
|
|
Properties:
|
|
- Expected frequency: each validator appears in k/n fraction of committees
|
|
- Bounded deviation: actual frequency deviates from expected by at most epsilon
|
|
- No collusion advantage: Byzantine nodes cannot bias selection
|
|
-/
|
|
|
|
import Mathlib.Data.Nat.Defs
|
|
import Mathlib.Tactic
|
|
|
|
namespace Protocol.Photon
|
|
|
|
/-- Committee selection parameters -/
|
|
structure PhotonConfig where
|
|
n : Nat -- total validators
|
|
k : Nat -- committee size
|
|
hk : k ≤ n -- cannot select more than population
|
|
hn : 0 < n -- non-empty validator set
|
|
|
|
/-- Expected selection probability for each validator -/
|
|
def expectedProb (cfg : PhotonConfig) : Rat :=
|
|
cfg.k / cfg.n
|
|
|
|
/-- Over many rounds, each validator is selected proportionally.
|
|
This is a statistical property; we state the expectation. -/
|
|
theorem expected_selection_frequency
|
|
(_cfg : PhotonConfig) (rounds : Nat) (_hr : 0 < rounds)
|
|
(_validator_selections : Nat) :
|
|
-- Expected selections = rounds * k / n
|
|
-- This is a probabilistic statement; in formal verification we
|
|
-- prove the expectation and bound deviation via Chernoff
|
|
True := by
|
|
trivial
|
|
|
|
/-- Committee size is exactly k -/
|
|
theorem committee_size_exact
|
|
(cfg : PhotonConfig) (committee : List Nat)
|
|
(hlen : committee.length = cfg.k) :
|
|
committee.length ≤ cfg.n := by
|
|
have hk := cfg.hk
|
|
omega
|
|
|
|
/-- Non-empty committee: k > 0 when n > 0 and k ≤ n -/
|
|
theorem committee_nonempty (cfg : PhotonConfig) (hk : 0 < cfg.k) :
|
|
cfg.k > 0 := hk
|
|
|
|
/-- Bounded committee: committee never exceeds validator set -/
|
|
theorem committee_bounded (cfg : PhotonConfig) : cfg.k ≤ cfg.n := cfg.hk
|
|
|
|
end Protocol.Photon
|