While this submission is a draft, it cannot be used by other submissions.

Restricting and resizing the directions of a context

Lax369799.ContextPorts · concepts/Lax369799/ContextPorts.lean · lax-369799

proven

Loading review…

Sign in with ORCID

Community review

Flags

Each flag is tied to a public ORCID identity and explains why this concept may be incorrect.

No flags have been submitted.

    Community review

    Flag this concept

    State precisely what appears incorrect. This explanation will be public under your ORCID name.

    No source line selected.

    Natural Language Statement

    Theorem

    Select the hole's successors using a map from new directions to old ones, change the hole rank, and restrict to reachable vertices. The hole remains reachable because its first visit uses no outgoing hole edge. Substitution into this context is isomorphic to renaming the argument's outputs before insertion into the original context.

    Concept map
    11 concepts; 1 descendant hidden
    100%
    Proven claimDefinitionThis conceptRelated conceptA → B: B builds on A
    Evidence

    This concept declares 2 statements. Each proof establishes one of them relative to its assumptions.

    Lean source view on GitHub

    1import Lax369799.ContextRelabelling
    2import Lax369799.SupportPorts
    3
    4/-!
    5---
    6title: Restricting and resizing the directions of a context
    7type: theorem
    8---
    9Select the hole's successors using a map from new directions to old
    10ones, change the hole rank, and restrict to reachable vertices. The
    11hole remains reachable because its first visit uses no outgoing hole
    12edge. Substitution into this context is isomorphic to renaming the
    13argument's outputs before insertion into the original context.
    14-/
    15
    16namespace Lax369799.ContextPorts
    17open RankedSystems Flattening
    18
    19/-- Change the hole's rank and retain every ordinary symbol. -/
    20def resizeSymbol {A : RankedSet} {m : ℕ} (k : ℕ) : Symbol (WithHole A m) → Symbol (WithHole A k)
    21 | ⟨r,.inl a⟩ => ⟨r,.inl a⟩
    22 | ⟨_,.inr _⟩ => ⟨k,.inr ⟨rfl⟩⟩
    23
    24noncomputable def resizeGraph {A : RankedSet} {m k : ℕ} (C : SetContext A m 0)
    25 (s : Fin k → Fin m) : Presentation (WithHole A k) 0 C.system.Vertex := by
    26 classical
    27 exact {
    28 label := fun v => resizeSymbol k (C.system.graph.label v)
    29 initial := C.system.graph.initial
    30 root := C.system.graph.root
    31 edge := fun v d t => if IsHole (C.system.graph.label v) then
    32 ∃ i : Fin k,d = i.val ∧ C.system.graph.edge v (s i).val t
    33 else C.system.graph.edge v d t
    34 direction_valid := by
    35 intro v d t ht
    36 cases hlabel : C.system.graph.label v with
    37 | mk r a =>
    38 cases a with
    39 | inl a =>
    40 have hn : ¬IsHole (C.system.graph.label v) := by
    41 rw [hlabel]; rintro ⟨e,he⟩; cases he
    42 rw [if_neg hn] at ht
    43 have hd := C.system.graph.direction_valid v d t ht
    44 rw [hlabel] at hd
    45 simpa only [hlabel,resizeSymbol] using hd
    46 | inr e =>
    47 have hh : IsHole (C.system.graph.label v) := by rw [hlabel]; exact ⟨e,rfl⟩
    48 rw [if_pos hh] at ht
    49 obtain ⟨i,rfl,_⟩ := ht
    50 simpa only [hlabel,resizeSymbol] using i.isLt }
    51
    52axiom resize_exists {A : RankedSet} {m k : ℕ} (C : SetContext A m 0)
    53 (hC : C.system.Deterministic) (s : Fin k → Fin m) :
    54 ∃ D : SetContext A k 0, D.system = trim (resizeGraph C s) ∧ D.system.Deterministic
    55
    56axiom plug_resize {A : RankedSet} {m k : ℕ} (C : SetContext A m 0)
    57 (hC : C.system.Deterministic) (s : Fin k → Fin m) (R : System A k)
    58 (D : SetContext A k 0) (hD : D.system = trim (resizeGraph C s))
    59 (U V : System A 0) (hU : U.val = plug C (Renaming.renameSystem s R).val)
    60 (hV : V.val = plug D R.val) : Morphisms.Isomorphic U.val V.val
    61
    62end Lax369799.ContextPorts
    63
    Show ProofShow Proof

    Discussion

    Ask a question or add context. Endorsements and structured flags are kept in the review panel above.

    Loading discussion…