Name map fixing every declared shared constant to Inserting a nonshared key preserves separation
DefinitionName map fixing every declared shared constant#✓fully proved
A name map leaves every declared shared constant literally fixed.
def FixesShared (Γ : ServiceEnv) (f : Name → Name) : Prop :=
∀ s sig, Γ.lookup s = some sig → f (.const s) = .const s
abbrev ServiceEnv := Finmap (fun _ : Nat => ServiceSignature)
CSLibExt/Languages/SessionTypes/Endpoint/SharedEnvironment.lean:33
inductive Name where
| const (n : ℕ) : Name
| var (i : ℕ) : Name
deriving DecidableEq, Repr
CSLibExt/Languages/PiCalculus/Basic.lean:45
Uses 3 · Used by 3
DefinitionNonaliasing of owned-name images with shared constants#✓fully proved
Actual owned-key images cannot alias a declared shared physical name.
def NonAliases (Γ : ServiceEnv) (Δ : Context) (f : Name → Name) : Prop :=
∀ e ∈ Δ, ∀ s sig, Γ.lookup s = some sig → f e.name ≠ .const s
abbrev ServiceEnv := Finmap (fun _ : Nat => ServiceSignature)
CSLibExt/Languages/SessionTypes/Endpoint/SharedEnvironment.lean:33
abbrev Context := Finmap (fun _ : Key => Capability)
CSLibExt/Languages/SessionTypes/Endpoint/Context.lean:32
inductive Name where
| const (n : ℕ) : Name
| var (i : ℕ) : Name
deriving DecidableEq, Repr
CSLibExt/Languages/PiCalculus/Basic.lean:45
Uses 6 · Used by 14
TheoremBinder extension preserves fixing of shared constants#✓fully proved
Binder extension still fixes shared constants, which are unchanged by lifting.
theorem FixesShared.under {Γ : ServiceEnv} {f : Name → Name} (h : FixesShared Γ f) :
FixesShared Γ (under f)
abbrev ServiceEnv := Finmap (fun _ : Nat => ServiceSignature)
CSLibExt/Languages/SessionTypes/Endpoint/SharedEnvironment.lean:33
inductive Name where
| const (n : ℕ) : Name
| var (i : ℕ) : Name
deriving DecidableEq, Repr
CSLibExt/Languages/PiCalculus/Basic.lean:45
def FixesShared (Γ : ServiceEnv) (f : Name → Name) : Prop :=
∀ s sig, Γ.lookup s = some sig → f (.const s) = .const s
CSLibExt/Languages/SessionTypes/Endpoint/RuntimeNames.lean:29
def under (f : Name → Name) : Name → Name
| .const n => liftName 0 (f (.const n))
| .var 0 => .var 0
| .var (i + 1) => liftName 0 (f (.var i))
CSLibExt/Languages/SessionTypes/Endpoint/Renaming.lean:27
Uses 6 · Used by 2
TheoremRekeying along a nonaliasing name map yields separation#✓fully proved
The actual target ownership rekey has static name separation, not a desired type result.
theorem NonAliases.separated {Γ : ServiceEnv} {Δ : Context} {f : Name → Name}
(h : NonAliases Γ Δ f) (hf : Set.InjOn (Key.mapName f) {e | e ∈ Δ}) :
Separated Γ (Context.rekey (Key.mapName f) Δ hf)
abbrev ServiceEnv := Finmap (fun _ : Nat => ServiceSignature)
CSLibExt/Languages/SessionTypes/Endpoint/SharedEnvironment.lean:33
abbrev Context := Finmap (fun _ : Key => Capability)
CSLibExt/Languages/SessionTypes/Endpoint/Context.lean:32
inductive Name where
| const (n : ℕ) : Name
| var (i : ℕ) : Name
deriving DecidableEq, Repr
CSLibExt/Languages/PiCalculus/Basic.lean:45
def NonAliases (Γ : ServiceEnv) (Δ : Context) (f : Name → Name) : Prop :=
∀ e ∈ Δ, ∀ s sig, Γ.lookup s = some sig → f e.name ≠ .const s
CSLibExt/Languages/SessionTypes/Endpoint/RuntimeNames.lean:33
def Key.mapName (f : PiCalculus.Name → PiCalculus.Name) (e : Key) : Key :=
⟨f e.name, e.role⟩
CSLibExt/Languages/SessionTypes/Endpoint/Identity.lean:60
def Separated (Γ : ServiceEnv) (Δ : Context) : Prop :=
∀ e c, Δ.lookup e = some c → ∀ s sig, Γ.lookup s = some sig → e.name ≠ .const s
CSLibExt/Languages/SessionTypes/Endpoint/SharedEnvironment.lean:36
def Context.rekey (f : Key → Key) (Δ : Context)
(hf : Set.InjOn f {e | e ∈ Δ}) : Context where
entries := Δ.entries.map (fun x => ⟨f x.1, x.2⟩)
nodupKeys := by
apply Multiset.nodup_keys.mp
have h := Multiset.Nodup.map_on hf Δ.nodupKeys.nodup_keys
simpa [Multiset.keys, Multiset.map_map, Function.comp_def] using h
CSLibExt/Languages/SessionTypes/Endpoint/Context.lean:45
Uses 12 · Used by 1
TheoremErasing an owned key preserves nonaliasing#✓fully proved
Erasure restricts the actual owned domain and cannot add a name-map alias.
theorem NonAliases.erase {Γ : ServiceEnv} {Δ : Context} {f : Name → Name}
(h : NonAliases Γ Δ f) (e : Key) : NonAliases Γ (Δ.erase e) f
abbrev ServiceEnv := Finmap (fun _ : Nat => ServiceSignature)
CSLibExt/Languages/SessionTypes/Endpoint/SharedEnvironment.lean:33
abbrev Context := Finmap (fun _ : Key => Capability)
CSLibExt/Languages/SessionTypes/Endpoint/Context.lean:32
inductive Name where
| const (n : ℕ) : Name
| var (i : ℕ) : Name
deriving DecidableEq, Repr
CSLibExt/Languages/PiCalculus/Basic.lean:45
def NonAliases (Γ : ServiceEnv) (Δ : Context) (f : Name → Name) : Prop :=
∀ e ∈ Δ, ∀ s sig, Γ.lookup s = some sig → f e.name ≠ .const s
CSLibExt/Languages/SessionTypes/Endpoint/RuntimeNames.lean:33
structure Key where
name : PiCalculus.Name
role : Role
deriving DecidableEq, Repr
CSLibExt/Languages/SessionTypes/Endpoint/Identity.lean:30
Uses 8 · Used by 1
TheoremUpdating an already-owned key preserves nonaliasing#✓fully proved
Advancing an already-owned key leaves the name-map domain unchanged.
theorem NonAliases.insert_owned {Γ : ServiceEnv} {Δ : Context} {f : Name → Name}
(h : NonAliases Γ Δ f) {e : Key} (he : e ∈ Δ) (c : Capability) :
NonAliases Γ (Δ.insert e c) f
abbrev ServiceEnv := Finmap (fun _ : Nat => ServiceSignature)
CSLibExt/Languages/SessionTypes/Endpoint/SharedEnvironment.lean:33
abbrev Context := Finmap (fun _ : Key => Capability)
CSLibExt/Languages/SessionTypes/Endpoint/Context.lean:32
inductive Name where
| const (n : ℕ) : Name
| var (i : ℕ) : Name
deriving DecidableEq, Repr
CSLibExt/Languages/PiCalculus/Basic.lean:45
def NonAliases (Γ : ServiceEnv) (Δ : Context) (f : Name → Name) : Prop :=
∀ e ∈ Δ, ∀ s sig, Γ.lookup s = some sig → f e.name ≠ .const s
CSLibExt/Languages/SessionTypes/Endpoint/RuntimeNames.lean:33
structure Key where
name : PiCalculus.Name
role : Role
deriving DecidableEq, Repr
CSLibExt/Languages/SessionTypes/Endpoint/Identity.lean:30
structure Capability where
rank : Nat
protocol : Protocol
CSLibExt/Languages/SessionTypes/Endpoint/Context.lean:27
Uses 8 · Used by 1
TheoremEvery name map is nonaliasing on empty ownership#✓fully proved
Empty BODY ownership imposes no linear-image nonalias obligations.
theorem nonaliases_empty (Γ : ServiceEnv) (f : Name → Name) : NonAliases Γ ∅ f
abbrev ServiceEnv := Finmap (fun _ : Nat => ServiceSignature)
CSLibExt/Languages/SessionTypes/Endpoint/SharedEnvironment.lean:33
inductive Name where
| const (n : ℕ) : Name
| var (i : ℕ) : Name
deriving DecidableEq, Repr
CSLibExt/Languages/PiCalculus/Basic.lean:45
def NonAliases (Γ : ServiceEnv) (Δ : Context) (f : Name → Name) : Prop :=
∀ e ∈ Δ, ∀ s sig, Γ.lookup s = some sig → f e.name ≠ .const s
CSLibExt/Languages/SessionTypes/Endpoint/RuntimeNames.lean:33
Uses 7 · Used by 1
TheoremBinder extension preserves nonaliasing of lifted contexts#✓fully proved
Binder extension maps lifted owned names to lifted images, never new shared constants.
theorem NonAliases.under_lift {Γ : ServiceEnv} {Δ : Context} {f : Name → Name}
(h : NonAliases Γ Δ f) : NonAliases Γ (Context.lift 0 Δ) (under f)
abbrev ServiceEnv := Finmap (fun _ : Nat => ServiceSignature)
CSLibExt/Languages/SessionTypes/Endpoint/SharedEnvironment.lean:33
abbrev Context := Finmap (fun _ : Key => Capability)
CSLibExt/Languages/SessionTypes/Endpoint/Context.lean:32
inductive Name where
| const (n : ℕ) : Name
| var (i : ℕ) : Name
deriving DecidableEq, Repr
CSLibExt/Languages/PiCalculus/Basic.lean:45
def NonAliases (Γ : ServiceEnv) (Δ : Context) (f : Name → Name) : Prop :=
∀ e ∈ Δ, ∀ s sig, Γ.lookup s = some sig → f e.name ≠ .const s
CSLibExt/Languages/SessionTypes/Endpoint/RuntimeNames.lean:33
def Context.lift (k : Nat) (Δ : Context) : Context :=
rekey (Key.mapName (liftName k)) Δ
(fun _ _ _ _ h => Key.mapName_injective (liftName_injective k) h)
CSLibExt/Languages/SessionTypes/Endpoint/ContextTransport.lean:28
def under (f : Name → Name) : Name → Name
| .const n => liftName 0 (f (.const n))
| .var 0 => .var 0
| .var (i + 1) => liftName 0 (f (.var i))
CSLibExt/Languages/SessionTypes/Endpoint/Renaming.lean:27
Uses 16 · Used by 3
TheoremNonaliasing survives adding a received parameter under a binder#✓fully proved
A newly received parameter remains var0 under the canonical binder map.
theorem NonAliases.under_received {Γ : ServiceEnv} {Δ : Context} {f : Name → Name}
(h : NonAliases Γ Δ f) (r : Role) (c : Capability) :
NonAliases Γ ((Context.lift 0 Δ).insert ⟨.var 0, r⟩ c) (under f)
abbrev ServiceEnv := Finmap (fun _ : Nat => ServiceSignature)
CSLibExt/Languages/SessionTypes/Endpoint/SharedEnvironment.lean:33
abbrev Context := Finmap (fun _ : Key => Capability)
CSLibExt/Languages/SessionTypes/Endpoint/Context.lean:32
inductive Name where
| const (n : ℕ) : Name
| var (i : ℕ) : Name
deriving DecidableEq, Repr
CSLibExt/Languages/PiCalculus/Basic.lean:45
def NonAliases (Γ : ServiceEnv) (Δ : Context) (f : Name → Name) : Prop :=
∀ e ∈ Δ, ∀ s sig, Γ.lookup s = some sig → f e.name ≠ .const s
CSLibExt/Languages/SessionTypes/Endpoint/RuntimeNames.lean:33
inductive Role where
| positive
| negative
deriving DecidableEq, Repr
CSLibExt/Languages/SessionTypes/Endpoint/Identity.lean:24
structure Capability where
rank : Nat
protocol : Protocol
CSLibExt/Languages/SessionTypes/Endpoint/Context.lean:27
def Context.lift (k : Nat) (Δ : Context) : Context :=
rekey (Key.mapName (liftName k)) Δ
(fun _ _ _ _ h => Key.mapName_injective (liftName_injective k) h)
CSLibExt/Languages/SessionTypes/Endpoint/ContextTransport.lean:28
def under (f : Name → Name) : Name → Name
| .const n => liftName 0 (f (.const n))
| .var 0 => .var 0
| .var (i + 1) => liftName 0 (f (.var i))
CSLibExt/Languages/SessionTypes/Endpoint/Renaming.lean:27
Uses 11 · Used by 1
TheoremNonaliasing survives binding a private session pair#✓fully proved
Both private-role keys are fresh var0; only actual outer names need nonalias transport.
theorem NonAliases.under_bind {Γ : ServiceEnv} {Δ : Context} {f : Name → Name}
(h : NonAliases Γ Δ f) (c : Capability) : NonAliases Γ (Context.bind c Δ) (under f)
abbrev ServiceEnv := Finmap (fun _ : Nat => ServiceSignature)
CSLibExt/Languages/SessionTypes/Endpoint/SharedEnvironment.lean:33
abbrev Context := Finmap (fun _ : Key => Capability)
CSLibExt/Languages/SessionTypes/Endpoint/Context.lean:32
inductive Name where
| const (n : ℕ) : Name
| var (i : ℕ) : Name
deriving DecidableEq, Repr
CSLibExt/Languages/PiCalculus/Basic.lean:45
def NonAliases (Γ : ServiceEnv) (Δ : Context) (f : Name → Name) : Prop :=
∀ e ∈ Δ, ∀ s sig, Γ.lookup s = some sig → f e.name ≠ .const s
CSLibExt/Languages/SessionTypes/Endpoint/RuntimeNames.lean:33
structure Capability where
rank : Nat
protocol : Protocol
CSLibExt/Languages/SessionTypes/Endpoint/Context.lean:27
def Context.bind (c : Capability) (Δ : Context) : Context :=
(lift 0 Δ).insert ⟨.var 0, .positive⟩ c |>
Finmap.insert ⟨.var 0, .negative⟩ c.dual
CSLibExt/Languages/SessionTypes/Endpoint/ContextTransport.lean:49
def under (f : Name → Name) : Name → Name
| .const n => liftName 0 (f (.const n))
| .var 0 => .var 0
| .var (i + 1) => liftName 0 (f (.var i))
CSLibExt/Languages/SessionTypes/Endpoint/Renaming.lean:27
Uses 13 · Used by 1
TheoremNonaliasing restricts to the left part of a union#✓fully proved
Actual left-domain restriction of an ownership union preserves map nonalias.
theorem NonAliases.union_left {Γ : ServiceEnv} {Δ Θ : Context} {f : Name → Name}
(h : NonAliases Γ (Δ ∪ Θ) f) : NonAliases Γ Δ f
abbrev ServiceEnv := Finmap (fun _ : Nat => ServiceSignature)
CSLibExt/Languages/SessionTypes/Endpoint/SharedEnvironment.lean:33
abbrev Context := Finmap (fun _ : Key => Capability)
CSLibExt/Languages/SessionTypes/Endpoint/Context.lean:32
inductive Name where
| const (n : ℕ) : Name
| var (i : ℕ) : Name
deriving DecidableEq, Repr
CSLibExt/Languages/PiCalculus/Basic.lean:45
def NonAliases (Γ : ServiceEnv) (Δ : Context) (f : Name → Name) : Prop :=
∀ e ∈ Δ, ∀ s sig, Γ.lookup s = some sig → f e.name ≠ .const s
CSLibExt/Languages/SessionTypes/Endpoint/RuntimeNames.lean:33
TheoremNonaliasing restricts to the right part of a union#✓fully proved
Actual right-domain restriction likewise preserves map nonalias.
theorem NonAliases.union_right {Γ : ServiceEnv} {Δ Θ : Context} {f : Name → Name}
(h : NonAliases Γ (Δ ∪ Θ) f) : NonAliases Γ Θ f
abbrev ServiceEnv := Finmap (fun _ : Nat => ServiceSignature)
CSLibExt/Languages/SessionTypes/Endpoint/SharedEnvironment.lean:33
abbrev Context := Finmap (fun _ : Key => Capability)
CSLibExt/Languages/SessionTypes/Endpoint/Context.lean:32
inductive Name where
| const (n : ℕ) : Name
| var (i : ℕ) : Name
deriving DecidableEq, Repr
CSLibExt/Languages/PiCalculus/Basic.lean:45
def NonAliases (Γ : ServiceEnv) (Δ : Context) (f : Name → Name) : Prop :=
∀ e ∈ Δ, ∀ s sig, Γ.lookup s = some sig → f e.name ≠ .const s
CSLibExt/Languages/SessionTypes/Endpoint/RuntimeNames.lean:33
TheoremService templates are preserved by renamings fixing shared names#✓fully proved
Structural templates transport through a declared-constant-fixing name map; input BODY typing is handled separately, not hidden in this shape predicate.
theorem ServiceTemplate.rename {Γ : ServiceEnv} {p : Proc} {f : Name → Name}
(h : ServiceTemplate Γ p) (hf : FixesShared Γ f) : ServiceTemplate Γ (mapProc f p)
abbrev ServiceEnv := Finmap (fun _ : Nat => ServiceSignature)
CSLibExt/Languages/SessionTypes/Endpoint/SharedEnvironment.lean:33
inductive Proc where
| nil : Proc
| out (a b : Name) (p : Proc) : Proc
| inp (a : Name) (p : Proc) : Proc
| par (p q : Proc) : Proc
| nu (p : Proc) : Proc
| repl (p : Proc) : Proc
| sum (p q : Proc) : Proc
deriving DecidableEq, Repr
CSLibExt/Languages/PiCalculus/Basic.lean:52
inductive Name where
| const (n : ℕ) : Name
| var (i : ℕ) : Name
deriving DecidableEq, Repr
CSLibExt/Languages/PiCalculus/Basic.lean:45
def ServiceTemplate (Γ : ServiceEnv) : Proc → Prop
| .nil => True
| .inp a _ => ∃ s, a = .const s ∧ s ∈ Γ
| .par p q => ServiceTemplate Γ p ∧ ServiceTemplate Γ q
| .nu p | .repl p => ServiceTemplate Γ p
| .out .. | .sum .. => False
CSLibExt/Languages/SessionTypes/Endpoint/ServiceTemplates.lean:29
def FixesShared (Γ : ServiceEnv) (f : Name → Name) : Prop :=
∀ s sig, Γ.lookup s = some sig → f (.const s) = .const s
CSLibExt/Languages/SessionTypes/Endpoint/RuntimeNames.lean:29
def mapProc (f : Name → Name) : Proc → Proc
| .nil => .nil
| .out a b p => .out (f a) (f b) (mapProc f p)
| .inp a p => .inp (f a) (mapProc (under f) p)
| .par p q => .par (mapProc f p) (mapProc f q)
| .nu p => .nu (mapProc (under f) p)
| .repl p => .repl (mapProc f p)
| .sum p q => .sum (mapProc f p) (mapProc f q)
CSLibExt/Languages/SessionTypes/Endpoint/Renaming.lean:39
Uses 9 · Used by 1
TheoremRekeying preserves shared invocation priority#✓fully proved
Rekeying retains actual cap values and therefore shared-priority comparisons.
theorem InvocationPriority.rekey {sig : ServiceSignature} {Δ : Context} {f : Name → Name}
(h : InvocationPriority sig Δ) (hf : Set.InjOn (Key.mapName f) {e | e ∈ Δ}) :
InvocationPriority sig (Context.rekey (Key.mapName f) Δ hf)
structure ServiceSignature where
priority : Nat
role : Role
capability : Capability
CSLibExt/Languages/SessionTypes/Endpoint/SharedEnvironment.lean:27
abbrev Context := Finmap (fun _ : Key => Capability)
CSLibExt/Languages/SessionTypes/Endpoint/Context.lean:32
inductive Name where
| const (n : ℕ) : Name
| var (i : ℕ) : Name
deriving DecidableEq, Repr
CSLibExt/Languages/PiCalculus/Basic.lean:45
def InvocationPriority (sig : ServiceSignature) (Δ : Context) : Prop :=
∀ e c, Δ.lookup e = some c → c.protocol.unfold ≠ .done → sig.priority < c.rank
CSLibExt/Languages/SessionTypes/Endpoint/SharedEnvironment.lean:40
def Key.mapName (f : PiCalculus.Name → PiCalculus.Name) (e : Key) : Key :=
⟨f e.name, e.role⟩
CSLibExt/Languages/SessionTypes/Endpoint/Identity.lean:60
def Context.rekey (f : Key → Key) (Δ : Context)
(hf : Set.InjOn f {e | e ∈ Δ}) : Context where
entries := Δ.entries.map (fun x => ⟨f x.1, x.2⟩)
nodupKeys := by
apply Multiset.nodup_keys.mp
have h := Multiset.Nodup.map_on hf Δ.nodupKeys.nodup_keys
simpa [Multiset.keys, Multiset.map_map, Function.comp_def] using h
CSLibExt/Languages/SessionTypes/Endpoint/Context.lean:45
Uses 12 · Used by 1
TheoremRekeying the empty context gives the empty context#✓fully proved
An empty owned context stays empty under the canonical context rekey operation.
theorem rekey_empty (f : Name → Name)
(hf : Set.InjOn (Key.mapName f) {e | e ∈ (∅ : Context)}) :
Context.rekey (Key.mapName f) ∅ hf = ∅
inductive Name where
| const (n : ℕ) : Name
| var (i : ℕ) : Name
deriving DecidableEq, Repr
CSLibExt/Languages/PiCalculus/Basic.lean:45
def Key.mapName (f : PiCalculus.Name → PiCalculus.Name) (e : Key) : Key :=
⟨f e.name, e.role⟩
CSLibExt/Languages/SessionTypes/Endpoint/Identity.lean:60
abbrev Context := Finmap (fun _ : Key => Capability)
CSLibExt/Languages/SessionTypes/Endpoint/Context.lean:32
def Context.rekey (f : Key → Key) (Δ : Context)
(hf : Set.InjOn f {e | e ∈ Δ}) : Context where
entries := Δ.entries.map (fun x => ⟨f x.1, x.2⟩)
nodupKeys := by
apply Multiset.nodup_keys.mp
have h := Multiset.Nodup.map_on hf Δ.nodupKeys.nodup_keys
simpa [Multiset.keys, Multiset.map_map, Function.comp_def] using h
CSLibExt/Languages/SessionTypes/Endpoint/Context.lean:45
TheoremRekeying a singleton moves its key and keeps its capability#✓fully proved
Rekeying a singleton moves its actual key and retains its capability verbatim.
theorem rekey_singleton (f : Name → Name) (e : Key) (c : Capability)
(hf : Set.InjOn (Key.mapName f) {d | d ∈ (Finmap.singleton e c : Context)}) :
Context.rekey (Key.mapName f) (Finmap.singleton e c) hf =
Finmap.singleton (Key.mapName f e) c
inductive Name where
| const (n : ℕ) : Name
| var (i : ℕ) : Name
deriving DecidableEq, Repr
CSLibExt/Languages/PiCalculus/Basic.lean:45
structure Key where
name : PiCalculus.Name
role : Role
deriving DecidableEq, Repr
CSLibExt/Languages/SessionTypes/Endpoint/Identity.lean:30
structure Capability where
rank : Nat
protocol : Protocol
CSLibExt/Languages/SessionTypes/Endpoint/Context.lean:27
def Key.mapName (f : PiCalculus.Name → PiCalculus.Name) (e : Key) : Key :=
⟨f e.name, e.role⟩
CSLibExt/Languages/SessionTypes/Endpoint/Identity.lean:60
abbrev Context := Finmap (fun _ : Key => Capability)
CSLibExt/Languages/SessionTypes/Endpoint/Context.lean:32
def Context.rekey (f : Key → Key) (Δ : Context)
(hf : Set.InjOn f {e | e ∈ Δ}) : Context where
entries := Δ.entries.map (fun x => ⟨f x.1, x.2⟩)
nodupKeys := by
apply Multiset.nodup_keys.mp
have h := Multiset.Nodup.map_on hf Δ.nodupKeys.nodup_keys
simpa [Multiset.keys, Multiset.map_map, Function.comp_def] using h
CSLibExt/Languages/SessionTypes/Endpoint/Context.lean:45
Uses 9 · Used by 1
TheoremSeparation gives nonaliasing for binder lifting#✓fully proved
Canonical binder lifting cannot send a nonshared owned name into the shared namespace.
theorem Separated.nonaliases_lift {Γ : ServiceEnv} {Δ : Context} (h : Separated Γ Δ) (k : Nat) :
NonAliases Γ Δ (liftName k)
abbrev ServiceEnv := Finmap (fun _ : Nat => ServiceSignature)
CSLibExt/Languages/SessionTypes/Endpoint/SharedEnvironment.lean:33
abbrev Context := Finmap (fun _ : Key => Capability)
CSLibExt/Languages/SessionTypes/Endpoint/Context.lean:32
def Separated (Γ : ServiceEnv) (Δ : Context) : Prop :=
∀ e c, Δ.lookup e = some c → ∀ s sig, Γ.lookup s = some sig → e.name ≠ .const s
CSLibExt/Languages/SessionTypes/Endpoint/SharedEnvironment.lean:36
def NonAliases (Γ : ServiceEnv) (Δ : Context) (f : Name → Name) : Prop :=
∀ e ∈ Δ, ∀ s sig, Γ.lookup s = some sig → f e.name ≠ .const s
CSLibExt/Languages/SessionTypes/Endpoint/RuntimeNames.lean:33
def liftName (cutoff : ℕ) : Name → Name
| .const n => .const n
| .var i => if cutoff ≤ i then .var (i + 1) else .var i
CSLibExt/Languages/PiCalculus/Basic.lean:64
Uses 11 · Used by 1
TheoremSeparation gives nonaliasing for binder swapping#✓fully proved
Canonical binder swapping likewise preserves actual owned-name nonalias.
theorem Separated.nonaliases_swap {Γ : ServiceEnv} {Δ : Context} (h : Separated Γ Δ) (k : Nat) :
NonAliases Γ Δ (swapNameAt k)
abbrev ServiceEnv := Finmap (fun _ : Nat => ServiceSignature)
CSLibExt/Languages/SessionTypes/Endpoint/SharedEnvironment.lean:33
abbrev Context := Finmap (fun _ : Key => Capability)
CSLibExt/Languages/SessionTypes/Endpoint/Context.lean:32
def Separated (Γ : ServiceEnv) (Δ : Context) : Prop :=
∀ e c, Δ.lookup e = some c → ∀ s sig, Γ.lookup s = some sig → e.name ≠ .const s
CSLibExt/Languages/SessionTypes/Endpoint/SharedEnvironment.lean:36
def NonAliases (Γ : ServiceEnv) (Δ : Context) (f : Name → Name) : Prop :=
∀ e ∈ Δ, ∀ s sig, Γ.lookup s = some sig → f e.name ≠ .const s
CSLibExt/Languages/SessionTypes/Endpoint/RuntimeNames.lean:33
def swapNameAt (cutoff : ℕ) : Name → Name
| .var i => if i = cutoff then .var (cutoff + 1)
else if i = cutoff + 1 then .var cutoff else .var i
| .const n => .const n
CSLibExt/Languages/PiCalculus/Basic.lean:112
Uses 11 · Used by 1
TheoremErasing an owned key preserves separation#✓fully proved
Erasing an actual owned key cannot create a shared/linear name alias.
theorem Separated.erase {Γ : ServiceEnv} {Δ : Context} (h : Separated Γ Δ) (e : Key) :
Separated Γ (Δ.erase e)
abbrev ServiceEnv := Finmap (fun _ : Nat => ServiceSignature)
CSLibExt/Languages/SessionTypes/Endpoint/SharedEnvironment.lean:33
abbrev Context := Finmap (fun _ : Key => Capability)
CSLibExt/Languages/SessionTypes/Endpoint/Context.lean:32
def Separated (Γ : ServiceEnv) (Δ : Context) : Prop :=
∀ e c, Δ.lookup e = some c → ∀ s sig, Γ.lookup s = some sig → e.name ≠ .const s
CSLibExt/Languages/SessionTypes/Endpoint/SharedEnvironment.lean:36
structure Key where
name : PiCalculus.Name
role : Role
deriving DecidableEq, Repr
CSLibExt/Languages/SessionTypes/Endpoint/Identity.lean:30
Uses 8 · Used by 4
TheoremInserting a nonshared key preserves separation#✓fully proved
Inserting a statically nonshared key preserves physical-name separation.
theorem Separated.insert {Γ : ServiceEnv} {Δ : Context} (h : Separated Γ Δ)
(e : Key) (c : Capability) (he : ∀ s sig, Γ.lookup s = some sig → e.name ≠ .const s) :
Separated Γ (Δ.insert e c)
abbrev ServiceEnv := Finmap (fun _ : Nat => ServiceSignature)
CSLibExt/Languages/SessionTypes/Endpoint/SharedEnvironment.lean:33
abbrev Context := Finmap (fun _ : Key => Capability)
CSLibExt/Languages/SessionTypes/Endpoint/Context.lean:32
def Separated (Γ : ServiceEnv) (Δ : Context) : Prop :=
∀ e c, Δ.lookup e = some c → ∀ s sig, Γ.lookup s = some sig → e.name ≠ .const s
CSLibExt/Languages/SessionTypes/Endpoint/SharedEnvironment.lean:36
structure Key where
name : PiCalculus.Name
role : Role
deriving DecidableEq, Repr
CSLibExt/Languages/SessionTypes/Endpoint/Identity.lean:30
structure Capability where
rank : Nat
protocol : Protocol
CSLibExt/Languages/SessionTypes/Endpoint/Context.lean:27
Uses 8 · Used by 4
Loading dependency explorer…
The dependency explorer needs JavaScript and its graph data.