fix: missing withoutModifyingState at elabSimpConfig

This commit is contained in:
Leonardo de Moura 2021-05-16 13:07:13 -07:00
parent 2ff1001583
commit 53b2ceea51
2 changed files with 18 additions and 1 deletions

View file

@ -31,7 +31,7 @@ def elabSimpConfig (optConfig : Syntax) (ctx : Bool) : TermElabM Meta.Simp.Confi
else
return {}
else
withLCtx {} {} <| withNewMCtxDepth <| Term.withSynthesize do
withoutModifyingState <| withLCtx {} {} <| Term.withSynthesize do
let c ← Term.elabTermEnsuringType optConfig[3] (Lean.mkConst (if ctx then ``Meta.Simp.ConfigCtx else ``Meta.Simp.Config))
if ctx then
return (← evalSimpConfigCtx (← instantiateMVars c)).toConfig

View file

@ -26,3 +26,20 @@ theorem double.inj' : double n = double m → n = m := by
simp
apply ih
simp_all [double]
theorem double.inj'' : double n = double m → n = m := by
intro h
induction n generalizing m with
| zero => cases m <;> trivial
| succ n ih =>
cases m with
| zero => contradiction
| succ m =>
simp [ih, double]
simp [double] at h
apply ih h
theorem double.inj''' : double n = double m → n = m := by
simp (config := { maxDischargeDepth := 2 })
simp (config := { maxSteps := 2000000 })
admit