- var: Name → SimplyTyped.Typ
- arrow: SimplyTyped.Typ → SimplyTyped.Typ → SimplyTyped.Typ
Instances For
Equations
- SimplyTyped.instReprTyp = { reprPrec := SimplyTyped.reprTyp✝ }
Equations
- SimplyTyped.Typ.instToString = { toString := SimplyTyped.Typ.toString }
Equations
- SimplyTyped.Typ.instCoeName = { coe := SimplyTyped.Typ.var }
Equations
- SimplyTyped.Typ.«term_⇒_» = Lean.ParserDescr.trailingNode `SimplyTyped.Typ.term_⇒_ 20 21 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " ⇒ ") (Lean.ParserDescr.cat `term 20))
Instances For
- var: Name → SimplyTyped.Term
- app: SimplyTyped.Term → SimplyTyped.Term → SimplyTyped.Term
- abs: Name → SimplyTyped.Typ → SimplyTyped.Term → SimplyTyped.Term
Instances For
Equations
- SimplyTyped.instReprTerm = { reprPrec := SimplyTyped.reprTerm✝ }
Equations
- (SimplyTyped.Term.var a).toString = a
- (a ∙ a_1).toString = toString "(" ++ toString a.toString ++ toString " " ++ toString a_1.toString ++ toString ")"
- (SimplyTyped.Term.abs a a_1 a_2).toString = toString "(λ" ++ toString a ++ toString " : " ++ toString a_1 ++ toString ". " ++ toString a_2.toString ++ toString ")"
Instances For
Equations
- SimplyTyped.Term.instToString = { toString := SimplyTyped.Term.toString }
Equations
- SimplyTyped.Term.instCoeName = { coe := SimplyTyped.Term.var }
Equations
- SimplyTyped.Term.«term_∙_» = Lean.ParserDescr.trailingNode `SimplyTyped.Term.term_∙_ 100 100 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " ∙ ") (Lean.ParserDescr.cat `term 101))
Instances For
Equations
- (SimplyTyped.Term.var a).Sub = {SimplyTyped.Term.var a}
- (a ∙ a_1).Sub = a ∙ a_1 ::ₘ (a.Sub + a_1.Sub)
- (SimplyTyped.Term.abs a a_1 a_2).Sub = SimplyTyped.Term.abs a a_1 a_2 ::ₘ a_2.Sub
Instances For
Instances For
Equations
- SimplyTyped.Term.instHasSubset = { Subset := SimplyTyped.Term.Subterm }
instance
SimplyTyped.Term.instDecidableSubterm
{M : SimplyTyped.Term}
{N : SimplyTyped.Term}
:
Decidable (M.Subterm N)
Equations
- SimplyTyped.Term.instDecidableSubterm = inferInstanceAs (Decidable (M ∈ N.Sub))
Equations
- SimplyTyped.Term.instDecidableSubset = inferInstanceAs (Decidable (M ∈ N.Sub))
Equations
- (SimplyTyped.Term.var a).FV = {a}
- (a ∙ a_1).FV = a.FV ∪ a_1.FV
- (SimplyTyped.Term.abs a a_1 a_2).FV = a_2.FV \ {a}
Instances For
@[reducible, inline]
Equations
Instances For
@[reducible, inline]
Instances For
- var: ∀ {Γ : SimplyTyped.Context} {x : Name} {σ : SimplyTyped.Typ}, (x, σ) ∈ Γ → Γ ⊢ SimplyTyped.Term.var x : σ
- app: ∀ {Γ : SimplyTyped.Context} {M N : SimplyTyped.Term} {σ τ : SimplyTyped.Typ}, (Γ ⊢ M : σ ⇒ τ) → (Γ ⊢ N : σ) → Γ ⊢ M ∙ N : τ
- abs: ∀ {Γ : SimplyTyped.Context} {x : Name} {M : SimplyTyped.Term} {σ τ : SimplyTyped.Typ}, (insert (x, σ) Γ ⊢ M : τ) → Γ ⊢ SimplyTyped.Term.abs x σ M : σ ⇒ τ
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- SimplyTyped.Typeable M = ∃ (σ : SimplyTyped.Typ), ⊢ M : σ
Instances For
Equations
- SimplyTyped.Legal M = ∃ (Γ : SimplyTyped.Context) (ρ : SimplyTyped.Typ), Γ ⊢ M : ρ
Instances For
Equations
- SimplyTyped.dom Γ = Finset.image Prod.fst Γ
Instances For
Equations
- SimplyTyped.Subcontext Γ Δ = (Δ ⊆ Γ)
Instances For
Equations
- SimplyTyped.Permutation Γ Δ = (SimplyTyped.dom Δ = SimplyTyped.dom Γ)
Instances For
Equations
- Γ ↾ Φ = Finset.filter (fun (x : SimplyTyped.Declaration) => x.1 ∈ SimplyTyped.dom Γ ∩ Φ) Γ
Instances For
Equations
- SimplyTyped.«term_↾_» = Lean.ParserDescr.trailingNode `SimplyTyped.term_↾_ 60 61 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " ↾ ") (Lean.ParserDescr.cat `term 61))
Instances For
theorem
SimplyTyped.dom_insert_eq_insert_dom
{Γ : SimplyTyped.Context}
{x : Name}
{σ : SimplyTyped.Typ}
:
SimplyTyped.dom (insert (x, σ) Γ) = insert x (SimplyTyped.dom Γ)
theorem
SimplyTyped.context_free_variables
{Γ : SimplyTyped.Context}
{L : SimplyTyped.Term}
{σ : SimplyTyped.Typ}
(J : Γ ⊢ L : σ)
:
L.FV ⊆ SimplyTyped.dom Γ
@[simp]
theorem
SimplyTyped.thinning
{Γ : SimplyTyped.Context}
{Δ : SimplyTyped.Context}
{M : SimplyTyped.Term}
{σ : SimplyTyped.Typ}
(h : Γ ⊆ Δ)
:
@[simp]
theorem
SimplyTyped.condensing
{Γ : SimplyTyped.Context}
{M : SimplyTyped.Term}
{σ : SimplyTyped.Typ}
(J : Γ ⊢ M : σ)
:
@[simp]
theorem
SimplyTyped.permutation
{Γ : SimplyTyped.Context}
{Δ : SimplyTyped.Context}
{M : SimplyTyped.Term}
{σ : SimplyTyped.Typ}
(h : SimplyTyped.Permutation Γ Δ)
:
@[simp]
theorem
SimplyTyped.generation_var
{Γ : SimplyTyped.Context}
{x : Name}
{σ : SimplyTyped.Typ}
:
(Γ ⊢ SimplyTyped.Term.var x : σ) ↔ (x, σ) ∈ Γ
@[simp]
theorem
SimplyTyped.generation_app
{Γ : SimplyTyped.Context}
{M : SimplyTyped.Term}
{N : SimplyTyped.Term}
{τ : SimplyTyped.Typ}
:
@[simp]
theorem
SimplyTyped.generation_abs
{Γ : SimplyTyped.Context}
{x : Name}
{M : SimplyTyped.Term}
{σ : SimplyTyped.Typ}
{ρ : SimplyTyped.Typ}
:
theorem
SimplyTyped.subterm
{M : SimplyTyped.Term}
(h : SimplyTyped.Legal M)
(N : SimplyTyped.Term)
:
N ⊆ M → SimplyTyped.Legal N
@[simp]
theorem
SimplyTyped.uniqueness_of_types
{Γ : SimplyTyped.Context}
{M : SimplyTyped.Term}
{σ : SimplyTyped.Typ}
{τ : SimplyTyped.Typ}
(Jσ : Γ ⊢ M : σ)
(Jτ : Γ ⊢ M : τ)
:
σ = τ
Equations
- SimplyTyped.WellTyped M = ∃ (σ : SimplyTyped.Typ), ⊢ M : σ
Instances For
Equations
- SimplyTyped.TypeAssignment Γ M = ∃ (σ : SimplyTyped.Typ), Γ ⊢ M : σ
Instances For
def
SimplyTyped.TypeChecking
(Γ : SimplyTyped.Context)
(M : SimplyTyped.Term)
(σ : SimplyTyped.Typ)
:
Equations
- SimplyTyped.TypeChecking Γ M σ = Γ ⊢ M : σ
Instances For
Equations
- SimplyTyped.TermFinding Γ σ = ∃ (M : SimplyTyped.Term), Γ ⊢ M : σ
Instances For
Equations
- One or more equations did not get rendered due to their size.
- SimplyTyped.hasDecTypeable (SimplyTyped.Term.var a) = id (let σ := SimplyTyped.Typ.var "σ"; let Γ := {(a, σ)}; isTrue ⋯)
Instances For
Equations
Instances For
Equations
Instances For
def
SimplyTyped.hasDecTypeChecking
(Γ : SimplyTyped.Context)
(M : SimplyTyped.Term)
(σ : SimplyTyped.Typ)
:
Decidable (SimplyTyped.TypeChecking Γ M σ)
Equations
- One or more equations did not get rendered due to their size.
- SimplyTyped.hasDecTypeChecking Γ (SimplyTyped.Term.var a) σ = if h : (a, σ) ∈ Γ then isTrue ⋯ else id (⋯.mpr (isFalse ⋯))
Instances For
Equations
Instances For
Equations
- SimplyTyped.instDecidableTypeable = SimplyTyped.hasDecTypeable M
Equations
- SimplyTyped.instDecidableWellTyped = SimplyTyped.hasDecWellTyped M
Equations
- SimplyTyped.instDecidableTypeAssignment = SimplyTyped.hasDecTypeAssignment Γ M
instance
SimplyTyped.instDecidableTypeChecking
{Γ : SimplyTyped.Context}
{M : SimplyTyped.Term}
{σ : SimplyTyped.Typ}
:
Decidable (SimplyTyped.TypeChecking Γ M σ)
Equations
- SimplyTyped.instDecidableTypeChecking = SimplyTyped.hasDecTypeChecking Γ M σ
Equations
- SimplyTyped.instDecidableTermFinding = SimplyTyped.hasDecTermFinding Γ σ
Equations
- SimplyTyped.subst (SimplyTyped.Term.var a) x N = if x = a then N else SimplyTyped.Term.var a
- SimplyTyped.subst (a ∙ a_1) x N = SimplyTyped.subst a x N ∙ SimplyTyped.subst a_1 x N
- SimplyTyped.subst (SimplyTyped.Term.abs a a_1 a_2) x N = if x = a ∨ a ∈ N.FV then SimplyTyped.Term.abs a a_1 a_2 else SimplyTyped.Term.abs a a_1 (SimplyTyped.subst a_2 x N)
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
theorem
SimplyTyped.substitution
{Γ : SimplyTyped.Context}
{Δ : SimplyTyped.Context}
{M : SimplyTyped.Term}
{N : SimplyTyped.Term}
{x : Name}
{σ : SimplyTyped.Typ}
{τ : SimplyTyped.Typ}
(hM : insert (x, σ) (Γ ∪ Δ) ⊢ M : τ)
(hN : Γ ⊢ N : σ)
:
(Γ ∪ Δ) ⊢ SimplyTyped.subst M x N : τ
Equations
- SimplyTyped.reduceβ (SimplyTyped.Term.abs x_1 type M ∙ N) = SimplyTyped.subst M x_1 N
- SimplyTyped.reduceβ (SimplyTyped.Term.var x_1) = SimplyTyped.Term.var x_1
- SimplyTyped.reduceβ (M ∙ N) = SimplyTyped.reduceβ M ∙ SimplyTyped.reduceβ N
- SimplyTyped.reduceβ (SimplyTyped.Term.abs x_1 σ M) = SimplyTyped.Term.abs x_1 σ (SimplyTyped.reduceβ M)
Instances For
- redex: ∀ {x : Name} {σ : SimplyTyped.Typ} (M N : SimplyTyped.Term), SimplyTyped.Term.abs x σ M ∙ N →β SimplyTyped.subst M x N
- compatAppLeft: ∀ {L M N : SimplyTyped.Term}, M →β N → M ∙ L →β N ∙ L
- compatAppRight: ∀ {L M N : SimplyTyped.Term}, M →β N → L ∙ M →β L ∙ N
- compatAbs: ∀ {x : Name} {σ : SimplyTyped.Typ} {M N : SimplyTyped.Term}, M →β N → SimplyTyped.Term.abs x σ M →β SimplyTyped.Term.abs x σ N
Instances For
Equations
- SimplyTyped.«term_→β_» = Lean.ParserDescr.trailingNode `SimplyTyped.term_→β_ 50 50 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " →β ") (Lean.ParserDescr.cat `term 51))
Instances For
Equations
- SimplyTyped.«term_←β_» = Lean.ParserDescr.trailingNode `SimplyTyped.term_←β_ 50 50 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " ←β ") (Lean.ParserDescr.cat `term 51))
Instances For
@[simp]
theorem
SimplyTyped.beta_redex
{x : Name}
{σ : SimplyTyped.Typ}
{M : SimplyTyped.Term}
{N : SimplyTyped.Term}
:
SimplyTyped.Term.abs x σ M ∙ N →β SimplyTyped.subst M x N
@[simp]
theorem
SimplyTyped.beta_compat_app_left
{L : SimplyTyped.Term}
{M : SimplyTyped.Term}
{N : SimplyTyped.Term}
(h : M →β N)
:
@[simp]
theorem
SimplyTyped.beta_compat_app_right
{L : SimplyTyped.Term}
{M : SimplyTyped.Term}
{N : SimplyTyped.Term}
(h : M →β N)
:
@[simp]
theorem
SimplyTyped.beta_compat_abs
{x : Name}
{σ : SimplyTyped.Typ}
{M : SimplyTyped.Term}
{N : SimplyTyped.Term}
(h : M →β N)
:
SimplyTyped.Term.abs x σ M →β SimplyTyped.Term.abs x σ N
@[reducible, inline]
Instances For
Equations
- SimplyTyped.«term_↠β_» = Lean.ParserDescr.trailingNode `SimplyTyped.term_↠β_ 50 50 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " ↠β ") (Lean.ParserDescr.cat `term 51))
Instances For
Equations
- SimplyTyped.«term_↞β_» = Lean.ParserDescr.trailingNode `SimplyTyped.term_↞β_ 50 50 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " ↞β ") (Lean.ParserDescr.cat `term 51))
Instances For
Equations
- SimplyTyped.instCoeBetaBetaChain = { coe := ⋯ }
- beta: ∀ {M N : SimplyTyped.Term}, M →β N → M =β N
- betaInv: ∀ {M N : SimplyTyped.Term}, N →β M → M =β N
- refl: ∀ (M : SimplyTyped.Term), M =β M
- symm: ∀ {M N : SimplyTyped.Term}, M =β N → N =β M
- trans: ∀ {L M N : SimplyTyped.Term}, L =β M → M =β N → L =β N
Instances For
Equations
- SimplyTyped.«term_=β_» = Lean.ParserDescr.trailingNode `SimplyTyped.term_=β_ 50 51 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " =β ") (Lean.ParserDescr.cat `term 51))
Instances For
@[simp]
@[simp]
theorem
SimplyTyped.beta_eq_beta_inv
{M : SimplyTyped.Term}
{N : SimplyTyped.Term}
(h : N →β M)
:
M =β N
theorem
SimplyTyped.beta_eq_trans
{L : SimplyTyped.Term}
{M : SimplyTyped.Term}
{N : SimplyTyped.Term}
(hlm : L =β M)
(hmn : M =β N)
:
L =β N
theorem
SimplyTyped.eq_imp_beta_eq
{M : SimplyTyped.Term}
{N : SimplyTyped.Term}
(h : M = N)
:
M =β N
instance
SimplyTyped.instIsReflTermBetaEq :
IsRefl SimplyTyped.Term fun (x1 x2 : SimplyTyped.Term) => x1 =β x2
Equations
instance
SimplyTyped.instIsSymmTermBetaEq :
IsSymm SimplyTyped.Term fun (x1 x2 : SimplyTyped.Term) => x1 =β x2
Equations
instance
SimplyTyped.instIsTransTermBetaEq :
IsTrans SimplyTyped.Term fun (x1 x2 : SimplyTyped.Term) => x1 =β x2
Equations
theorem
SimplyTyped.church_rosser_corollary
{M : SimplyTyped.Term}
{N : SimplyTyped.Term}
(h : M =β N)
:
∃ (L : SimplyTyped.Term), M ↠β L ∧ N ↠β L
theorem
SimplyTyped.subject_reduction
{Γ : SimplyTyped.Context}
{L : SimplyTyped.Term}
{L' : SimplyTyped.Term}
{ρ : SimplyTyped.Typ}
(hj : Γ ⊢ L : ρ)
(hb : L ↠β L')
: