Simple rational terms within the compositional syntax
Lax149335.SimpleRationalWithinSyntax · concepts/Lax149335/SimpleRationalWithinSyntax.lean · lax-149335
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural 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 are the rational terms built from the empty list using co-pairing , concatenation , the homomorphism combinator , and prepending and appending a value, and , where .
For two rational terms and a value , Section 6 considers three conjugacy relations, in increasing order of strength:
- and are denotationally -conjugate if ;
- and are provably -conjugate if ;
- and are syntactically -conjugate if and for some term .
The length of a list value is the length of the list it produces.
Concept map
Lean source view on GitHub
| 1 | import Lax149335.EquationalTheory |
| 2 | |
| 3 | /-! |
| 4 | --- |
| 5 | title: Simple rational terms within the compositional syntax |
| 6 | type: definition |
| 7 | --- |
| 8 | The definition of simple rational terms (Definition 2.5) is meaningful in the compositional |
| 9 | syntax of Section 3: the *simple rational terms* with outputs in are the rational terms |
| 10 | built from the empty list using co-pairing , |
| 11 | concatenation , the homomorphism combinator , and |
| 12 | prepending and appending a value, and , where . |
| 13 | |
| 14 | For two rational terms and a value , Section 6 considers |
| 15 | three conjugacy relations, in increasing order of strength: |
| 16 | |
| 17 | 1. and are *denotationally -conjugate* if |
| 18 | ; |
| 19 | 2. and are *provably -conjugate* if ; |
| 20 | 3. and are *syntactically -conjugate* if and for |
| 21 | some term . |
| 22 | |
| 23 | The *length* of a list value is the length of the list it produces. |
| 24 | -/ |
| 25 | |
| 26 | namespace Lax149335.SimpleRationalWithinSyntax |
| 27 | |
| 28 | open 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. -/ |
| 32 | inductive 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. -/ |
| 49 | def valLength {B : Ty} (w : Value B⋆) : ℕ := List.length (w.den ()) |
| 50 | |
| 51 | /-- `f` and `g` are denotationally `w`-conjugate: `⟦f · w⟧ = ⟦w · g⟧`. -/ |
| 52 | def 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`. -/ |
| 56 | def 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`. -/ |
| 60 | def 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 | |
| 63 | end Lax149335.SimpleRationalWithinSyntax |
| 64 |
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above.
0 comments