Cortex.Wire.AdmissionArtifact.PrimitiveReconstruction


On this page
  1. Overview
  2. Primitive-Key Membership Helpers
  3. Frame-Level Linearity Facts
  4. Primitive Node Row Uniqueness
  5. Primitive Frontier Accounting
  6. Reconstruction Contract
Imports

Overview

Primitive graph reconstruction from a validator-sound admission artifact.

The decoded admission artifact is lower-level than GraphElaboration.CertifiedGraph: it carries primitive boundary rows and a replay stack, not accepted node declarations inside an AdmittedModuleShell. This module therefore names the strongest honest primitive reconstruction target at the artifact boundary.

A PrimitiveGraphReconstruction says:

  • primitive rows replay to one final frame;
  • the final frame is exactly the top-level serialized summary, up to permutation;
  • source-visible frontier rows are duplicate-free;
  • every primitive node-frontier key is accounted for as exposed, consumed, or select-internal; and
  • top-level raw connections are exactly the raw projection of replayed primitive contractions.

The later CertifiedGraph reconstruction step must add the accepted-node/module evidence that is intentionally absent from the serialized artifact rows.

namespace Cortex.Wirenamespace AdmissionArtifactopen Cortex.Wire.ElaborationIRnamespace PrimitiveGraphStep

Primitive-Key Membership Helpers

A primitive node-entry key belongs to the global primitive entry-key ledger.

theorem nodeEntryKeysList_mem_of_node_mem {primitiveSteps : List PrimitiveGraphStep} {node : NodeId} {entries exits : List AdmissionBoundaryPort} {key : NodeId × FieldLabel × ContractId} (hStep : PrimitiveGraphStep.node node entries exits primitiveSteps) (hKey : key entries.map AdmissionBoundaryPort.key) : key nodeEntryKeysList primitiveSteps := primitiveSteps:List PrimitiveGraphStepnode:NodeIdentries:List AdmissionBoundaryPortexits:List AdmissionBoundaryPortkey:NodeId × FieldLabel × ContractIdhStep:PrimitiveGraphStep.node node entries exits primitiveStepshKey:key List.map AdmissionBoundaryPort.key entrieskey nodeEntryKeysList primitiveSteps induction primitiveSteps generalizing key with node:NodeIdentries:List AdmissionBoundaryPortexits:List AdmissionBoundaryPortkey:NodeId × FieldLabel × ContractIdhStep:PrimitiveGraphStep.node node entries exits []hKey:key List.map AdmissionBoundaryPort.key entrieskey nodeEntryKeysList [] All goals completed! 🐙 node:NodeIdentries:List AdmissionBoundaryPortexits:List AdmissionBoundaryPortprimitiveStep:PrimitiveGraphStepprimitiveSteps:List PrimitiveGraphStepih: {key : NodeId × FieldLabel × ContractId}, PrimitiveGraphStep.node node entries exits primitiveSteps key List.map AdmissionBoundaryPort.key entries key nodeEntryKeysList primitiveStepskey:NodeId × FieldLabel × ContractIdhStep:PrimitiveGraphStep.node node entries exits primitiveStep :: primitiveStepshKey:key List.map AdmissionBoundaryPort.key entrieskey nodeEntryKeysList (primitiveStep :: primitiveSteps) cases primitiveStep with node:NodeIdentries:List AdmissionBoundaryPortexits:List AdmissionBoundaryPortprimitiveSteps:List PrimitiveGraphStepih: {key : NodeId × FieldLabel × ContractId}, PrimitiveGraphStep.node node entries exits primitiveSteps key List.map AdmissionBoundaryPort.key entries key nodeEntryKeysList primitiveStepskey:NodeId × FieldLabel × ContractIdhKey:key List.map AdmissionBoundaryPort.key entrieshStep:PrimitiveGraphStep.node node entries exits empty :: primitiveStepskey nodeEntryKeysList (empty :: primitiveSteps) node:NodeIdentries:List AdmissionBoundaryPortexits:List AdmissionBoundaryPortprimitiveSteps:List PrimitiveGraphStepih: {key : NodeId × FieldLabel × ContractId}, PrimitiveGraphStep.node node entries exits primitiveSteps key List.map AdmissionBoundaryPort.key entries key nodeEntryKeysList primitiveStepskey:NodeId × FieldLabel × ContractIdhKey:key List.map AdmissionBoundaryPort.key entrieshStep:PrimitiveGraphStep.node node entries exits = empty PrimitiveGraphStep.node node entries exits primitiveStepskey nodeEntryKeysList (empty :: primitiveSteps) cases hStep with node:NodeIdentries:List AdmissionBoundaryPortexits:List AdmissionBoundaryPortprimitiveSteps:List PrimitiveGraphStepih: {key : NodeId × FieldLabel × ContractId}, PrimitiveGraphStep.node node entries exits primitiveSteps key List.map AdmissionBoundaryPort.key entries key nodeEntryKeysList primitiveStepskey:NodeId × FieldLabel × ContractIdhKey:key List.map AdmissionBoundaryPort.key entrieshHead:PrimitiveGraphStep.node node entries exits = emptykey nodeEntryKeysList (empty :: primitiveSteps) All goals completed! 🐙 node:NodeIdentries:List AdmissionBoundaryPortexits:List AdmissionBoundaryPortprimitiveSteps:List PrimitiveGraphStepih: {key : NodeId × FieldLabel × ContractId}, PrimitiveGraphStep.node node entries exits primitiveSteps key List.map AdmissionBoundaryPort.key entries key nodeEntryKeysList primitiveStepskey:NodeId × FieldLabel × ContractIdhKey:key List.map AdmissionBoundaryPort.key entrieshTail:PrimitiveGraphStep.node node entries exits primitiveStepskey nodeEntryKeysList (empty :: primitiveSteps) All goals completed! 🐙 node:NodeIdentries:List AdmissionBoundaryPortexits:List AdmissionBoundaryPortprimitiveSteps:List PrimitiveGraphStepih: {key : NodeId × FieldLabel × ContractId}, PrimitiveGraphStep.node node entries exits primitiveSteps key List.map AdmissionBoundaryPort.key entries key nodeEntryKeysList primitiveStepskey:NodeId × FieldLabel × ContractIdhKey:key List.map AdmissionBoundaryPort.key entriesrowNode:NodeIdrowEntries:List AdmissionBoundaryPortrowExits:List AdmissionBoundaryPorthStep:PrimitiveGraphStep.node node entries exits PrimitiveGraphStep.node rowNode rowEntries rowExits :: primitiveStepskey nodeEntryKeysList (PrimitiveGraphStep.node rowNode rowEntries rowExits :: primitiveSteps) node:NodeIdentries:List AdmissionBoundaryPortexits:List AdmissionBoundaryPortprimitiveSteps:List PrimitiveGraphStepih: {key : NodeId × FieldLabel × ContractId}, PrimitiveGraphStep.node node entries exits primitiveSteps key List.map AdmissionBoundaryPort.key entries key nodeEntryKeysList primitiveStepskey:NodeId × FieldLabel × ContractIdhKey:key List.map AdmissionBoundaryPort.key entriesrowNode:NodeIdrowEntries:List AdmissionBoundaryPortrowExits:List AdmissionBoundaryPorthStep:PrimitiveGraphStep.node node entries exits = PrimitiveGraphStep.node rowNode rowEntries rowExits PrimitiveGraphStep.node node entries exits primitiveStepskey nodeEntryKeysList (PrimitiveGraphStep.node rowNode rowEntries rowExits :: primitiveSteps) cases hStep with node:NodeIdentries:List AdmissionBoundaryPortexits:List AdmissionBoundaryPortprimitiveSteps:List PrimitiveGraphStepih: {key : NodeId × FieldLabel × ContractId}, PrimitiveGraphStep.node node entries exits primitiveSteps key List.map AdmissionBoundaryPort.key entries key nodeEntryKeysList primitiveStepskey:NodeId × FieldLabel × ContractIdhKey:key List.map AdmissionBoundaryPort.key entriesrowNode:NodeIdrowEntries:List AdmissionBoundaryPortrowExits:List AdmissionBoundaryPorthHead:PrimitiveGraphStep.node node entries exits = PrimitiveGraphStep.node rowNode rowEntries rowExitskey nodeEntryKeysList (PrimitiveGraphStep.node rowNode rowEntries rowExits :: primitiveSteps) node:NodeIdentries:List AdmissionBoundaryPortexits:List AdmissionBoundaryPortprimitiveSteps:List PrimitiveGraphStepih: {key : NodeId × FieldLabel × ContractId}, PrimitiveGraphStep.node node entries exits primitiveSteps key List.map AdmissionBoundaryPort.key entries key nodeEntryKeysList primitiveStepskey:NodeId × FieldLabel × ContractIdhKey:key List.map AdmissionBoundaryPort.key entrieskey nodeEntryKeysList (PrimitiveGraphStep.node node entries exits :: primitiveSteps) All goals completed! 🐙 node:NodeIdentries:List AdmissionBoundaryPortexits:List AdmissionBoundaryPortprimitiveSteps:List PrimitiveGraphStepih: {key : NodeId × FieldLabel × ContractId}, PrimitiveGraphStep.node node entries exits primitiveSteps key List.map AdmissionBoundaryPort.key entries key nodeEntryKeysList primitiveStepskey:NodeId × FieldLabel × ContractIdhKey:key List.map AdmissionBoundaryPort.key entriesrowNode:NodeIdrowEntries:List AdmissionBoundaryPortrowExits:List AdmissionBoundaryPorthTail:PrimitiveGraphStep.node node entries exits primitiveStepskey nodeEntryKeysList (PrimitiveGraphStep.node rowNode rowEntries rowExits :: primitiveSteps) All goals completed! 🐙 node:NodeIdentries:List AdmissionBoundaryPortexits:List AdmissionBoundaryPortprimitiveSteps:List PrimitiveGraphStepih: {key : NodeId × FieldLabel × ContractId}, PrimitiveGraphStep.node node entries exits primitiveSteps key List.map AdmissionBoundaryPort.key entries key nodeEntryKeysList primitiveStepskey:NodeId × FieldLabel × ContractIdhKey:key List.map AdmissionBoundaryPort.key entriesbinding:BindingNamehStep:PrimitiveGraphStep.node node entries exits bindingRef binding :: primitiveStepskey nodeEntryKeysList (bindingRef binding :: primitiveSteps) node:NodeIdentries:List AdmissionBoundaryPortexits:List AdmissionBoundaryPortprimitiveSteps:List PrimitiveGraphStepih: {key : NodeId × FieldLabel × ContractId}, PrimitiveGraphStep.node node entries exits primitiveSteps key List.map AdmissionBoundaryPort.key entries key nodeEntryKeysList primitiveStepskey:NodeId × FieldLabel × ContractIdhKey:key List.map AdmissionBoundaryPort.key entriesbinding:BindingNamehStep:PrimitiveGraphStep.node node entries exits = bindingRef binding PrimitiveGraphStep.node node entries exits primitiveStepskey nodeEntryKeysList (bindingRef binding :: primitiveSteps) cases hStep with node:NodeIdentries:List AdmissionBoundaryPortexits:List AdmissionBoundaryPortprimitiveSteps:List PrimitiveGraphStepih: {key : NodeId × FieldLabel × ContractId}, PrimitiveGraphStep.node node entries exits primitiveSteps key List.map AdmissionBoundaryPort.key entries key nodeEntryKeysList primitiveStepskey:NodeId × FieldLabel × ContractIdhKey:key List.map AdmissionBoundaryPort.key entriesbinding:BindingNamehHead:PrimitiveGraphStep.node node entries exits = bindingRef bindingkey nodeEntryKeysList (bindingRef binding :: primitiveSteps) All goals completed! 🐙 node:NodeIdentries:List AdmissionBoundaryPortexits:List AdmissionBoundaryPortprimitiveSteps:List PrimitiveGraphStepih: {key : NodeId × FieldLabel × ContractId}, PrimitiveGraphStep.node node entries exits primitiveSteps key List.map AdmissionBoundaryPort.key entries key nodeEntryKeysList primitiveStepskey:NodeId × FieldLabel × ContractIdhKey:key List.map AdmissionBoundaryPort.key entriesbinding:BindingNamehTail:PrimitiveGraphStep.node node entries exits primitiveStepskey nodeEntryKeysList (bindingRef binding :: primitiveSteps) All goals completed! 🐙 node:NodeIdentries:List AdmissionBoundaryPortexits:List AdmissionBoundaryPortprimitiveSteps:List PrimitiveGraphStepih: {key : NodeId × FieldLabel × ContractId}, PrimitiveGraphStep.node node entries exits primitiveSteps key List.map AdmissionBoundaryPort.key entries key nodeEntryKeysList primitiveStepskey:NodeId × FieldLabel × ContractIdhKey:key List.map AdmissionBoundaryPort.key entriesleftNodes:List NodeIdrightNodes:List NodeIdleftBindings:List BindingNamerightBindings:List BindingNamehStep:PrimitiveGraphStep.node node entries exits overlay leftNodes rightNodes leftBindings rightBindings :: primitiveStepskey nodeEntryKeysList (overlay leftNodes rightNodes leftBindings rightBindings :: primitiveSteps) node:NodeIdentries:List AdmissionBoundaryPortexits:List AdmissionBoundaryPortprimitiveSteps:List PrimitiveGraphStepih: {key : NodeId × FieldLabel × ContractId}, PrimitiveGraphStep.node node entries exits primitiveSteps key List.map AdmissionBoundaryPort.key entries key nodeEntryKeysList primitiveStepskey:NodeId × FieldLabel × ContractIdhKey:key List.map AdmissionBoundaryPort.key entriesleftNodes:List NodeIdrightNodes:List NodeIdleftBindings:List BindingNamerightBindings:List BindingNamehStep:PrimitiveGraphStep.node node entries exits = overlay leftNodes rightNodes leftBindings rightBindings PrimitiveGraphStep.node node entries exits primitiveStepskey nodeEntryKeysList (overlay leftNodes rightNodes leftBindings rightBindings :: primitiveSteps) cases hStep with node:NodeIdentries:List AdmissionBoundaryPortexits:List AdmissionBoundaryPortprimitiveSteps:List PrimitiveGraphStepih: {key : NodeId × FieldLabel × ContractId}, PrimitiveGraphStep.node node entries exits primitiveSteps key List.map AdmissionBoundaryPort.key entries key nodeEntryKeysList primitiveStepskey:NodeId × FieldLabel × ContractIdhKey:key List.map AdmissionBoundaryPort.key entriesleftNodes:List NodeIdrightNodes:List NodeIdleftBindings:List BindingNamerightBindings:List BindingNamehHead:PrimitiveGraphStep.node node entries exits = overlay leftNodes rightNodes leftBindings rightBindingskey nodeEntryKeysList (overlay leftNodes rightNodes leftBindings rightBindings :: primitiveSteps) All goals completed! 🐙 node:NodeIdentries:List AdmissionBoundaryPortexits:List AdmissionBoundaryPortprimitiveSteps:List PrimitiveGraphStepih: {key : NodeId × FieldLabel × ContractId}, PrimitiveGraphStep.node node entries exits primitiveSteps key List.map AdmissionBoundaryPort.key entries key nodeEntryKeysList primitiveStepskey:NodeId × FieldLabel × ContractIdhKey:key List.map AdmissionBoundaryPort.key entriesleftNodes:List NodeIdrightNodes:List NodeIdleftBindings:List BindingNamerightBindings:List BindingNamehTail:PrimitiveGraphStep.node node entries exits primitiveStepskey nodeEntryKeysList (overlay leftNodes rightNodes leftBindings rightBindings :: primitiveSteps) All goals completed! 🐙 node:NodeIdentries:List AdmissionBoundaryPortexits:List AdmissionBoundaryPortprimitiveSteps:List PrimitiveGraphStepih: {key : NodeId × FieldLabel × ContractId}, PrimitiveGraphStep.node node entries exits primitiveSteps key List.map AdmissionBoundaryPort.key entries key nodeEntryKeysList primitiveStepskey:NodeId × FieldLabel × ContractIdhKey:key List.map AdmissionBoundaryPort.key entriesleftExits:List AdmissionBoundaryPortrightEntries:List AdmissionBoundaryPortmatchedPairs:List AdmissionConnectionunmatchedLeftExits:List AdmissionBoundaryPortunmatchedRightEntries:List AdmissionBoundaryPorthStep:PrimitiveGraphStep.node node entries exits connect leftExits rightEntries matchedPairs unmatchedLeftExits unmatchedRightEntries :: primitiveStepskey nodeEntryKeysList (connect leftExits rightEntries matchedPairs unmatchedLeftExits unmatchedRightEntries :: primitiveSteps) node:NodeIdentries:List AdmissionBoundaryPortexits:List AdmissionBoundaryPortprimitiveSteps:List PrimitiveGraphStepih: {key : NodeId × FieldLabel × ContractId}, PrimitiveGraphStep.node node entries exits primitiveSteps key List.map AdmissionBoundaryPort.key entries key nodeEntryKeysList primitiveStepskey:NodeId × FieldLabel × ContractIdhKey:key List.map AdmissionBoundaryPort.key entriesleftExits:List AdmissionBoundaryPortrightEntries:List AdmissionBoundaryPortmatchedPairs:List AdmissionConnectionunmatchedLeftExits:List AdmissionBoundaryPortunmatchedRightEntries:List AdmissionBoundaryPorthStep:PrimitiveGraphStep.node node entries exits = connect leftExits rightEntries matchedPairs unmatchedLeftExits unmatchedRightEntries PrimitiveGraphStep.node node entries exits primitiveStepskey nodeEntryKeysList (connect leftExits rightEntries matchedPairs unmatchedLeftExits unmatchedRightEntries :: primitiveSteps) cases hStep with node:NodeIdentries:List AdmissionBoundaryPortexits:List AdmissionBoundaryPortprimitiveSteps:List PrimitiveGraphStepih: {key : NodeId × FieldLabel × ContractId}, PrimitiveGraphStep.node node entries exits primitiveSteps key List.map AdmissionBoundaryPort.key entries key nodeEntryKeysList primitiveStepskey:NodeId × FieldLabel × ContractIdhKey:key List.map AdmissionBoundaryPort.key entriesleftExits:List AdmissionBoundaryPortrightEntries:List AdmissionBoundaryPortmatchedPairs:List AdmissionConnectionunmatchedLeftExits:List AdmissionBoundaryPortunmatchedRightEntries:List AdmissionBoundaryPorthHead:PrimitiveGraphStep.node node entries exits = connect leftExits rightEntries matchedPairs unmatchedLeftExits unmatchedRightEntrieskey nodeEntryKeysList (connect leftExits rightEntries matchedPairs unmatchedLeftExits unmatchedRightEntries :: primitiveSteps) All goals completed! 🐙 node:NodeIdentries:List AdmissionBoundaryPortexits:List AdmissionBoundaryPortprimitiveSteps:List PrimitiveGraphStepih: {key : NodeId × FieldLabel × ContractId}, PrimitiveGraphStep.node node entries exits primitiveSteps key List.map AdmissionBoundaryPort.key entries key nodeEntryKeysList primitiveStepskey:NodeId × FieldLabel × ContractIdhKey:key List.map AdmissionBoundaryPort.key entriesleftExits:List AdmissionBoundaryPortrightEntries:List AdmissionBoundaryPortmatchedPairs:List AdmissionConnectionunmatchedLeftExits:List AdmissionBoundaryPortunmatchedRightEntries:List AdmissionBoundaryPorthTail:PrimitiveGraphStep.node node entries exits primitiveStepskey nodeEntryKeysList (connect leftExits rightEntries matchedPairs unmatchedLeftExits unmatchedRightEntries :: primitiveSteps) All goals completed! 🐙

A primitive node-exit key belongs to the global primitive exit-key ledger.

theorem nodeExitKeysList_mem_of_node_mem {primitiveSteps : List PrimitiveGraphStep} {node : NodeId} {entries exits : List AdmissionBoundaryPort} {key : NodeId × FieldLabel × ContractId} (hStep : PrimitiveGraphStep.node node entries exits primitiveSteps) (hKey : key exits.map AdmissionBoundaryPort.key) : key nodeExitKeysList primitiveSteps := primitiveSteps:List PrimitiveGraphStepnode:NodeIdentries:List AdmissionBoundaryPortexits:List AdmissionBoundaryPortkey:NodeId × FieldLabel × ContractIdhStep:PrimitiveGraphStep.node node entries exits primitiveStepshKey:key List.map AdmissionBoundaryPort.key exitskey nodeExitKeysList primitiveSteps induction primitiveSteps generalizing key with node:NodeIdentries:List AdmissionBoundaryPortexits:List AdmissionBoundaryPortkey:NodeId × FieldLabel × ContractIdhStep:PrimitiveGraphStep.node node entries exits []hKey:key List.map AdmissionBoundaryPort.key exitskey nodeExitKeysList [] All goals completed! 🐙 node:NodeIdentries:List AdmissionBoundaryPortexits:List AdmissionBoundaryPortprimitiveStep:PrimitiveGraphStepprimitiveSteps:List PrimitiveGraphStepih: {key : NodeId × FieldLabel × ContractId}, PrimitiveGraphStep.node node entries exits primitiveSteps key List.map AdmissionBoundaryPort.key exits key nodeExitKeysList primitiveStepskey:NodeId × FieldLabel × ContractIdhStep:PrimitiveGraphStep.node node entries exits primitiveStep :: primitiveStepshKey:key List.map AdmissionBoundaryPort.key exitskey nodeExitKeysList (primitiveStep :: primitiveSteps) cases primitiveStep with node:NodeIdentries:List AdmissionBoundaryPortexits:List AdmissionBoundaryPortprimitiveSteps:List PrimitiveGraphStepih: {key : NodeId × FieldLabel × ContractId}, PrimitiveGraphStep.node node entries exits primitiveSteps key List.map AdmissionBoundaryPort.key exits key nodeExitKeysList primitiveStepskey:NodeId × FieldLabel × ContractIdhKey:key List.map AdmissionBoundaryPort.key exitshStep:PrimitiveGraphStep.node node entries exits empty :: primitiveStepskey nodeExitKeysList (empty :: primitiveSteps) node:NodeIdentries:List AdmissionBoundaryPortexits:List AdmissionBoundaryPortprimitiveSteps:List PrimitiveGraphStepih: {key : NodeId × FieldLabel × ContractId}, PrimitiveGraphStep.node node entries exits primitiveSteps key List.map AdmissionBoundaryPort.key exits key nodeExitKeysList primitiveStepskey:NodeId × FieldLabel × ContractIdhKey:key List.map AdmissionBoundaryPort.key exitshStep:PrimitiveGraphStep.node node entries exits = empty PrimitiveGraphStep.node node entries exits primitiveStepskey nodeExitKeysList (empty :: primitiveSteps) cases hStep with node:NodeIdentries:List AdmissionBoundaryPortexits:List AdmissionBoundaryPortprimitiveSteps:List PrimitiveGraphStepih: {key : NodeId × FieldLabel × ContractId}, PrimitiveGraphStep.node node entries exits primitiveSteps key List.map AdmissionBoundaryPort.key exits key nodeExitKeysList primitiveStepskey:NodeId × FieldLabel × ContractIdhKey:key List.map AdmissionBoundaryPort.key exitshHead:PrimitiveGraphStep.node node entries exits = emptykey nodeExitKeysList (empty :: primitiveSteps) All goals completed! 🐙 node:NodeIdentries:List AdmissionBoundaryPortexits:List AdmissionBoundaryPortprimitiveSteps:List PrimitiveGraphStepih: {key : NodeId × FieldLabel × ContractId}, PrimitiveGraphStep.node node entries exits primitiveSteps key List.map AdmissionBoundaryPort.key exits key nodeExitKeysList primitiveStepskey:NodeId × FieldLabel × ContractIdhKey:key List.map AdmissionBoundaryPort.key exitshTail:PrimitiveGraphStep.node node entries exits primitiveStepskey nodeExitKeysList (empty :: primitiveSteps) All goals completed! 🐙 node:NodeIdentries:List AdmissionBoundaryPortexits:List AdmissionBoundaryPortprimitiveSteps:List PrimitiveGraphStepih: {key : NodeId × FieldLabel × ContractId}, PrimitiveGraphStep.node node entries exits primitiveSteps key List.map AdmissionBoundaryPort.key exits key nodeExitKeysList primitiveStepskey:NodeId × FieldLabel × ContractIdhKey:key List.map AdmissionBoundaryPort.key exitsrowNode:NodeIdrowEntries:List AdmissionBoundaryPortrowExits:List AdmissionBoundaryPorthStep:PrimitiveGraphStep.node node entries exits PrimitiveGraphStep.node rowNode rowEntries rowExits :: primitiveStepskey nodeExitKeysList (PrimitiveGraphStep.node rowNode rowEntries rowExits :: primitiveSteps) node:NodeIdentries:List AdmissionBoundaryPortexits:List AdmissionBoundaryPortprimitiveSteps:List PrimitiveGraphStepih: {key : NodeId × FieldLabel × ContractId}, PrimitiveGraphStep.node node entries exits primitiveSteps key List.map AdmissionBoundaryPort.key exits key nodeExitKeysList primitiveStepskey:NodeId × FieldLabel × ContractIdhKey:key List.map AdmissionBoundaryPort.key exitsrowNode:NodeIdrowEntries:List AdmissionBoundaryPortrowExits:List AdmissionBoundaryPorthStep:PrimitiveGraphStep.node node entries exits = PrimitiveGraphStep.node rowNode rowEntries rowExits PrimitiveGraphStep.node node entries exits primitiveStepskey nodeExitKeysList (PrimitiveGraphStep.node rowNode rowEntries rowExits :: primitiveSteps) cases hStep with node:NodeIdentries:List AdmissionBoundaryPortexits:List AdmissionBoundaryPortprimitiveSteps:List PrimitiveGraphStepih: {key : NodeId × FieldLabel × ContractId}, PrimitiveGraphStep.node node entries exits primitiveSteps key List.map AdmissionBoundaryPort.key exits key nodeExitKeysList primitiveStepskey:NodeId × FieldLabel × ContractIdhKey:key List.map AdmissionBoundaryPort.key exitsrowNode:NodeIdrowEntries:List AdmissionBoundaryPortrowExits:List AdmissionBoundaryPorthHead:PrimitiveGraphStep.node node entries exits = PrimitiveGraphStep.node rowNode rowEntries rowExitskey nodeExitKeysList (PrimitiveGraphStep.node rowNode rowEntries rowExits :: primitiveSteps) node:NodeIdentries:List AdmissionBoundaryPortexits:List AdmissionBoundaryPortprimitiveSteps:List PrimitiveGraphStepih: {key : NodeId × FieldLabel × ContractId}, PrimitiveGraphStep.node node entries exits primitiveSteps key List.map AdmissionBoundaryPort.key exits key nodeExitKeysList primitiveStepskey:NodeId × FieldLabel × ContractIdhKey:key List.map AdmissionBoundaryPort.key exitskey nodeExitKeysList (PrimitiveGraphStep.node node entries exits :: primitiveSteps) All goals completed! 🐙 node:NodeIdentries:List AdmissionBoundaryPortexits:List AdmissionBoundaryPortprimitiveSteps:List PrimitiveGraphStepih: {key : NodeId × FieldLabel × ContractId}, PrimitiveGraphStep.node node entries exits primitiveSteps key List.map AdmissionBoundaryPort.key exits key nodeExitKeysList primitiveStepskey:NodeId × FieldLabel × ContractIdhKey:key List.map AdmissionBoundaryPort.key exitsrowNode:NodeIdrowEntries:List AdmissionBoundaryPortrowExits:List AdmissionBoundaryPorthTail:PrimitiveGraphStep.node node entries exits primitiveStepskey nodeExitKeysList (PrimitiveGraphStep.node rowNode rowEntries rowExits :: primitiveSteps) All goals completed! 🐙 node:NodeIdentries:List AdmissionBoundaryPortexits:List AdmissionBoundaryPortprimitiveSteps:List PrimitiveGraphStepih: {key : NodeId × FieldLabel × ContractId}, PrimitiveGraphStep.node node entries exits primitiveSteps key List.map AdmissionBoundaryPort.key exits key nodeExitKeysList primitiveStepskey:NodeId × FieldLabel × ContractIdhKey:key List.map AdmissionBoundaryPort.key exitsbinding:BindingNamehStep:PrimitiveGraphStep.node node entries exits bindingRef binding :: primitiveStepskey nodeExitKeysList (bindingRef binding :: primitiveSteps) node:NodeIdentries:List AdmissionBoundaryPortexits:List AdmissionBoundaryPortprimitiveSteps:List PrimitiveGraphStepih: {key : NodeId × FieldLabel × ContractId}, PrimitiveGraphStep.node node entries exits primitiveSteps key List.map AdmissionBoundaryPort.key exits key nodeExitKeysList primitiveStepskey:NodeId × FieldLabel × ContractIdhKey:key List.map AdmissionBoundaryPort.key exitsbinding:BindingNamehStep:PrimitiveGraphStep.node node entries exits = bindingRef binding PrimitiveGraphStep.node node entries exits primitiveStepskey nodeExitKeysList (bindingRef binding :: primitiveSteps) cases hStep with node:NodeIdentries:List AdmissionBoundaryPortexits:List AdmissionBoundaryPortprimitiveSteps:List PrimitiveGraphStepih: {key : NodeId × FieldLabel × ContractId}, PrimitiveGraphStep.node node entries exits primitiveSteps key List.map AdmissionBoundaryPort.key exits key nodeExitKeysList primitiveStepskey:NodeId × FieldLabel × ContractIdhKey:key List.map AdmissionBoundaryPort.key exitsbinding:BindingNamehHead:PrimitiveGraphStep.node node entries exits = bindingRef bindingkey nodeExitKeysList (bindingRef binding :: primitiveSteps) All goals completed! 🐙 node:NodeIdentries:List AdmissionBoundaryPortexits:List AdmissionBoundaryPortprimitiveSteps:List PrimitiveGraphStepih: {key : NodeId × FieldLabel × ContractId}, PrimitiveGraphStep.node node entries exits primitiveSteps key List.map AdmissionBoundaryPort.key exits key nodeExitKeysList primitiveStepskey:NodeId × FieldLabel × ContractIdhKey:key List.map AdmissionBoundaryPort.key exitsbinding:BindingNamehTail:PrimitiveGraphStep.node node entries exits primitiveStepskey nodeExitKeysList (bindingRef binding :: primitiveSteps) All goals completed! 🐙 node:NodeIdentries:List AdmissionBoundaryPortexits:List AdmissionBoundaryPortprimitiveSteps:List PrimitiveGraphStepih: {key : NodeId × FieldLabel × ContractId}, PrimitiveGraphStep.node node entries exits primitiveSteps key List.map AdmissionBoundaryPort.key exits key nodeExitKeysList primitiveStepskey:NodeId × FieldLabel × ContractIdhKey:key List.map AdmissionBoundaryPort.key exitsleftNodes:List NodeIdrightNodes:List NodeIdleftBindings:List BindingNamerightBindings:List BindingNamehStep:PrimitiveGraphStep.node node entries exits overlay leftNodes rightNodes leftBindings rightBindings :: primitiveStepskey nodeExitKeysList (overlay leftNodes rightNodes leftBindings rightBindings :: primitiveSteps) node:NodeIdentries:List AdmissionBoundaryPortexits:List AdmissionBoundaryPortprimitiveSteps:List PrimitiveGraphStepih: {key : NodeId × FieldLabel × ContractId}, PrimitiveGraphStep.node node entries exits primitiveSteps key List.map AdmissionBoundaryPort.key exits key nodeExitKeysList primitiveStepskey:NodeId × FieldLabel × ContractIdhKey:key List.map AdmissionBoundaryPort.key exitsleftNodes:List NodeIdrightNodes:List NodeIdleftBindings:List BindingNamerightBindings:List BindingNamehStep:PrimitiveGraphStep.node node entries exits = overlay leftNodes rightNodes leftBindings rightBindings PrimitiveGraphStep.node node entries exits primitiveStepskey nodeExitKeysList (overlay leftNodes rightNodes leftBindings rightBindings :: primitiveSteps) cases hStep with node:NodeIdentries:List AdmissionBoundaryPortexits:List AdmissionBoundaryPortprimitiveSteps:List PrimitiveGraphStepih: {key : NodeId × FieldLabel × ContractId}, PrimitiveGraphStep.node node entries exits primitiveSteps key List.map AdmissionBoundaryPort.key exits key nodeExitKeysList primitiveStepskey:NodeId × FieldLabel × ContractIdhKey:key List.map AdmissionBoundaryPort.key exitsleftNodes:List NodeIdrightNodes:List NodeIdleftBindings:List BindingNamerightBindings:List BindingNamehHead:PrimitiveGraphStep.node node entries exits = overlay leftNodes rightNodes leftBindings rightBindingskey nodeExitKeysList (overlay leftNodes rightNodes leftBindings rightBindings :: primitiveSteps) All goals completed! 🐙 node:NodeIdentries:List AdmissionBoundaryPortexits:List AdmissionBoundaryPortprimitiveSteps:List PrimitiveGraphStepih: {key : NodeId × FieldLabel × ContractId}, PrimitiveGraphStep.node node entries exits primitiveSteps key List.map AdmissionBoundaryPort.key exits key nodeExitKeysList primitiveStepskey:NodeId × FieldLabel × ContractIdhKey:key List.map AdmissionBoundaryPort.key exitsleftNodes:List NodeIdrightNodes:List NodeIdleftBindings:List BindingNamerightBindings:List BindingNamehTail:PrimitiveGraphStep.node node entries exits primitiveStepskey nodeExitKeysList (overlay leftNodes rightNodes leftBindings rightBindings :: primitiveSteps) All goals completed! 🐙 node:NodeIdentries:List AdmissionBoundaryPortexits:List AdmissionBoundaryPortprimitiveSteps:List PrimitiveGraphStepih: {key : NodeId × FieldLabel × ContractId}, PrimitiveGraphStep.node node entries exits primitiveSteps key List.map AdmissionBoundaryPort.key exits key nodeExitKeysList primitiveStepskey:NodeId × FieldLabel × ContractIdhKey:key List.map AdmissionBoundaryPort.key exitsleftExits:List AdmissionBoundaryPortrightEntries:List AdmissionBoundaryPortmatchedPairs:List AdmissionConnectionunmatchedLeftExits:List AdmissionBoundaryPortunmatchedRightEntries:List AdmissionBoundaryPorthStep:PrimitiveGraphStep.node node entries exits connect leftExits rightEntries matchedPairs unmatchedLeftExits unmatchedRightEntries :: primitiveStepskey nodeExitKeysList (connect leftExits rightEntries matchedPairs unmatchedLeftExits unmatchedRightEntries :: primitiveSteps) node:NodeIdentries:List AdmissionBoundaryPortexits:List AdmissionBoundaryPortprimitiveSteps:List PrimitiveGraphStepih: {key : NodeId × FieldLabel × ContractId}, PrimitiveGraphStep.node node entries exits primitiveSteps key List.map AdmissionBoundaryPort.key exits key nodeExitKeysList primitiveStepskey:NodeId × FieldLabel × ContractIdhKey:key List.map AdmissionBoundaryPort.key exitsleftExits:List AdmissionBoundaryPortrightEntries:List AdmissionBoundaryPortmatchedPairs:List AdmissionConnectionunmatchedLeftExits:List AdmissionBoundaryPortunmatchedRightEntries:List AdmissionBoundaryPorthStep:PrimitiveGraphStep.node node entries exits = connect leftExits rightEntries matchedPairs unmatchedLeftExits unmatchedRightEntries PrimitiveGraphStep.node node entries exits primitiveStepskey nodeExitKeysList (connect leftExits rightEntries matchedPairs unmatchedLeftExits unmatchedRightEntries :: primitiveSteps) cases hStep with node:NodeIdentries:List AdmissionBoundaryPortexits:List AdmissionBoundaryPortprimitiveSteps:List PrimitiveGraphStepih: {key : NodeId × FieldLabel × ContractId}, PrimitiveGraphStep.node node entries exits primitiveSteps key List.map AdmissionBoundaryPort.key exits key nodeExitKeysList primitiveStepskey:NodeId × FieldLabel × ContractIdhKey:key List.map AdmissionBoundaryPort.key exitsleftExits:List AdmissionBoundaryPortrightEntries:List AdmissionBoundaryPortmatchedPairs:List AdmissionConnectionunmatchedLeftExits:List AdmissionBoundaryPortunmatchedRightEntries:List AdmissionBoundaryPorthHead:PrimitiveGraphStep.node node entries exits = connect leftExits rightEntries matchedPairs unmatchedLeftExits unmatchedRightEntrieskey nodeExitKeysList (connect leftExits rightEntries matchedPairs unmatchedLeftExits unmatchedRightEntries :: primitiveSteps) All goals completed! 🐙 node:NodeIdentries:List AdmissionBoundaryPortexits:List AdmissionBoundaryPortprimitiveSteps:List PrimitiveGraphStepih: {key : NodeId × FieldLabel × ContractId}, PrimitiveGraphStep.node node entries exits primitiveSteps key List.map AdmissionBoundaryPort.key exits key nodeExitKeysList primitiveStepskey:NodeId × FieldLabel × ContractIdhKey:key List.map AdmissionBoundaryPort.key exitsleftExits:List AdmissionBoundaryPortrightEntries:List AdmissionBoundaryPortmatchedPairs:List AdmissionConnectionunmatchedLeftExits:List AdmissionBoundaryPortunmatchedRightEntries:List AdmissionBoundaryPorthTail:PrimitiveGraphStep.node node entries exits primitiveStepskey nodeExitKeysList (connect leftExits rightEntries matchedPairs unmatchedLeftExits unmatchedRightEntries :: primitiveSteps) All goals completed! 🐙end PrimitiveGraphStepnamespace WireAdmissionArtifactnamespace PrimitiveTraceFrame

Frame-Level Linearity Facts

Duplicate-free primitive replay rows after summary matching.

This is the artifact-level frontier-linearity fact: source-visible entry and exit endpoints have unique boundary keys, and the raw connection summary has no duplicate serialized connection rows. It is deliberately phrased over the primitive replay frame rather than over LinearPortObject, because artifact rows do not carry accepted node declarations.

structure SourceVisibleRowsUnique (frame : PrimitiveTraceFrame) : Prop where nodesUnique : frame.nodes.Nodup bindingRefsUnique : frame.bindingRefs.Nodup entriesUnique : (frame.entries.map AdmissionBoundaryPort.key).Nodup exitsUnique : (frame.exits.map AdmissionBoundaryPort.key).Nodup connectionsUnique : frame.connections.Nodup

A summary-matching frame inherits the artifact's duplicate-free summary rows.

theorem sourceVisibleRowsUnique_of_matchesSummary {frame : PrimitiveTraceFrame} {artifact : WireAdmissionArtifact} (hMatch : frame.MatchesSummary artifact) (hUnique : artifact.SummaryKeysUnique) : frame.SourceVisibleRowsUnique where nodesUnique := frame:PrimitiveTraceFrameartifact:WireAdmissionArtifacthMatch:frame.MatchesSummary artifacthUnique:artifact.SummaryKeysUniqueframe.nodes.Nodup All goals completed! 🐙 bindingRefsUnique := frame:PrimitiveTraceFrameartifact:WireAdmissionArtifacthMatch:frame.MatchesSummary artifacthUnique:artifact.SummaryKeysUniqueframe.bindingRefs.Nodup All goals completed! 🐙 entriesUnique := frame:PrimitiveTraceFrameartifact:WireAdmissionArtifacthMatch:frame.MatchesSummary artifacthUnique:artifact.SummaryKeysUnique(List.map AdmissionBoundaryPort.key frame.entries).Nodup frame:PrimitiveTraceFrameartifact:WireAdmissionArtifacthMatch:frame.MatchesSummary artifacthUnique:artifact.SummaryKeysUniquehPerm:(List.map AdmissionBoundaryPort.key frame.entries).Perm (List.map AdmissionBoundaryPort.key artifact.entries)(List.map AdmissionBoundaryPort.key frame.entries).Nodup All goals completed! 🐙 exitsUnique := frame:PrimitiveTraceFrameartifact:WireAdmissionArtifacthMatch:frame.MatchesSummary artifacthUnique:artifact.SummaryKeysUnique(List.map AdmissionBoundaryPort.key frame.exits).Nodup frame:PrimitiveTraceFrameartifact:WireAdmissionArtifacthMatch:frame.MatchesSummary artifacthUnique:artifact.SummaryKeysUniquehPerm:(List.map AdmissionBoundaryPort.key frame.exits).Perm (List.map AdmissionBoundaryPort.key artifact.exits)(List.map AdmissionBoundaryPort.key frame.exits).Nodup All goals completed! 🐙 connectionsUnique := frame:PrimitiveTraceFrameartifact:WireAdmissionArtifacthMatch:frame.MatchesSummary artifacthUnique:artifact.SummaryKeysUniqueframe.connections.Nodup All goals completed! 🐙end PrimitiveTraceFrame

Primitive Node Row Uniqueness

Sound artifacts have duplicate-free primitive node identity rows.

Sound.primitive carries summaryIdentitiesMatchPrimitive and summaryKeysUnique.nodesUnique; together they force the primitive node-row ledger to inherit the top-level summary's Nodup. Reconstruction proofs use this to identify the unique primitive node row for a given NodeId.

theorem PrimitiveSound.primitiveNodeRowsUnique {artifact : WireAdmissionArtifact} (hPrimitive : artifact.PrimitiveSound) : (PrimitiveGraphStep.nodeRowsList artifact.primitiveSteps).Nodup := hPrimitive.summaryIdentitiesMatchPrimitive.left.nodup_iff.mp hPrimitive.summaryKeysUnique.nodesUnique

Sound artifacts have at most one primitive node row per NodeId.

theorem PrimitiveSound.primitiveNode_frontiers_unique {artifact : WireAdmissionArtifact} (hPrimitive : artifact.PrimitiveSound) {node : NodeId} {entries₁ exits₁ entries₂ exits₂ : List AdmissionBoundaryPort} (hLeft : PrimitiveGraphStep.node node entries₁ exits₁ artifact.primitiveSteps) (hRight : PrimitiveGraphStep.node node entries₂ exits₂ artifact.primitiveSteps) : entries₁ = entries₂ exits₁ = exits₂ := PrimitiveGraphStep.node_frontiers_eq_of_nodeRowsList_nodup hPrimitive.primitiveNodeRowsUnique hLeft hRight

Sound artifacts have at most one primitive node row per NodeId.

theorem Sound.primitiveNode_frontiers_unique {artifact : WireAdmissionArtifact} (hSound : artifact.Sound) {node : NodeId} {entries₁ exits₁ entries₂ exits₂ : List AdmissionBoundaryPort} (hLeft : PrimitiveGraphStep.node node entries₁ exits₁ artifact.primitiveSteps) (hRight : PrimitiveGraphStep.node node entries₂ exits₂ artifact.primitiveSteps) : entries₁ = entries₂ exits₁ = exits₂ := hSound.primitive.primitiveNode_frontiers_unique hLeft hRight

Primitive Frontier Accounting

A primitive input key is accounted for either as a source-visible entry or as an input consumed by a primitive contraction.

inductive PrimitiveInputKeyAccounted (artifact : WireAdmissionArtifact) (key : NodeId × FieldLabel × ContractId) : Prop where | exposed : key artifact.entries.map AdmissionBoundaryPort.key PrimitiveInputKeyAccounted artifact key | consumed : key PrimitiveGraphStep.consumedEntryKeysList artifact.primitiveSteps PrimitiveInputKeyAccounted artifact key

A primitive output key is accounted for as a source-visible exit, as an output consumed by a primitive contraction, or as a select-condition internal choice exit hidden from the source-visible summary.

inductive PrimitiveOutputKeyAccounted (artifact : WireAdmissionArtifact) (key : NodeId × FieldLabel × ContractId) : Prop where | exposed : key artifact.exits.map AdmissionBoundaryPort.key PrimitiveOutputKeyAccounted artifact key | consumed : key PrimitiveGraphStep.consumedExitKeysList artifact.primitiveSteps PrimitiveOutputKeyAccounted artifact key | selectInternal : artifact.SelectInternalExitKey key PrimitiveOutputKeyAccounted artifact key

Every primitive node frontier key has a linear accounting classification.

structure PrimitiveFrontierKeysAccounted (artifact : WireAdmissionArtifact) : Prop where inputs : {key : NodeId × FieldLabel × ContractId}, key PrimitiveGraphStep.nodeEntryKeysList artifact.primitiveSteps PrimitiveInputKeyAccounted artifact key outputs : {key : NodeId × FieldLabel × ContractId}, key PrimitiveGraphStep.nodeExitKeysList artifact.primitiveSteps PrimitiveOutputKeyAccounted artifact key

Exact residual-frontier coverage classifies every primitive input key.

theorem primitiveInputKey_accounted {artifact : WireAdmissionArtifact} (hFrontiers : artifact.SummaryFrontiersMatchPrimitive) {key : NodeId × FieldLabel × ContractId} (hPrimitiveKey : key PrimitiveGraphStep.nodeEntryKeysList artifact.primitiveSteps) : PrimitiveInputKeyAccounted artifact key := artifact:WireAdmissionArtifacthFrontiers:artifact.SummaryFrontiersMatchPrimitivekey:NodeId × FieldLabel × ContractIdhPrimitiveKey:key PrimitiveGraphStep.nodeEntryKeysList artifact.primitiveStepsartifact.PrimitiveInputKeyAccounted key artifact:WireAdmissionArtifacthFrontiers:artifact.SummaryFrontiersMatchPrimitivekey:NodeId × FieldLabel × ContractIdhPrimitiveKey:key PrimitiveGraphStep.nodeEntryKeysList artifact.primitiveStepshConsumed:key PrimitiveGraphStep.consumedEntryKeysList artifact.primitiveStepsartifact.PrimitiveInputKeyAccounted keyartifact:WireAdmissionArtifacthFrontiers:artifact.SummaryFrontiersMatchPrimitivekey:NodeId × FieldLabel × ContractIdhPrimitiveKey:key PrimitiveGraphStep.nodeEntryKeysList artifact.primitiveStepshConsumed:key PrimitiveGraphStep.consumedEntryKeysList artifact.primitiveStepsartifact.PrimitiveInputKeyAccounted key artifact:WireAdmissionArtifacthFrontiers:artifact.SummaryFrontiersMatchPrimitivekey:NodeId × FieldLabel × ContractIdhPrimitiveKey:key PrimitiveGraphStep.nodeEntryKeysList artifact.primitiveStepshConsumed:key PrimitiveGraphStep.consumedEntryKeysList artifact.primitiveStepsartifact.PrimitiveInputKeyAccounted key All goals completed! 🐙 artifact:WireAdmissionArtifacthFrontiers:artifact.SummaryFrontiersMatchPrimitivekey:NodeId × FieldLabel × ContractIdhPrimitiveKey:key PrimitiveGraphStep.nodeEntryKeysList artifact.primitiveStepshConsumed:key PrimitiveGraphStep.consumedEntryKeysList artifact.primitiveStepsartifact.PrimitiveInputKeyAccounted key All goals completed! 🐙

Exact residual-frontier coverage classifies every primitive output key.

theorem primitiveOutputKey_accounted {artifact : WireAdmissionArtifact} (hFrontiers : artifact.SummaryFrontiersMatchPrimitive) {key : NodeId × FieldLabel × ContractId} (hPrimitiveKey : key PrimitiveGraphStep.nodeExitKeysList artifact.primitiveSteps) : PrimitiveOutputKeyAccounted artifact key := artifact:WireAdmissionArtifacthFrontiers:artifact.SummaryFrontiersMatchPrimitivekey:NodeId × FieldLabel × ContractIdhPrimitiveKey:key PrimitiveGraphStep.nodeExitKeysList artifact.primitiveStepsartifact.PrimitiveOutputKeyAccounted key artifact:WireAdmissionArtifacthFrontiers:artifact.SummaryFrontiersMatchPrimitivekey:NodeId × FieldLabel × ContractIdhPrimitiveKey:key PrimitiveGraphStep.nodeExitKeysList artifact.primitiveStepshConsumed:key PrimitiveGraphStep.consumedExitKeysList artifact.primitiveStepsartifact.PrimitiveOutputKeyAccounted keyartifact:WireAdmissionArtifacthFrontiers:artifact.SummaryFrontiersMatchPrimitivekey:NodeId × FieldLabel × ContractIdhPrimitiveKey:key PrimitiveGraphStep.nodeExitKeysList artifact.primitiveStepshConsumed:key PrimitiveGraphStep.consumedExitKeysList artifact.primitiveStepsartifact.PrimitiveOutputKeyAccounted key artifact:WireAdmissionArtifacthFrontiers:artifact.SummaryFrontiersMatchPrimitivekey:NodeId × FieldLabel × ContractIdhPrimitiveKey:key PrimitiveGraphStep.nodeExitKeysList artifact.primitiveStepshConsumed:key PrimitiveGraphStep.consumedExitKeysList artifact.primitiveStepsartifact.PrimitiveOutputKeyAccounted key All goals completed! 🐙 artifact:WireAdmissionArtifacthFrontiers:artifact.SummaryFrontiersMatchPrimitivekey:NodeId × FieldLabel × ContractIdhPrimitiveKey:key PrimitiveGraphStep.nodeExitKeysList artifact.primitiveStepshConsumed:key PrimitiveGraphStep.consumedExitKeysList artifact.primitiveStepsartifact.PrimitiveOutputKeyAccounted key artifact:WireAdmissionArtifacthFrontiers:artifact.SummaryFrontiersMatchPrimitivekey:NodeId × FieldLabel × ContractIdhPrimitiveKey:key PrimitiveGraphStep.nodeExitKeysList artifact.primitiveStepshConsumed:key PrimitiveGraphStep.consumedExitKeysList artifact.primitiveStepshInternal:artifact.SelectInternalExitKey keyartifact.PrimitiveOutputKeyAccounted keyartifact:WireAdmissionArtifacthFrontiers:artifact.SummaryFrontiersMatchPrimitivekey:NodeId × FieldLabel × ContractIdhPrimitiveKey:key PrimitiveGraphStep.nodeExitKeysList artifact.primitiveStepshConsumed:key PrimitiveGraphStep.consumedExitKeysList artifact.primitiveStepshInternal:¬artifact.SelectInternalExitKey keyartifact.PrimitiveOutputKeyAccounted key artifact:WireAdmissionArtifacthFrontiers:artifact.SummaryFrontiersMatchPrimitivekey:NodeId × FieldLabel × ContractIdhPrimitiveKey:key PrimitiveGraphStep.nodeExitKeysList artifact.primitiveStepshConsumed:key PrimitiveGraphStep.consumedExitKeysList artifact.primitiveStepshInternal:artifact.SelectInternalExitKey keyartifact.PrimitiveOutputKeyAccounted key All goals completed! 🐙 artifact:WireAdmissionArtifacthFrontiers:artifact.SummaryFrontiersMatchPrimitivekey:NodeId × FieldLabel × ContractIdhPrimitiveKey:key PrimitiveGraphStep.nodeExitKeysList artifact.primitiveStepshConsumed:key PrimitiveGraphStep.consumedExitKeysList artifact.primitiveStepshInternal:¬artifact.SelectInternalExitKey keyartifact.PrimitiveOutputKeyAccounted key All goals completed! 🐙

Exact residual-frontier coverage gives the primitive frontier accounting needed by reconstruction.

theorem primitiveFrontierKeysAccounted {artifact : WireAdmissionArtifact} (hFrontiers : artifact.SummaryFrontiersMatchPrimitive) : artifact.PrimitiveFrontierKeysAccounted where inputs hPrimitiveKey := primitiveInputKey_accounted hFrontiers hPrimitiveKey outputs hPrimitiveKey := primitiveOutputKey_accounted hFrontiers hPrimitiveKey

Reconstruction Contract

Primitive graph evidence reconstructed for one final replay frame.

This is the current artifact-boundary target, not the final GraphElaboration.CertifiedGraph target. The latter additionally needs accepted-node declarations and module binding expansion that are not serialized in primitive artifact rows.

structure PrimitiveGraphReconstructionFrame (artifact : WireAdmissionArtifact) (finalFrame : PrimitiveTraceFrame) : Prop where replay : PrimitiveTraceReplays artifact.SelectInternalTraceExit artifact.primitiveSteps [] [finalFrame] matchesSummary : finalFrame.MatchesSummary artifact sourceVisibleRowsUnique : finalFrame.SourceVisibleRowsUnique frontierKeysAccounted : artifact.PrimitiveFrontierKeysAccounted rawConnectionsMatchPrimitive : artifact.RawConnectionsMatchPrimitive

Primitive graph evidence reconstructed from a sound admission artifact.

def PrimitiveGraphReconstruction (artifact : WireAdmissionArtifact) : Prop := finalFrame, PrimitiveGraphReconstructionFrame artifact finalFrame

Primitive soundness reconstructs the artifact-level primitive graph witness.

theorem PrimitiveSound.toPrimitiveGraphReconstruction {artifact : WireAdmissionArtifact} (hPrimitive : artifact.PrimitiveSound) : artifact.PrimitiveGraphReconstruction := artifact:WireAdmissionArtifacthPrimitive:artifact.PrimitiveSoundartifact.PrimitiveGraphReconstruction artifact:WireAdmissionArtifacthPrimitive:artifact.PrimitiveSoundfinalFrame:PrimitiveTraceFramehReplay:PrimitiveTraceReplays artifact.SelectInternalTraceExit artifact.primitiveSteps [] [finalFrame]hMatch:finalFrame.MatchesSummary artifactartifact.PrimitiveGraphReconstruction All goals completed! 🐙

Validator soundness reconstructs the artifact-level primitive graph witness.

theorem Sound.toPrimitiveGraphReconstruction {artifact : WireAdmissionArtifact} (hSound : artifact.Sound) : artifact.PrimitiveGraphReconstruction := hSound.primitive.toPrimitiveGraphReconstructionend WireAdmissionArtifactend AdmissionArtifactend Cortex.Wire