@@ -30,57 +30,57 @@ namespace LeanSubst
3030
3131 namespace Subst
3232 section
33- @[simp]
33+ @ [simp, grind = ]
3434 theorem rewrite1 : re 0 :: +1 = +0 @T := by
3535 funext; case _ x =>
3636 cases x; all_goals (simp [Subst.id, Subst.succ])
3737
3838 open SubstMap
3939 variable [RenMap T]
4040
41- @[simp]
41+ @ [simp, grind = ]
4242 theorem I_lift : +0 .lift = +0 @T := by
4343 funext; case _ x =>
4444 cases x; all_goals (simp [Subst.lift, Subst.id])
4545
46- @[simp]
46+ @ [simp, grind = ]
4747 theorem rewrite2 [SubstMap T T] {σ : Subst T} : +0 ∘ σ = σ := by
4848 funext; case _ x =>
4949 unfold Subst.compose; simp [Subst.id]
5050
51- @[simp]
51+ @ [simp, grind = ]
5252 theorem rewrite3_replace [SubstMap T T] {σ τ : Subst T} {s : T}
5353 : (su s :: σ) ∘ τ = su s[τ] :: (σ ∘ τ)
5454 := by
5555 funext; case _ x =>
5656 cases x; all_goals (simp [Subst.compose])
5757
58- @[simp]
58+ @ [simp, grind = ]
5959 theorem rewrite3_rename [SubstMap T T] {s} {σ τ : Subst T}
6060 : (re s :: σ) ∘ τ = (τ s) :: (σ ∘ τ)
6161 := by
6262 funext; case _ x =>
6363 cases x; all_goals (simp [Subst.compose])
6464
65- @[simp]
65+ @ [simp, grind = ]
6666 theorem rewrite4 [SubstMap T T] {s} {σ : Subst T} : +1 ∘ (s :: σ) = σ := by
6767 funext; case _ x =>
6868 cases x; all_goals (simp [Subst.compose, Subst.succ])
6969
70- @[simp]
70+ @ [simp, grind = ]
7171 theorem rewrite5 [SubstMap T T] {σ : Subst T} : σ 0 :: (+1 ∘ σ) = σ := by
7272 funext; case _ x =>
7373 cases x
7474 case _ => simp
7575 case _ => simp [Subst.succ, Subst.compose]
7676 end
7777
78- @[simp]
78+ @ [simp, grind = ]
7979 theorem apply_I_is_id [RenMap T] [SubstMap S T] [SubstMapId S T] {s : S}
8080 : s[+0 :T] = s
8181 := SubstMapId.apply_id
8282
83- @[simp]
83+ @ [simp, grind = ]
8484 theorem rewrite_lift [RenMap T] [SubstMap T T] [SubstMapStable T] {σ : Subst T}
8585 : σ.lift = re 0 :: (σ ∘ +1 )
8686 := by
@@ -95,7 +95,7 @@ namespace LeanSubst
9595 rw [apply_stable (σ := +1 )]
9696 funext; case _ i => simp [Ren.to, Subst.succ]
9797
98- @[simp]
98+ @ [simp, grind = ]
9999 theorem rewrite6 [RenMap T] [SubstMap T T] [SubstMapId T T] {σ : Subst T}
100100 : σ ∘ +0 = σ
101101 := by
@@ -104,14 +104,14 @@ namespace LeanSubst
104104 generalize zdef : σ x = z
105105 cases z <;> simp at *;
106106
107- @[simp]
107+ @ [simp, grind = ]
108108 theorem apply_compose_commute
109109 [RenMap S] [RenMap T] [SubstMap T T] [SubstMap S T] [SubstMapCompose S T]
110110 {s : S} {σ τ : Subst T}
111111 : s[σ:T][τ:_] = s[σ ∘ τ:T]
112112 := SubstMapCompose.apply_compose
113113
114- @[simp]
114+ @ [simp, grind = ]
115115 theorem rewrite7
116116 [RenMap T] [SubstMap T T] [SubstMapCompose T T]
117117 {σ τ μ : Subst T}
@@ -121,7 +121,7 @@ namespace LeanSubst
121121 simp [Subst.compose]
122122 cases σ x <;> simp
123123
124- @[simp]
124+ @ [simp, grind = ]
125125 theorem hrewrite1
126126 [RenMap T] [SubstMap S T] [SubstMapId S T]
127127 {σ : Subst S}
@@ -132,7 +132,7 @@ namespace LeanSubst
132132 generalize zdef : σ x = z
133133 cases z <;> simp
134134
135- @[simp]
135+ @ [simp, grind = ]
136136 theorem hcomp_ren_left
137137 [RenMap S] [RenMap T] [SubstMap S T]
138138 (r : Ren) (σ : Subst T)
@@ -141,15 +141,15 @@ namespace LeanSubst
141141 funext; case _ x =>
142142 induction x <;> simp [Subst.hcompose, Ren.to]
143143
144- @[simp]
144+ @ [simp, grind = ]
145145 theorem hrewrite2
146146 [RenMap S] [RenMap T] [SubstMap S T]
147147 {σ : Subst T}
148148 : (+0 @S) ◾ σ = +0
149149 := by
150150 apply hcomp_ren_left (S := S) (T := T) (λ x => x) σ
151151
152- @[simp]
152+ @ [simp, grind = ]
153153 theorem hrewrite3
154154 [RenMap S] [RenMap T] [SubstMap S T]
155155 {σ : Subst T}
@@ -158,7 +158,7 @@ namespace LeanSubst
158158 have lem := hcomp_ren_left (S := S) (T := T) (· + 1 ) σ
159159 simp at lem; exact lem
160160
161- @[simp]
161+ @ [simp, grind = ]
162162 theorem hrewrite4
163163 [RenMap T] [SubstMap S T]
164164 {x} {σ : Subst S} {τ : Subst T}
@@ -167,6 +167,7 @@ namespace LeanSubst
167167 funext; case _ i =>
168168 cases i <;> simp [Subst.hcompose]
169169
170+ @ [grind =]
170171 theorem hcomp_dist_ren_left
171172 [RenMap S] [RenMap T] [SubstMap S S] [SubstMap S T]
172173 (r : Ren) {σ : Subst S} {τ : Subst T}
@@ -175,7 +176,7 @@ namespace LeanSubst
175176 funext; case _ x =>
176177 simp [Subst.hcompose, Subst.compose, Ren.to]
177178
178- @[simp]
179+ @ [simp, grind = ]
179180 theorem hrewrite5
180181 [RenMap S] [RenMap T] [SubstMap T T] [SubstMap S T] [SubstMapCompose S T]
181182 {σ : Subst S} {τ μ : Subst T}
@@ -186,6 +187,7 @@ namespace LeanSubst
186187 generalize zdef : σ x = z
187188 cases z <;> simp
188189
190+ @ [grind =]
189191 theorem hcomp_distr_ren_right
190192 [RenMap S] [RenMap T] [SubstMap S S] [SubstMap S T] [SubstMapRenCommute S T]
191193 (r : Ren) (σ : Subst S) (μ : Subst T)
@@ -197,7 +199,7 @@ namespace LeanSubst
197199 cases z <;> simp
198200 rw [SubstMapRenCommute.apply_ren_commute r μ]
199201
200- @[simp]
202+ @ [simp, grind = ]
201203 theorem hrewrite6
202204 [RenMap S] [RenMap T] [SubstMap S S] [SubstMap S T] [SubstMapRenCommute S T]
203205 (r : Ren) (σ : Subst S)
@@ -206,14 +208,14 @@ namespace LeanSubst
206208 have lem := hcomp_distr_ren_right (T := T) r σ +1
207209 simp at lem; exact lem
208210
209- @[simp]
211+ @ [simp, grind = ]
210212 theorem apply_hcompose
211213 [RenMap S] [RenMap T] [SubstMap S S] [SubstMap S T] [SubstMapHetCompose S T]
212214 {s : S} {σ : Subst S} {τ : Subst T}
213215 : s[σ][τ:T] = s[τ:T][σ ◾ τ]
214216 := by exact SubstMapHetCompose.apply_hcompose
215217
216- @[simp]
218+ @ [simp, grind = ]
217219 theorem hrewrite7
218220 [RenMap S] [RenMap T] [SubstMap S S] [SubstMap S T] [SubstMapHetCompose S T]
219221 {σ τ : Subst S} (μ : Subst T)
@@ -238,9 +240,8 @@ namespace LeanSubst
238240 funext; case _ t =>
239241 induction t generalizing $r $σ
240242 all_goals simp [rmap, smap, *] at *; try simp [*]
241- -- any_goals solve | (
242- -- rw [<-Ren.lift_eq_from_eq (r := r) h])
243243 any_goals solve | (rw [<-h]; simp [Ren.to])
244+ all_goals grind
244245 })
245246
246247 macro "subst_solve_hcompose"
@@ -288,7 +289,7 @@ namespace LeanSubst
288289 try any_goals solve | (
289290 simp [-Subst.rewrite_lift, *]
290291 rw [<-Ren.to_lift]
291- simp [-Subst.rewrite_lift, -Ren.to_lift, *])
292+ simp [-Subst.rewrite_lift, *])
292293 have lem3s {σ : Subst $Ty} {t : $Ty} : t[+1 :$Ty][σ:_] = t[+1 ∘ σ:_] := by
293294 rw [<-Ren.to_succ, lem3]
294295 have lem4 {σ τ : Subst $Ty} : +1 ∘ τ ∘ σ = (+1 ∘ τ) ∘ σ := by
@@ -312,7 +313,7 @@ namespace LeanSubst
312313 try any_goals solve | (
313314 simp [-Subst.rewrite_lift, *]
314315 rw [<-Ren.to_lift]
315- simp [-Subst.rewrite_lift, -Ren.to_lift, *])
316+ simp [-Subst.rewrite_lift, *])
316317 have lem7s {τ : Subst $Ty} {t : $Ty} : t[τ:_][+1 :$Ty] = t[τ ∘ +1 :_] := by
317318 rw [<-Ren.to_succ, lem7]
318319 have lem8 {σ τ : Subst $Ty} : (σ ∘ +1 ) ∘ τ = σ ∘ +1 ∘ τ := by
0 commit comments