Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Fibre reconstruction and finite authorization and recovery toy models

Definition
Couret_CausalFiber01_c81331552304

by alexcour · Nov 10, 2026 · Mathlib c5ea003 (Lean v4.30.0)

causal-fiber-01couret-programmecouret-unification-20261108toy-model

Defines fibre constancy and reconstruction on the witnessed image for maps between arbitrary types, together with uniform permission on observation fibres. The authorization toy model has four history constructors (timely, late, stale, missing); the first three produce a receipt, and only timely is authorized. Enriched observations explicitly pair the original observation with that Boolean verdict. The recovery toy model has worlds empty and committed, a constant unit observation, and actions execute, returnPrior and block. The required action is execute from empty and returnPrior after commit. Execute produces one effect from empty and two after commit; the other actions produce zero from empty and one after commit. These are mathematical toy definitions, not a verified implementation or a refinement of measured production traces.

Definition code
/-! CAUSAL-FIBER-01: toy model; not a production FCI proof. -/
universe u v w

def FiberConstant {H : Type u} {O : Type v} {V : Type w}
    (p : H → O) (v : H → V) : Prop :=
  ∀ a b : H, p a = p b → v a = v b





def ImageReconstructible {H : Type u} {O : Type v} {V : Type w}
    (p : H → O) (v : H → V) : Prop :=
  ∃ r : (o : O) → (∃ h : H, p h = o) → V,
    ∀ h, v h = r (p h) ⟨h, rfl⟩



inductive History where
  | timely | late | stale | missing
  deriving DecidableEq, Repr

inductive Observation where
  | receipt | noReceipt
  deriving DecidableEq, Repr

def observe : History → Observation
  | .timely | .late | .stale => .receipt
  | .missing => .noReceipt

def authorized : History → Bool
  | .timely => true
  | .late | .stale | .missing => false






def enrichedObserve (h : History) : Observation × Bool :=
  (observe h, authorized h)

def enrichedReconstructor : Observation × Bool → Bool := Prod.snd









/- Conservative authorization is weaker than exact verdict reconstruction.
   The observation map and the permitted-history predicate must be justified
   independently when connecting this theorem to a verifier. -/
def UniformlyAllowed {H : Type u} {O : Type v}
    (p : H → O) (allowed : H → Prop) (o : O) : Prop :=
  ∀ h, p h = o → allowed h





/- CAUSAL-PAIR-01 bridge: one quiescent operation, initial effects 0 or 1,
   restored empty receipt ledger, non-idempotent receiver. This finite model
   is linked to measured SQLite traces by bridge.py, not by a refinement proof. -/
namespace Recovery

inductive World where
  | empty | committed
  deriving DecidableEq, Repr

inductive Action where
  | execute | returnPrior | block
  deriving DecidableEq, Repr

def observation (_ : World) : Unit := ()

def required : World → Action
  | .empty => .execute
  | .committed => .returnPrior



def effects : World → Action → Nat
  | .empty, .execute => 1
  | .empty, _ => 0
  | .committed, .execute => 2
  | .committed, _ => 1







end Recovery
Source
Alexandre Couret, https://github.com/alexcour/CAUSAL-PAIR-01/blob/02bcbbf17dfaade51171885578a228b16736d425/causal_fiber_01/CausalFiber01.lean; source SHA-256 bcff7eeabd153cd20f42ccd810dd20c074c9a899271ba5d29a4d6ed056b197ad

View graph

Get started

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

About Prove2Me

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

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me