File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11
22import LeanSubst.Basic
33import LeanSubst.Laws
4- import LeanSubst.Context
4+ import LeanSubst.List
55import LeanSubst.Reduction
66import LeanSubst.Normal
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ import LeanSubst.Basic
2+
3+ namespace LeanSubst
4+
5+ variable {T : Type } [Inhabited T] [RenMap T] [SubstMap T T]
6+
7+ @[simp]
8+ def List.subst_get (σ : Subst T) : List T -> Nat -> T
9+ | .nil, _ => default
10+ | .cons h _, 0 => h[σ]
11+ | .cons _ t, n + 1 => (subst_get σ t n)[σ]
12+
13+ macro :max t:term noWs "[" σ:term "|" x:term "]" : term => `(List.subst_get $σ $t $x)
14+
15+ @[simp]
16+ theorem List.subst_get_zero {σ} {A : T} {Γ : List T} : (A::Γ)[σ|0 ] = A[σ] := by
17+ simp [subst_get]
18+
19+ @[simp]
20+ theorem List.subst_get_succ {σ} {A : T} {Γ : List T} {x} : (A::Γ)[σ|x + 1 ] = Γ[σ|x][σ] := by
21+ simp [subst_get]
22+
23+ end LeanSubst
You can’t perform that action at this time.
0 commit comments