Reverse restriction swap preserves conversion typing to Erasing a key whose name is absent preserves conversion ranked typing

TheoremReverse restriction swap preserves conversion typing#✓fully proved

Reverse nested restriction commutation uses the canonical involution.

theorem HasType.nu_swap_reverse {n : Nat} {Δ : Context} {p : Proc}
    (h : HasType n Δ (.nu (.nu (swapProc 0 p)))) : HasType n Δ (.nu (.nu p))
Uses 6 · Used by 1

TheoremStructural congruence preserves conversion typing#✓fully proved

Every existing canonical structural congruence preserves endpoint typing in both directions with exactly the same depth and ownership. Unsupported choice/replication shapes are rejected by the typing-derived finite invariant.

theorem HasType.cong_iff {n : Nat} {Δ : Context} {p q : Proc} (hc : Cong p q) :
    HasType n Δ p ↔ HasType n Δ q
Uses 31 · Used by 1

TheoremSubject reduction at a compatible conversion interface#✓fully proved

From a typed source at an initially compatible interface, all five canonical reduction constructors preserve typing and compatibility, with one matched external subject-pair advancement or an unchanged interface when communication is private. No fragment or enabled-edge premise is required.

theorem HasType.subject_reduction {n : Nat} {Δ : Context} {p q : Proc}
    (h : HasType n Δ p) (hco : Compatible Δ) (hs : PiCalculus.Step p q) :
    ∃ Ξ, HasType n Ξ q ∧ Compatible Ξ ∧ (Ξ = Δ ∨ SemanticAdvance Δ Ξ)
Uses 29 · Used by 3

TheoremSubject reduction at a balanced interface#✓fully proved

A typed source with a balanced initial interface retains typing and balance after any canonical step. Balance supplies the required compatibility; the exact zero-or-one external advancement evidence is retained.

theorem HasType.subject_reduction_balanced {n : Nat} {Δ : Context} {p q : Proc}
    (h : HasType n Δ p) (hb : Balanced Δ) (hs : PiCalculus.Step p q) :
    ∃ Ξ, HasType n Ξ q ∧ Balanced Ξ ∧ (Ξ = Δ ∨ SemanticAdvance Δ Ξ)
Uses 10

TheoremSubject reduction at the empty interface#✓fully proved

An empty-interface typed network retains empty-interface typing through any canonical step. The empty context is balanced, hence compatible, including communication behind restrictions and pre/post congruence.

theorem HasType.subject_reduction_empty {n : Nat} {p q : Proc}
    (h : HasType n ∅ p) (hs : PiCalculus.Step p q) : HasType n ∅ q
Uses 20 · Used by 1

TheoremTyping and compatibility persist along finite executions#✓fully proved

A typed source at an initially semantically compatible interface retains typing and compatibility through finite actual execution, with a finite trace of faithful advances. This is safety, not progress or termination.

theorem HasType.reachable {n : Nat} {Δ : Context} {p q : Proc} (h : HasType n Δ p)
    (hc : Compatible Δ) (hr : Relation.ReflTransGen PiCalculus.Step p q) :
    ∃ Ξ, HasType n Ξ q ∧ Compatible Ξ ∧ Relation.ReflTransGen SemanticAdvance Δ Ξ
Uses 7

TheoremEmpty-interface typing persists along finite executions#✓fully proved

Every finite reachable closed state retains the exact empty interface.

theorem HasType.reachable_empty {n : Nat} {p q : Proc} (h : HasType n ∅ p)
    (hr : Relation.ReflTransGen PiCalculus.Step p q) : HasType n ∅ q
Uses 7

InductivePriority-ranked conversion typing judgement#✓fully proved

Linear ownership typing with a strict priority check at every guard. There is no reduction, enabled-edge, progress or preservation field.

Cslib.SessionTypes.Endpoint.Conversion.RankedType · 34 lines
inductive RankedType : Nat → Context → Proc → Prop where
  | nil {n : Nat} {Δ : Context} :
      Δ.Completed → (∀ e ∈ Δ, e.name.ClosedAt n) → RankedType n Δ .nil
  | outName {n : Nat} {Δ : Context} {e : Key} {c : Capability}
      {b : Name} {s : Protocol} {p : Proc} :
      GuardMin Δ e c.rank → Δ.lookup e = some c → c.protocol.unfold = .sendName s →
      e.name.ClosedAt n → b.ClosedAt n →
      RankedType n (Δ.insert e ⟨c.rank, s⟩) p → RankedType n Δ (.out e.name b p)
  | inpName {n : Nat} {Δ : Context} {e : Key} {c : Capability}
      {s : Protocol} {p : Proc} :
      GuardMin Δ e c.rank → Δ.lookup e = some c → c.protocol.unfold = .recvName s →
      e.name.ClosedAt n →
      RankedType (n + 1) (Context.lift 0 (Δ.insert e ⟨c.rank, s⟩)) p →
      RankedType n Δ (.inp e.name p)
  | outEndpoint {n : Nat} {Δ : Context} {e d : Key} {c v : Capability}
      {k : Nat} {t s : Protocol} {p : Proc} :
      GuardMin Δ e c.rank → Δ.lookup e = some c →
      c.protocol.unfold = .sendEndpoint d.role k t s →
      Δ.lookup d = some v → v.Equivalent ⟨k, t⟩ → e ≠ d →
      e.name.ClosedAt n → d.name.ClosedAt n →
      RankedType n ((Δ.erase d).insert e ⟨c.rank, s⟩) p →
      RankedType n Δ (.out e.name d.name p)
  | inpEndpoint {n : Nat} {Δ : Context} {e : Key} {c : Capability}
      {r : Role} {k : Nat} {t s : Protocol} {p : Proc} :
      GuardMin Δ e c.rank → Δ.lookup e = some c →
      c.protocol.unfold = .recvEndpoint r k t s → e.name.ClosedAt n →
      RankedType (n + 1)
        ((Context.lift 0 (Δ.insert e ⟨c.rank, s⟩)).insert ⟨.var 0, r⟩ ⟨k, t⟩) p →
      RankedType n Δ (.inp e.name p)
  | par {n : Nat} {Δ Θ : Context} {p q : Proc} :
      Finmap.Disjoint Δ Θ → RankedType n Δ p → RankedType n Θ q →
      RankedType n (Δ ∪ Θ) (.par p q)
  | nu {n : Nat} {Δ : Context} {c : Capability} {p : Proc} :
      RankedType (n + 1) (Context.bind c Δ) p → RankedType n Δ (.nu p)
Uses 14 · Used by 55
Used byNil is runtime-typed with empty ownership · Completed conversion-ranked frontiers are congruent to nil · Erasing a key whose name is absent preserves conversion ranked typing · Minimum active role is the subject of a conversion frontier leaf · Forgetting priorities yields conversion typing · Conversion-ranked input subjects are active · Minimum guard leaf cannot own an equivalent dual peer · Nil typing lifts to conversion ranked typing · Restriction inversion for conversion ranked typing · Ranked typing embeds into conversion ranked typing · Conversion-ranked output subjects are active · Parallel inversion for conversion ranked typing · Weakening conversion ranked typing by a completed capability · Conversion head communication yields a semantic advance · Head preservation for a conversion-ranked opposite pair · Inversion of conversion-ranked input typing · Adding a role unused by the partner preserves conversion ranked typing · Binder lifting preserves conversion ranked typing · Progress for semantically balanced conversion frontiers · Endpoint head communication preserves conversion ranked typing · Passive head communication preserves conversion ranked typing · Collision-free renaming preserves conversion ranked typing · Equivalent contexts preserve conversion ranked typing · Context equivalence transports conversion ranked typing both ways · Same-name conversion guards are opposite and communicate · Forward scope extrusion preserves conversion ranked typing · Endpoint substitution preserves conversion ranked typing · Split-derived freshness for conversion endpoint substitution · Passive substitution preserves conversion ranked typing · Binder swap preserves conversion ranked typing · Conversion ranked typing descends from a lifted process · Weakening conversion ranked typing by a disjoint completed context · Structural congruence preserves conversion ranked typing · Conversion-ranked processes have a typed frontier normal form · Removing a restriction around nil preserves conversion ranked typing · Restricting nil preserves conversion ranked typing · Swapping two restrictions preserves conversion ranked typing · Reverse restriction swap preserves conversion ranked typing · Parallel reassociation preserves conversion ranked typing · Reverse parallel reassociation preserves conversion ranked typing · Parallel commutation preserves conversion ranked typing · Removing a parallel nil preserves conversion ranked typing · Adding a parallel nil preserves conversion ranked typing · Global progress of conversion-ranked processes at balanced interfaces · Finite runs keep conversion ranked typing at compatible interfaces · Reachable closed conversion-ranked states keep the empty interface · Restoring the bound pair preserves conversion ranked typing · Conversion ranked typing is invariant under scope extrusion · Reverse scope extrusion preserves conversion ranked typing · Conversion ranked subject reduction at compatible interfaces · Conversion ranked subject reduction at balanced interfaces · Conversion ranked subject reduction at the empty interface · Closed conversion-ranked networks are completed or can step · Progress at reachable states of closed conversion-ranked networks · Finite ranked typing embeds into runtime typing under separation

TheoremForgetting priorities yields conversion typing#✓fully proved

Forgetting guard priorities derives the existing conversion judgement.

theorem RankedType.hasType {n : Nat} {Δ : Context} {p : Proc}
    (h : RankedType n Δ p) : HasType n Δ p
Uses 16 · Used by 9

TheoremRanked typing embeds into conversion ranked typing#✓fully proved

Explicit seven-case raw-ranked embedding, not theorem-value inheritance.

theorem RankedType.of_raw {n : Nat} {Δ : Context} {p : Proc}
    (h : Endpoint.RankedType n Δ p) : RankedType n Δ p
Uses 17

TheoremParallel inversion for conversion ranked typing#✓fully proved

Ranked parallel typing exposes its actual disjoint ownership split.

theorem RankedType.par_inv {n : Nat} {Δ : Context} {p q : Proc}
    (h : RankedType n Δ (.par p q)) :
    ∃ Γ Θ, Δ = Γ ∪ Θ ∧ Finmap.Disjoint Γ Θ ∧ RankedType n Γ p ∧ RankedType n Θ q
Uses 15 · Used by 10

TheoremRestriction inversion for conversion ranked typing#✓fully proved

Restriction chooses an actual literal-dual pair.

theorem RankedType.nu_inv {n : Nat} {Δ : Context} {p : Proc}
    (h : RankedType n Δ (.nu p)) : ∃ c, RankedType (n + 1) (Context.bind c Δ) p
Uses 15 · Used by 6

TheoremNil typing lifts to conversion ranked typing#✓fully proved

Nil adds no priority premise beyond actual completed and scoped ownership.

theorem RankedType.nil_of_hasType {n : Nat} {Δ : Context} (h : HasType n Δ .nil) :
    RankedType n Δ .nil
Uses 10 · Used by 2

TheoremConversion-ranked output subjects are active#✓fully proved

Literal output is active and checks every other owned active key.

theorem RankedType.out_active {n : Nat} {Δ : Context} {a b : Name} {p : Proc}
    (h : RankedType n Δ (.out a b p)) :
    ∃ e c, e.name = a ∧ Δ.lookup e = some c ∧ c.protocol.unfold ≠ .done ∧ GuardMin Δ e c.rank
Uses 16 · Used by 3

TheoremConversion-ranked input subjects are active#✓fully proved

Literal input is active before either payload kind is received.

theorem RankedType.inp_active {n : Nat} {Δ : Context} {a : Name} {p : Proc}
    (h : RankedType n Δ (.inp a p)) :
    ∃ e c, e.name = a ∧ Δ.lookup e = some c ∧ c.protocol.unfold ≠ .done ∧ GuardMin Δ e c.rank
Uses 16 · Used by 3

TheoremMinimum active role is the subject of a conversion frontier leaf#✓fully proved

A minimum active role is exposed as the EXACT subject of an actual leaf. The disjoint ownership split and canonical rearrangement are DERIVED outputs; no ready guard or normalizing typing result is required from the caller.

theorem GuardFrontier.expose_minimum {n : Nat} {Δ : Context} {p : Proc}
    (hf : GuardFrontier p) (ht : RankedType n Δ p) {e : Key} {c : Capability}
    (he : Δ.lookup e = some c) (ha : c.protocol.unfold ≠ .done)
    (hmin : ∀ x v, Δ.lookup x = some v → v.protocol.unfold ≠ .done → c.rank ≤ v.rank) :
    ∃ Γ Θ g r, Δ = Γ ∪ Θ ∧ Finmap.Disjoint Γ Θ ∧ Γ.lookup e = some c ∧
      Cong p (.par g r) ∧ RankedType n Γ g ∧ RankedType n Θ r ∧
      ((∃ b t, g = .out e.name b t) ∨ (∃ t, g = .inp e.name t)) ∧ GuardFrontier r
Uses 20 · Used by 1

TheoremCompleted conversion-ranked frontiers are congruent to nil#✓fully proved

A frontier with no active ownership cannot contain a live prefix. Completion is the PROCESS congruence to nil, not a completed empty interface.

theorem GuardFrontier.completed_nil {n : Nat} {Δ : Context} {p : Proc}
    (hf : GuardFrontier p) (ht : RankedType n Δ p) (hc : Δ.Completed) : Cong p .nil
Uses 16 · Used by 1

TheoremMinimum guard leaf cannot own an equivalent dual peer#✓fully proved

A semantic equal-rank active peer cannot inhabit the selected minimum guard.

theorem minimum_peer_separate {n : Nat} {Γ : Context} {g : Proc} {e : Key} {c d : Capability}
    (ht : RankedType n Γ g) (he : Γ.lookup e = some c) (ha : c.protocol.unfold ≠ .done)
    (hmin : ∀ x v, Γ.lookup x = some v → v.protocol.unfold ≠ .done → c.rank ≤ v.rank)
    (hshape : (∃ b t, g = .out e.name b t) ∨ (∃ t, g = .inp e.name t))
    (hd : d.Equivalent c.dual) : Γ.lookup e.opposite ≠ some d
Uses 21 · Used by 1

TheoremWeakening conversion ranked typing by a completed capability#✓fully proved

Adding a fresh completed capability preserves every guard inequality through all seven rules. No active capability can be added by this theorem.

theorem RankedType.weaken_completed {n : Nat} {Δ : Context} {p : Proc}
    (h : RankedType n Δ p) {z : Key} {u : Capability} (hz : z ∉ Δ)
    (hu : u.protocol.unfold = .done) (hscope : z.name.ClosedAt n) :
    RankedType n (Δ.insert z u) p
Uses 28 · Used by 2

TheoremErasing a key whose name is absent preserves conversion ranked typing#✓fully proved

Actual all-position physical-name absence permits erasure in the refinement too. Subject and payload lookup obligations are never discarded.

theorem RankedType.erase_nameAbsent {n : Nat} {Δ : Context} {p : Proc}
    (h : RankedType n Δ p) {z : Key} (hab : NameAbsent z.name p) :
    RankedType n (Δ.erase z) p
Uses 26 · Used by 1
20 fully proved

The dependency explorer needs JavaScript and its graph data.

Download the complete graph data.