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

Deterministic normal forms with identity continuations

Lax369799.DeterministicNormalForms · concepts/Lax369799/DeterministicNormalForms.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

    A closed deterministic context is represented by its hole value and the optional values of its unary continuations. A missing continuation copies the hole behavior. Vertex zero is the distinguished hole copy; the next vertex is the entry continuation; the remaining vertices correspond to hole directions. Every nonempty unary continuation returns to vertex zero.

    Concept map
    17 concepts
    100%
    Proven claimDefinitionThis conceptRelated conceptA → B: B builds on ADescendants are omitted for concepts with more than 10 descendants.
    Evidence

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

    Lean source view on GitHub

    1import Lax369799.DeterministicPieces
    2import Lax369799.SystemEvaluation
    3
    4/-!
    5---
    6title: Deterministic normal forms with identity continuations
    7type: theorem
    8---
    9A closed deterministic context is represented by its hole value and the
    10optional values of its unary continuations. A missing continuation copies
    11the hole behavior. Vertex zero is the distinguished hole copy; the next
    12vertex is the entry continuation; the remaining vertices correspond to
    13hole directions. Every nonempty unary continuation returns to vertex zero.
    14-/
    15namespace Lax369799.DeterministicNormalForms
    16open RankedSystems Flattening Algebras DeterministicPieces
    17
    18/-- Missing unary pieces are copies of the distinguished vertex. -/
    19def label {A : RankedSet} {k : ℕ} (a : A k) (P : Fin (k + 1) → Option (A 1)) :
    20 Fin (k + 2) → Symbol A :=
    21 Fin.cases ⟨k, a⟩ (fun i => match P i with
    22 | none => ⟨k, a⟩
    23 | some b => ⟨1, b⟩)
    24
    25def holeNext (k d : ℕ) : Fin (k + 2) :=
    26 if h : d < k then ⟨d + 2, Nat.add_lt_add_right h 2⟩ else 0
    27
    28def next {A : RankedSet} {k : ℕ} (_a : A k) (P : Fin (k + 1) → Option (A 1))
    29 (v : Fin (k + 2)) (d : ℕ) : Fin (k + 2) :=
    30 Fin.cases (holeNext k d) (fun i => (P i).elim (holeNext k d) (fun _ => 0)) v
    31
    32def graph {A : RankedSet} {k : ℕ} (a : A k) (P : Fin (k + 1) → Option (A 1)) :
    33 Presentation A 0 (Fin (k + 2)) where
    34 label := label a P
    35 initial := {1}
    36 root := ∅
    37 edge := fun v d t => ∃ _hd : d < (label a P v).1, t = .inl (next a P v d)
    38 direction_valid := fun _ _ _ h => h.choose
    39
    40
    41axiom pattern_exists {A : RankedSet} {k : ℕ} (a : A k)
    42 (P : Fin (k + 1) → Option (A 1)) :
    43 ∃ T : System A 0, T.val = trim (graph a P)
    44
    45axiom normal_form {A : RankedSet} (E : Algebra A) (hE : UnfoldInvariant E)
    46 {k : ℕ} (C : SetContext A k 0) (hC : C.system.Deterministic) (S : System A k) :
    47 ∃ U V : System A 0,
    48 U.val = plug C S.val ∧
    49 V.val = trim (graph (E.eval k S) (fun i => (continuation C i).map (E.eval 1))) ∧
    50 E.eval 0 U = E.eval 0 V
    51
    52end Lax369799.DeterministicNormalForms
    53
    Show ProofShow Proof

    Discussion

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

    Loading discussion…