Documentation

CordialMiners.Tfine.Abstraction

inductive CordialMiners.TfineFact (P : Type u_1) (Wave : Type u_2) (Hash : Type u_3) :
Type (max (max u_1 u_2) u_3)

A fine protocol fact: the coarse facts plus the operational evidence. An approval, certificate, and final each carry the signer set S that the coarse theory abstracts away.

Instances For
    def CordialMiners.instDecidableEqTfineFact.decEq {P✝ : Type u_1} {Wave✝ : Type u_2} {Hash✝ : Type u_3} [DecidableEq P✝] [DecidableEq Wave✝] [DecidableEq Hash✝] (x✝ x✝¹ : TfineFact P✝ Wave✝ Hash✝) :
    Decidable (x✝ = x✝¹)
    Equations
    Instances For
      @[implicit_reducible]
      instance CordialMiners.instDecidableEqTfineFact {P✝ : Type u_1} {Wave✝ : Type u_2} {Hash✝ : Type u_3} [DecidableEq P✝] [DecidableEq Wave✝] [DecidableEq Hash✝] :
      DecidableEq (TfineFact P✝ Wave✝ Hash✝)
      Equations
      @[reducible, inline]
      abbrev CordialMiners.TfineState (P : Type u_1) (Wave : Type u_2) (Hash : Type u_3) :
      Type (max (max u_3 u_2) u_1)

      A fine state is the finite set of fine facts established so far.

      Equations
      Instances For
        def CordialMiners.alpha {P : Type u_1} {Wave : Type u_2} {Hash : Type u_3} [DecidableEq Wave] [DecidableEq Hash] (s : TfineState P Wave Hash) :
        TrecState Wave Hash

        The abstraction on states: take the image of every fine fact under alphaFact.

        Equations
        Instances For
          theorem CordialMiners.alpha_empty {P : Type u_1} {Wave : Type u_2} {Hash : Type u_3} [DecidableEq Wave] [DecidableEq Hash] :

          The abstraction of the empty fine state is the empty coarse state.

          theorem CordialMiners.alpha_insert {P : Type u_1} {Wave : Type u_2} {Hash : Type u_3} [DecidableEq P] [DecidableEq Wave] [DecidableEq Hash] (f : TfineFact P Wave Hash) (s : TfineState P Wave Hash) :

          The abstraction commutes with insertion: abstracting a state with one more fact is the abstract state with that fact's coarse shadow inserted.

          inductive CordialMiners.TfineState.Step {P : Type u_1} {Wave : Type u_2} {Hash : Type u_3} [DecidableEq P] [DecidableEq Wave] [DecidableEq Hash] :
          TfineState P Wave HashTfineState P Wave HashProp

          The fine step relation mirrors the coarse one but threads the signer-set evidence: an approval, certificate, or final records the witnessing signers S.

          Instances For
            theorem CordialMiners.tfine_refines_trec {P : Type u_1} {Wave : Type u_2} {Hash : Type u_3} [DecidableEq P] [DecidableEq Wave] [DecidableEq Hash] {s s' : TfineState P Wave Hash} (h : s.Step s') :
            (alpha s).Step (alpha s') alpha s = alpha s'

            Forward simulation (the refinement): every fine step is matched by a coarse step on the abstracted states, or it leaves the abstraction unchanged (when the fact's coarse shadow was already present, e.g. a second certificate for the same value with different signers). The coarse precondition is always met because the fine precondition's coarse shadow lies in the abstracted state.

            Reachability transfers along the abstraction: the abstraction of any fine-reachable state is coarse-reachable. Steps that change the abstraction become coarse steps; steps that do not are absorbed (the abstract state stays put).

            theorem CordialMiners.tfine_reachable_wf {P : Type u_1} {Wave : Type u_2} {Hash : Type u_3} [DecidableEq P] [DecidableEq Wave] [DecidableEq Hash] {s : TfineState P Wave Hash} (h : Relation.ReflTransGen TfineState.Step s) :

            The coarse causal well-formedness lifts to the fine theory: every fine-reachable state abstracts to a causally well-formed coarse state. The proof-friendly coarse safety therefore governs the evidence-carrying operational theory.