The subtype of ISAR terms that belong to the pure SKI fragment.
Equations
- ISAR.ISKSubtype = { t : ISAR.ITerm // ISAR.ISKTerm t }
Instances For
Two terms are operationally equivalent if they can reduce to a common term.
Instances For
@[implicit_reducible]
Equations
- ISAR.operEqSetoid = { r := ISAR.OperEq, iseqv := ISAR.operEqSetoid._proof_1 }
The Invariant Layer is defined as the operational equivalence quotient of the SKI fragment.
Equations
Instances For
Application of raw fragment subtypes.
Instances For
Operational equivalence is a congruence under application.
Application descends to a well-defined function on Invariant Layer quotient classes.
Equations
- t.app u = Quotient.lift₂ (fun (t u : ISAR.ISKSubtype) => Quotient.mk ISAR.operEqSetoid (ISAR.app_raw t u)) ISAR.InvariantLayer.app._proof_1 t u
Instances For
Canonical projection to the Invariant Layer.
Equations
Instances For
Equations
- ISAR.HasNF t = ∃ (n : ISAR.ISKSubtype), ISAR.IRed t.val n.val ∧ ISAR.NormalI n.val
Instances For
Equations
- q.HasNF = Quotient.lift ISAR.HasNF ⋯ q
Instances For
Equations
- ISAR.term_size (ISAR.ITerm.var a) = 1
- ISAR.term_size ISAR.ITerm.norm = 1
- ISAR.term_size ISAR.ITerm.konst = 1
- ISAR.term_size ISAR.ITerm.dup = 1
- ISAR.term_size ISAR.ITerm.swap = 1
- ISAR.term_size ISAR.ITerm.comp = 1
- ISAR.term_size ISAR.ITerm.sₛ = 1
- ISAR.term_size (f · x_1) = ISAR.term_size f + ISAR.term_size x_1 + 1
Instances For
- norm : IKTerm ITerm.norm
- konst : IKTerm ITerm.konst
- app {f x : ITerm} : IKTerm f → IKTerm x → IKTerm (f · x)
Instances For
Equations
Instances For
@[implemented_by ISAR.cd_loop]
Representative of an OperEq-class on concrete terms. AC section used by
canonical_rep. Not claimed computable.
- If
HasNF, pick some NF (Classical.chooseon the nonempty NF fiber). The computational HasNF section isnf_of_HasNF_fuel/nf_of_HasNFinCanonicalRepresentative.lean(choose fuel, thencd_loop_fuel). That file imports this one, so this HasNF branch cannot callcd_loop_fuelvia that path without a cycle. - If
¬HasNF, pick any class representative viaQuotient.exists_rep. SKI is not SN; no finitecdyieldsNormalI. This is expected, not a gap.
Computational path: @[implemented_by cd_loop] (iterated complete development).
Equations
- ISAR.nf_of_term t = if h : ISAR.HasNF t then Classical.choose h else Classical.choose ⋯
Instances For
nf_of_term is always an OperEq-representative (fixes the old false norm fallback).
Equations
Instances For
Equations
- ISAR.dupCount ISAR.ITerm.dup = 1
- ISAR.dupCount (ISAR.ITerm.dup · a) = 0
- ISAR.dupCount (f · x_1) = ISAR.dupCount f + ISAR.dupCount x_1
- ISAR.dupCount x✝ = 0
Instances For
- norm : LinearIKTerm ITerm.norm
- konst : LinearIKTerm ITerm.konst
- app {f x : ITerm} : LinearIKTerm f → LinearIKTerm x → dupCount (f · x) = 0 → LinearIKTerm (f · x)
- app_dup {x : ITerm} : LinearIKTerm x → LinearIKTerm (ITerm.dup · x)
Instances For
theorem
ISAR.cd_app_of_LinearIKTerm
{f : ITerm}
(x : ITerm)
(hf : LinearIKTerm f)
(h_norm : f ≠ ITerm.norm)
(h_konst : ∀ (y : ITerm), f ≠ ITerm.konst · y)
:
theorem
ISAR.cd_loop_fuel_spec
(n : Nat)
(t : ISKSubtype)
(ht : LinearIKTerm t.val)
(hn : term_size t.val ≤ n)
: