@@ -11,7 +11,7 @@ namespace LeanSubst.Examples.LambdaCalc
1111 infixl :65 " :@ " => Term.app
1212
1313 @[coe]
14- def Term.from_action : Subst. Action Term -> Term
14+ def Term.from_action : Action Term -> Term
1515 | re y => var y
1616 | su t => t
1717
@@ -29,11 +29,11 @@ namespace LeanSubst.Examples.LambdaCalc
2929 @ [simp, grind =]
3030 theorem Term.from_action_su {t} : from_action (su t) = t := by simp [from_action]
3131
32- instance instCoe_SubstActionTerm_Term : Coe (Subst. Action Term) Term where
32+ instance instCoe_SubstActionTerm_Term : Coe (Action Term) Term where
3333 coe := Term.from_action
3434
3535 @[simp]
36- def Term.ren_act (r : Ren) : Term -> Term
36+ def Term.ren_act (r : Ren Term ) : Term -> Term
3737 | .var x => .var (r.act x)
3838 | t => t
3939
@@ -47,12 +47,12 @@ namespace LeanSubst.Examples.LambdaCalc
4747 lift (f : A) (k : Nat := 1 ) : A
4848
4949 @[simp]
50- instance : Kit Term Ren where
50+ instance : Kit Term ( Ren Term) where
5151 act := Term.ren_act
5252 lift f n := Ren.lift f n
5353
5454 @[simp]
55- instance [RenMap Term] : Kit Term (Subst Term) where
55+ instance [RenMap Term Term ] : Kit Term (Subst Term) where
5656 act := Term.subst_act
5757 lift f n := Subst.lift f n
5858
@@ -63,27 +63,27 @@ namespace LeanSubst.Examples.LambdaCalc
6363 | :λ t => :λ kitmap (kit.lift σ) t
6464
6565 @[simp]
66- def rmap (r : Ren) : Term -> Term := kitmap r
66+ def rmap (r : Ren Term ) : Term -> Term := kitmap r
6767
68- instance : RenMap Term where
68+ instance : RenMap Term Term where
6969 rmap := rmap
7070
7171 @ [simp, grind =]
72- theorem ren_var {x} {r : Ren} : (Term.var x)⟨r⟩ = .var (r.act x) := by
72+ theorem ren_var {x} {r : Ren Term } : (Term.var x)⟨r⟩ = .var (r.act x) := by
7373 simp +instances [RenMap.rmap]
7474
7575 @ [simp, grind =]
76- theorem ren_app {t1 t2} {r : Ren} : (t1 :@ t2)⟨r⟩ = t1⟨r⟩ :@ t2⟨r⟩ := by
76+ theorem ren_app {t1 t2} {r : Ren Term } : (t1 :@ t2)⟨r⟩ = t1⟨r⟩ :@ t2⟨r⟩ := by
7777 simp [RenMap.rmap]
7878
7979 @ [simp, grind =]
80- theorem ren_lam {t} {r : Ren} : (:λ t)⟨r⟩ = :λ t⟨r.lift⟩ := by
80+ theorem ren_lam {t} {r : Ren Term } : (:λ t)⟨r⟩ = :λ t⟨r.lift⟩ := by
8181 simp +instances [RenMap.rmap]
8282
83- instance : RenMapId Term where
83+ instance : RenMapId Term Term where
8484 apply_id := by intro t; induction t <;> simp [*]
8585
86- instance : RenMapCompose Term where
86+ instance : RenMapCompose Term Term where
8787 apply_compose := by subst_solve_compose
8888
8989 @[simp]
@@ -112,16 +112,24 @@ namespace LeanSubst.Examples.LambdaCalc
112112 generalize zdef : σ.act x = z
113113 cases z <;> simp [Term.from_action]
114114
115+ @[simp]
116+ theorem Term.from_action_compose_ren {x} {σ : Subst Term} {r : Ren Term}
117+ : (from_action (σ.act x))⟨r⟩ = from_action ((σ ∘ r).act x)
118+ := by
119+ simp [Term.from_action]
120+ generalize zdef : σ.act x = z
121+ cases z <;> simp
122+
115123 instance : SubstMapId Term Term where
116124 apply_id := by subst_solve_id
117125
118- instance : SubstMapStable Term where
126+ instance : SubstMapStable Term Term where
119127 apply_stable := by subst_solve_stable
120128
121129 instance : SubstMapRenComposeLeft Term Term where
122130 apply_ren_compose_left := by subst_solve_compose
123131
124- instance : SubstMapRenComposeRight Term Term where
132+ instance : SubstMapRenComposeRight Term where
125133 apply_ren_compose_right := by subst_solve_compose
126134
127135 instance : SubstMapCompose Term Term where
0 commit comments