Skip to content

Commit ead1c2c

Browse files
committed
Use named hypothesis
1 parent c292fae commit ead1c2c

File tree

2 files changed

+12
-4
lines changed
  • Cslib/Computability/LambdaCalculus/WellScoped/FSub

2 files changed

+12
-4
lines changed

Cslib/Computability/LambdaCalculus/WellScoped/FSub/RebindTheory/Core.lean

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,13 @@ import Cslib.Computability.LambdaCalculus.WellScoped.FSub.Syntax
3232
must preserve the variable and type bindings in the context. -/
3333
structure Rebind (Γ : Ctx s1) (f : Rename s1 s2) (Δ : Ctx s2) where
3434
/-- Term variable preservation: x:T in Γ implies f(x):f(T) in Δ -/
35-
var : ∀ x T, Ctx.LookupVar Γ x T → Ctx.LookupVar Δ (f.var x) (T.rename f)
35+
var : ∀ x T,
36+
(hb : Ctx.LookupVar Γ x T) →
37+
Ctx.LookupVar Δ (f.var x) (T.rename f)
3638
/-- Type variable preservation: X<:T in Γ implies f(X)<:f(T) in Δ -/
37-
tvar : ∀ X T, Ctx.LookupTVar Γ X T → Ctx.LookupTVar Δ (f.tvar X) (T.rename f)
39+
tvar : ∀ X T,
40+
(hb : Ctx.LookupTVar Γ X T) →
41+
Ctx.LookupTVar Δ (f.tvar X) (T.rename f)
3842

3943
/-- **Lifting rebinding morphisms over term variable binders**.
4044

Cslib/Computability/LambdaCalculus/WellScoped/FSub/RetypeTheory/Core.lean

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,12 @@ import Cslib.Computability.LambdaCalculus.WellScoped.FSub.RebindTheory.TypeSyste
3131
3232
Unlike rebinding morphisms, retyping morphisms map variables to typing derivations. -/
3333
structure Retype (Γ : Ctx s1) (σ : Subst s1 s2) (Δ : Ctx s2) where
34-
var : ∀ x T, Γ.LookupVar x T → HasType Δ (σ.var x) (T.subst σ)
35-
tvar : ∀ X S, Γ.LookupTVar X S → Subtyp Δ (σ.tvar X) (S.subst σ)
34+
var : ∀ x T,
35+
(hb : Γ.LookupVar x T) →
36+
HasType Δ (σ.var x) (T.subst σ)
37+
tvar : ∀ X S,
38+
(hb : Γ.LookupTVar X S) →
39+
Subtyp Δ (σ.tvar X) (S.subst σ)
3640

3741
/-- Extends a retyping morphism to contexts with an additional term variable. -/
3842
def Retype.liftVar (ρ : Retype Γ σ Δ) : Retype (Γ,x:P) (σ.liftVar) (Δ,x:P.subst σ) where

0 commit comments

Comments
 (0)