OAI/Computability/TypeSystem/Contexts.lean
55 declarations, 0 contain sorry, 0 declared as axioms
Finite generic contexts may have arbitrary raw actual images in the saturated tower. Every such substitution is witnessed in one finite prefix; no normalization or strong-normalization of the images is assumed.
- def
OAI.PureTypeSystem.Expr.Scopedline 16Source documentation
Every free index is below the context length.
def Scoped : Nat → Expr S → Prop | n, .var i => i < n | _, .sort _ => True | n, .app M N => Scoped n M ∧ Scoped n N | n, .lam A b => Scoped n A ∧ Scoped (n+1) b | n, .pi A B => Scoped n A ∧ Scoped (n+1) B namespace Scoped variable {n m : Nat} {M : Expr S}Mentions: OAI.PureTypeSystem.Expr
- theorem
OAI.PureTypeSystem.Expr.Scoped.renameline 27 - theorem
OAI.PureTypeSystem.Expr.Scoped.monoline 40 - theorem
OAI.PureTypeSystem.Expr.Scoped.rename_congrline 43 - theorem
OAI.PureTypeSystem.Expr.Scoped.substline 57 - theorem
OAI.PureTypeSystem.Expr.Scoped.instantiateline 72 - def
OAI.PureTypeSystem.Expr.reverseIndexline 84Source documentation
Reversal identifies de Bruijn indices in a finite context with fixed levels. Outside that context it is the identity.
def reverseIndex (n i : Nat) : Nat := if i < n then n - 1 - i else i
- theorem
OAI.PureTypeSystem.Expr.reverseIndex_ltline 86 - theorem
OAI.PureTypeSystem.Expr.reverseIndex_involutiveline 90 - theorem
OAI.PureTypeSystem.Expr.reverseIndex_twiceline 95 - theorem
OAI.PureTypeSystem.Expr.Scoped.reverseIndexline 101 - theorem
OAI.PureTypeSystem.Expr.Scoped.reverseIndex_succline 105 - theorem
OAI.PureTypeSystem.HasType.scopeline 120 - theorem
OAI.PureTypeSystem.Beta.scopeline 139 - theorem
OAI.PureTypeSystem.Reduces.scopeline 153 - theorem
OAI.PureTypeSystem.WeaklyNormalizing.renameline 164 - theorem
OAI.PureTypeSystem.WeaklyNormalizing.reverseIndex_iffline 169 - structure
OAI.PureTypeSystem.ContextTowerline 182Source documentation
Finite prefixes of a common context, using fixed-level names when viewed outside a prefix. Every sortable fixed-level expression is declared arbitrarily late. Bound variables remain de Bruijn indices and are never declared here.
structure ContextTower {S : Type u} (P : Specification S) where …Mentions: OAI.PureTypeSystem.Specification
- structure
OAI.PureTypeSystem.ContextTowerConstruction.Stageline 195 - def
OAI.PureTypeSystem.ContextTowerConstruction.enumerationline 202 - theorem
OAI.PureTypeSystem.ContextTowerConstruction.enumeration_surjectiveline 206 - def
OAI.PureTypeSystem.ContextTowerConstruction.scheduledline 210 - theorem
OAI.PureTypeSystem.ContextTowerConstruction.scheduled_lateline 212 - def
OAI.PureTypeSystem.ContextTowerConstruction.nextline 219 - def
OAI.PureTypeSystem.ContextTowerConstruction.stagesline 226 - def
OAI.PureTypeSystem.ContextTowerConstruction.contextsline 234 - theorem
OAI.PureTypeSystem.ContextTowerConstruction.validline 236 - theorem
OAI.PureTypeSystem.ContextTowerConstruction.lengthline 238 - theorem
OAI.PureTypeSystem.ContextTowerConstruction.stepline 240 - theorem
OAI.PureTypeSystem.ContextTowerConstruction.rename_nextline 244 - theorem
OAI.PureTypeSystem.ContextTowerConstruction.rename_monoline 261 - theorem
OAI.PureTypeSystem.ContextTowerConstruction.at_scheduledline 270 - theorem
OAI.PureTypeSystem.ContextTowerConstruction.saturatedline 278 - def
OAI.PureTypeSystem.ContextTowerConstruction.towerline 298 - def
OAI.PureTypeSystem.ContextTower.HasTypeline 312Source documentation
A global judgment is witnessed in a finite prefix of the tower.
def HasType (M A : Expr S) : Prop := …
Mentions: OAI.PureTypeSystem.Expr
- theorem
OAI.PureTypeSystem.ContextTower.at_nextline 316 - theorem
OAI.PureTypeSystem.ContextTower.at_monoline 333 - theorem
OAI.PureTypeSystem.ContextTower.HasType.scopeline 346 - theorem
OAI.PureTypeSystem.ContextTower.HasType.weaklyNormalizingline 354 - theorem
OAI.PureTypeSystem.ContextTower.HasType.type_weaklyNormalizingline 359 - theorem
OAI.PureTypeSystem.ContextTower.HasType.commonline 364 - theorem
OAI.PureTypeSystem.ContextTower.fresh_variableline 375 - theorem
OAI.PureTypeSystem.ContextTower.HasType.applicationline 398 - theorem
OAI.PureTypeSystem.ContextTower.HasType.conversionline 405 - theorem
OAI.PureTypeSystem.ContextTower.HasType.subject_reducesline 410 - theorem
OAI.PureTypeSystem.ContextTower.HasType.regularityline 414 - theorem
OAI.PureTypeSystem.ContextTower.HasType.normalFormline 424 - theorem
OAI.PureTypeSystem.ContextTower.HasType.normalize_typeline 428 - def
OAI.PureTypeSystem.ContextTower.TypedSubstitutionline 443 - theorem
OAI.PureTypeSystem.ContextTower.TypedSubstitution.tailline 449 - theorem
OAI.PureTypeSystem.ContextTower.TypedSubstitution.common_stageline 457Source documentation
One common stage suffices for every declaration image, despite the substitution being presented as a total function on indices.
theorem common_stage (h : Ω.TypedSubstitution Γ σ) : ∃ k, ∀ n A, Lookup Γ n A → PureTypeSystem.HasType P (Ω.context k) ((σ n).rename (Expr.reverseIndex k)) ((A.subst σ).rename (Expr.reverseIndex k)) := by …Mentions: OAI.PureTypeSystem.Lookup, OAI.PureTypeSystem.HasType, OAI.PureTypeSystem.Expr.reverseIndex
- theorem
OAI.PureTypeSystem.ContextTower.TypedSubstitution.consline 475Source documentation
Extension assigns a raw term to the fresh generic binder.
theorem cons {A a : Expr S} (h : Ω.TypedSubstitution Γ σ) (ha : Ω.HasType a (A.subst σ)) : Ω.TypedSubstitution (A :: Γ) (fun n => match n with | 0 => a | n+1 => σ n) := by …Mentions: OAI.PureTypeSystem.Expr
- theorem
OAI.PureTypeSystem.ContextTower.HasType.substline 488Source documentation
Arbitrary typed substitution from a finite generic context to the tower.
theorem subst (h : PureTypeSystem.HasType P Γ M A) (hσ : Ω.TypedSubstitution Γ σ) : Ω.HasType (M.subst σ) (A.subst σ) := by …Mentions: OAI.PureTypeSystem.HasType
- theorem
OAI.PureTypeSystem.ContextTower.TypedSubstitution.compline 500 - theorem
OAI.PureTypeSystem.ContextTower.TypedSubstitution.identityline 507Source documentation
The tower's finite-prefix identity environment uses global names.
theorem identity (n : Nat) : Ω.TypedSubstitution (Ω.context n) (.var ∘ Expr.reverseIndex n) := by …
Mentions: OAI.PureTypeSystem.Expr.reverseIndex