Reachability and axis-specific invalidation seeds
DefinitionCouret_STAT_TRANS_03_DependencyGraph_a12904c0d89dcouret-programmecouret-unification-20261108
For an arbitrary node type and directed edge relation, defines reflexive-transitive Reach by a reflexive constructor and extension by one edge; edge a b is read as b depending directly on a. Impacted holds when some changed seed reaches the node. A ChangeAt record pairs a node with a contract Delta. SemanticSeed, ReplaySeed and NoveltySeed select changes whose corresponding Boolean invalidation field is true; the three axis-specific Impacted predicates propagate their seeds by Reach. An empty change list supplies no seeds; the graph need not be finite or acyclic.
Definition code
import Mathlib.Data.Set.Basic
import Definitions.Def_Couret_STAT_TRANS_02_ClaimContract_997da1c8f8df
/-!
# STAT-TRANS-03 — Dependency graph and differential invalidation
This file formalizes a minimal dependency graph for claim-contract invalidation.
Orientation:
edge a b
means:
b directly depends on a.
A change at a node propagates only to nodes reachable from that node.
The construction is deliberately generic and does not encode a global
"everything invalidates everything" policy.
No RH claim. No novelty claim.
-/
namespace CouretOaiBridge01
namespace StatusTransport
/-- Reflexive-transitive reachability generated by a direct dependency edge. -/
inductive Reach {α : Type*} (edge : α → α → Prop) : α → α → Prop
| refl (x : α) : Reach edge x x
| step {a b c : α} : Reach edge a b → edge b c → Reach edge a c
/-- A node is impacted when some changed seed reaches it. -/
def Impacted {α : Type*}
(edge : α → α → Prop) (changed : α → Prop) (x : α) : Prop :=
∃ s, changed s ∧ Reach edge s x
/--
A changed contract carries both its local delta and its location in the
dependency graph. Later layers may refine this into per-axis edge labels.
-/
structure ChangeAt (α : Type*) where
node : α
delta : Delta
/--
Semantic invalidation seeds only those local changes whose delta says that
semantics must be reconsidered.
-/
def SemanticSeed {α : Type*} (changes : List (ChangeAt α)) (x : α) : Prop :=
∃ c ∈ changes, c.node = x ∧ c.delta.invalidatesSemantic = true
/--
Replay invalidation seeds local changes whose delta invalidates replay.
-/
def ReplaySeed {α : Type*} (changes : List (ChangeAt α)) (x : α) : Prop :=
∃ c ∈ changes, c.node = x ∧ c.delta.invalidatesReplay = true
/--
Novelty invalidation seeds local changes whose delta invalidates novelty.
-/
def NoveltySeed {α : Type*} (changes : List (ChangeAt α)) (x : α) : Prop :=
∃ c ∈ changes, c.node = x ∧ c.delta.invalidatesNovelty = true
/-- Graph-level semantic invalidation. -/
def SemanticImpacted {α : Type*}
(edge : α → α → Prop) (changes : List (ChangeAt α)) (x : α) : Prop :=
Impacted edge (SemanticSeed changes) x
/-- Graph-level replay invalidation. -/
def ReplayImpacted {α : Type*}
(edge : α → α → Prop) (changes : List (ChangeAt α)) (x : α) : Prop :=
Impacted edge (ReplaySeed changes) x
/-- Graph-level novelty invalidation. -/
def NoveltyImpacted {α : Type*}
(edge : α → α → Prop) (changes : List (ChangeAt α)) (x : α) : Prop :=
Impacted edge (NoveltySeed changes) x
end StatusTransport
end CouretOaiBridge01
Source
Alexandre Couret, https://github.com/alexcour/couret-finite-verifications/blob/d71ed2dafa9daa082f1a801b51d8a58abdb2c473/research/lean/CouretOaiBridge01/STAT_TRANS_03_DependencyGraph.lean; source file SHA-256 4e4de934f82aabd60e1dbb0a688ba35489f034249c2859a3a500801ac79d1b30