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

Simple rational terms within the compositional syntax

Lax149335.SimpleRationalWithinSyntax · concepts/Lax149335/SimpleRationalWithinSyntax.lean · lax-149335

definition

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

    Definition

    The definition of simple rational terms (Definition 2.5) is meaningful in the compositional syntax of Section 3: the simple rational terms with outputs in B∗B^* are the rational terms built from the empty list [ ]:1→B∗[\,] : 1 \to B^* using co-pairing ⟨f1,f2⟩\langle f_1, f_2 \rangle, concatenation f1⊙f2f_1 \odot f_2, the homomorphism combinator hom f\mathrm{hom}\, f, and prepending and appending a value, w⋅fw \cdot f and f⋅wf \cdot w, where w:1→B∗w : 1 \to B^*.

    For two rational terms f,g:A→B∗f, g : A \to B^* and a value w:1→B∗w : 1 \to B^*, Section 6 considers three conjugacy relations, in increasing order of strength:

    1. ff and gg are denotationally ww-conjugate if [ ⁣[f⋅w] ⁣]=[ ⁣[w⋅g] ⁣][\![ f \cdot w ]\!] = [\![ w \cdot g ]\!];
    2. ff and gg are provably ww-conjugate if f⋅w≡w⋅gf \cdot w \equiv w \cdot g;
    3. ff and gg are syntactically ww-conjugate if f=w⋅hf = w \cdot h and g=h⋅wg = h \cdot w for some term hh.

    The length of a list value ww is the length of the list it produces.

    Concept map
    5 concepts; 7 descendants hidden
    100%
    Proven claimDefinitionThis conceptRelated conceptA → B: B builds on A

    Lean source view on GitHub

    1import Lax149335.EquationalTheory
    2
    3/-!
    4---
    5title: Simple rational terms within the compositional syntax
    6type: definition
    7---
    8The definition of simple rational terms (Definition 2.5) is meaningful in the compositional
    9syntax of Section 3: the *simple rational terms* with outputs in B∗B^* are the rational terms
    10built from the empty list [ ]:1→B∗[\,] : 1 \to B^* using co-pairing ⟨f1,f2⟩\langle f_1, f_2 \rangle,
    11concatenation f1⊙f2f_1 \odot f_2, the homomorphism combinator hom f\mathrm{hom}\, f, and
    12prepending and appending a value, w⋅fw \cdot f and f⋅wf \cdot w, where w:1→B∗w : 1 \to B^*.
    13
    14For two rational terms f,g:A→B∗f, g : A \to B^* and a value w:1→B∗w : 1 \to B^*, Section 6 considers
    15three conjugacy relations, in increasing order of strength:
    16
    171. ff and gg are *denotationally ww-conjugate* if
    18 [ ⁣[f⋅w] ⁣]=[ ⁣[w⋅g] ⁣][\![ f \cdot w ]\!] = [\![ w \cdot g ]\!];
    192. ff and gg are *provably ww-conjugate* if f⋅w≡w⋅gf \cdot w \equiv w \cdot g;
    203. ff and gg are *syntactically ww-conjugate* if f=w⋅hf = w \cdot h and g=h⋅wg = h \cdot w for
    21 some term hh.
    22
    23The *length* of a list value ww is the length of the list it produces.
    24-/
    25
    26namespace Lax149335.SimpleRationalWithinSyntax
    27
    28open Lax149335.Types Lax149335.Terms Lax149335.DerivedTerms Lax149335.DerivedTerms.Term
    29 Lax149335.EquationalTheory
    30
    31/-- Simple rational terms with outputs in `B*`, within the syntax of rational terms. -/
    32inductive IsSimple (B : Ty) : {A : Ty} → Term A B⋆ → Prop
    33 /-- The empty function `[] : 1 → B*`. -/
    34 | nil : IsSimple B (nilT B)
    35 /-- Co-pairing. -/
    36 | either {A₁ A₂ : Ty} {f₁ : Term A₁ B⋆} {f₂ : Term A₂ B⋆} :
    37 IsSimple B f₁ → IsSimple B f₂ → IsSimple B (Term.either f₁ f₂)
    38 /-- Concatenation of two functions. -/
    39 | fdot {A₁ A₂ : Ty} {f₁ : Term A₁ B⋆} {f₂ : Term A₂ B⋆} :
    40 IsSimple B f₁ → IsSimple B f₂ → IsSimple B (f₁ ⊙ f₂)
    41 /-- The homomorphism combinator. -/
    42 | hom {A : Ty} {f : Term A B⋆} : IsSimple B f → IsSimple B (homT f)
    43 /-- Prepending a value. -/
    44 | dotL {A : Ty} {f : Term A B⋆} (w : Value B⋆) : IsSimple B f → IsSimple B (Term.dotL w f)
    45 /-- Appending a value. -/
    46 | dotR {A : Ty} {f : Term A B⋆} (w : Value B⋆) : IsSimple B f → IsSimple B (Term.dotR f w)
    47
    48/-- The length of a list value. -/
    49def valLength {B : Ty} (w : Value B⋆) : ℕ := List.length (w.den ())
    50
    51/-- `f` and `g` are denotationally `w`-conjugate: `⟦f · w⟧ = ⟦w · g⟧`. -/
    52def DenConjugate {A B : Ty} (w : Value B⋆) (f g : Term A B⋆) : Prop :=
    53 (dotR f w).den = (dotL w g).den
    54
    55/-- `f` and `g` are provably `w`-conjugate: `f · w ≡ w · g`. -/
    56def ProvConjugate {A B : Ty} (w : Value B⋆) (f g : Term A B⋆) : Prop :=
    57 dotR f w ≡ₜ dotL w g
    58
    59/-- `f` and `g` are syntactically `w`-conjugate: `f = w · h` and `g = h · w` for some `h`. -/
    60def SynConjugate {A B : Ty} (w : Value B⋆) (f g : Term A B⋆) : Prop :=
    61 ∃ h : Term A B⋆, f = dotL w h ∧ g = dotR h w
    62
    63end Lax149335.SimpleRationalWithinSyntax
    64

    Discussion

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

    Loading discussion…