Skip to content

Commit f6714df

Browse files
Vtec234digama0
andcommitted
chore: update to nightly-2022-07-28 (#357)
Changed all names related to leanprover/lean4#1346 that I could find. - [x] leanprover/lean4#1375 Co-authored-by: Wojciech Nawrocki <wjnawrocki@protonmail.com> Co-authored-by: Mario Carneiro <di.gama@gmail.com>
1 parent 876d9cc commit f6714df

30 files changed

+86
-84
lines changed

Mathlib/Init/ExtendedBinder.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Defines an extended binder syntax supporting `∀ ε > 0, ...` etc.
1212

1313
namespace Mathlib.ExtendedBinder
1414

15-
/-
15+
/--
1616
The syntax category of binder predicates contains predicates like `> 0`, `∈ s`, etc.
1717
(`: t` should not be a binder predicate because it would clash with the built-in syntax for ∀/∃.)
1818
-/

Mathlib/Lean/NameMapAttribute.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def registerNameMapAttribute (impl : NameMapAttributeImpl α) : IO (NameMapAttri
5959
registerBuiltinAttribute {
6060
name := impl.name
6161
descr := impl.descr
62-
add := fun src stx kind => do
62+
add := fun src stx _kind => do
6363
let a : α ← impl.add src stx
6464
ext.add src a
6565
}

Mathlib/Tactic/Basic.lean

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ where
119119
| _ => pure ()
120120
intro1PStep : TacticM Unit :=
121121
liftMetaTactic fun mvarId => do
122-
let (_, mvarId) ← Meta.intro1P mvarId
122+
let (_, mvarId) ← mvarId.intro1P
123123
pure [mvarId]
124124

125125
/-- Try calling `assumption` on all goals; succeeds if it closes at least one goal. -/
@@ -242,7 +242,7 @@ elab "any_goals " seq:tacticSeq : tactic => do
242242
let mut mvarIdsNew := #[]
243243
let mut anySuccess := false
244244
for mvarId in mvarIds do
245-
unless (← isExprMVarAssigned mvarId) do
245+
unless (← mvarId.isAssigned) do
246246
setGoals [mvarId]
247247
try
248248
evalTactic seq
@@ -255,10 +255,10 @@ elab "any_goals " seq:tacticSeq : tactic => do
255255
setGoals mvarIdsNew.toList
256256

257257
elab "fapply " e:term : tactic =>
258-
evalApplyLikeTactic (Meta.apply (cfg := {newGoals := ApplyNewGoals.all})) e
258+
evalApplyLikeTactic (MVarId.apply (cfg := {newGoals := ApplyNewGoals.all})) e
259259

260260
elab "eapply " e:term : tactic =>
261-
evalApplyLikeTactic (Meta.apply (cfg := {newGoals := ApplyNewGoals.nonDependentOnly})) e
261+
evalApplyLikeTactic (MVarId.apply (cfg := {newGoals := ApplyNewGoals.nonDependentOnly})) e
262262

263263
/--
264264
Tries to solve the goal using a canonical proof of `True`, or the `rfl` tactic.
@@ -272,5 +272,5 @@ elab (name := clearAuxDecl) "clear_aux_decl" : tactic => withMainContext do
272272
let mut g ← getMainGoal
273273
for ldec in ← getLCtx do
274274
if ldec.isAuxDecl then
275-
g ← Meta.tryClear g ldec.fvarId
275+
g ← g.tryClear ldec.fvarId
276276
replaceMainGoal [g]

Mathlib/Tactic/Cases.lean

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ def ElimApp.evalNames (elimInfo : ElimInfo) (alts : Array (Name × MVarId)) (wit
4848
let numFields ← getAltNumFields elimInfo altName
4949
let (altVarNames, names') := names.splitAtD numFields `_
5050
names := names'
51-
let (_, g) ← introN g numFields altVarNames
51+
let (_, g) ← g.introN numFields altVarNames
5252
let some (g, _) ← Cases.unifyEqs? numEqs g {} | pure ()
53-
let (_, g) ← introNP g numGeneralized
54-
let g ← liftM $ toClear.foldlM tryClear g
53+
let (_, g) ← g.introNP numGeneralized
54+
let g ← liftM $ toClear.foldlM MVarId.tryClear g
5555
subgoals := subgoals.push g
5656
pure subgoals
5757

@@ -62,12 +62,12 @@ elab (name := induction') "induction' " tgts:(casesTarget,+)
6262
genArg:((" generalizing " (colGt ident)+)?) : tactic => do
6363
let targets ← elabCasesTargets tgts.1.getSepArgs
6464
let g ← getMainGoal
65-
withMVarContext g do
65+
g.withContext do
6666
let elimInfo ← getElimNameInfo usingArg targets (induction := true)
6767
let targets ← addImplicitTargets elimInfo targets
6868
evalInduction.checkTargets targets
6969
let targetFVarIds := targets.map (·.fvarId!)
70-
withMVarContext g do
70+
g.withContext do
7171
let genArgs ← if genArg.1.isNone then pure #[] else getFVarIds genArg.1[1].getArgs
7272
let forbidden ← mkGeneralizationForbiddenSet targets
7373
let mut s ← getFVarSetToGeneralize targets forbidden
@@ -77,11 +77,11 @@ elab (name := induction') "induction' " tgts:(casesTarget,+)
7777
if s.contains v then
7878
throwError "unnecessary 'generalizing' argument, variable '{mkFVar v}' is generalized automatically"
7979
s := s.insert v
80-
let (fvarIds, g) ← Meta.revert g (← sortFVarIds s.toArray)
81-
let result ← withRef tgts <| ElimApp.mkElimApp elimInfo targets (← getMVarTag g)
80+
let (fvarIds, g) ← g.revert (← sortFVarIds s.toArray)
81+
let result ← withRef tgts <| ElimApp.mkElimApp elimInfo targets (← g.getTag)
8282
let elimArgs := result.elimApp.getAppArgs
8383
ElimApp.setMotiveArg g elimArgs[elimInfo.motivePos]!.mvarId! targetFVarIds
84-
assignExprMVar g result.elimApp
84+
g.assign result.elimApp
8585
let subgoals ← ElimApp.evalNames elimInfo result.alts withArg
8686
(numGeneralized := fvarIds.size) (toClear := targetFVarIds)
8787
setGoals (subgoals ++ result.others).toList
@@ -91,18 +91,18 @@ elab (name := cases') "cases' " tgts:(casesTarget,+) usingArg:((" using " ident)
9191
withArg:((" with " (colGt binderIdent)+)?) : tactic => do
9292
let targets ← elabCasesTargets tgts.1.getSepArgs
9393
let g ← getMainGoal
94-
withMVarContext g do
94+
g.withContext do
9595
let elimInfo ← getElimNameInfo usingArg targets (induction := false)
9696
let targets ← addImplicitTargets elimInfo targets
97-
let result ← withRef tgts <| ElimApp.mkElimApp elimInfo targets (← getMVarTag g)
97+
let result ← withRef tgts <| ElimApp.mkElimApp elimInfo targets (← g.getTag)
9898
let elimArgs := result.elimApp.getAppArgs
9999
let targets ← elimInfo.targetsPos.mapM (instantiateMVars elimArgs[·]!)
100100
let motive := elimArgs[elimInfo.motivePos]!
101101
let g ← generalizeTargetsEq g (← inferType motive) targets
102-
let (targetsNew, g) ← introN g targets.size
103-
withMVarContext g do
102+
let (targetsNew, g) ← g.introN targets.size
103+
g.withContext do
104104
ElimApp.setMotiveArg g motive.mvarId! targetsNew
105-
assignExprMVar g result.elimApp
105+
g.assign result.elimApp
106106
let subgoals ← ElimApp.evalNames elimInfo result.alts withArg
107107
(numEqs := targets.size) (toClear := targetsNew)
108108
setGoals subgoals.toList

Mathlib/Tactic/Clear!.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ elab_rules : tactic
2323
let deps := (← collectForwardDeps #[mkFVar fvar] true).map (·.fvarId!)
2424
if ← deps.allM fun dep => return (← isClass? (lctx.get! dep).type).isNone then
2525
toClear := toClear ++ deps
26-
tryClearMany goal toClear
26+
goal.tryClearMany toClear

Mathlib/Tactic/ClearExcept.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ elab_rules : tactic
2121
unless fvarIds.contains decl.fvarId do
2222
if let none ← isClass? decl.type then
2323
toClear := toClear.push decl.fvarId
24-
tryClearMany goal toClear
24+
goal.tryClearMany toClear

Mathlib/Tactic/Clear_.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ elab (name := clear_) "clear_" : tactic =>
1313
if !str.isEmpty && str.front == '_' then
1414
if let none ← isClass? decl.type then
1515
toClear := toClear.push decl.fvarId
16-
tryClearMany goal toClear
16+
goal.tryClearMany toClear

Mathlib/Tactic/Constructor.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ except that it does not reorder goals.
1515
-/
1616
elab "fconstructor " : tactic => withMainContext do
1717
let mvarIds' ←
18-
Meta.constructor (cfg := {newGoals := .all}) (← getMainGoal)
18+
(← getMainGoal).constructor (cfg := {newGoals := .all})
1919
Term.synthesizeSyntheticMVarsNoPostponing
2020
replaceMainGoal mvarIds'

Mathlib/Tactic/Ext.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ scoped elab "ext_iff_type%" struct:ident : term => do
6161

6262
elab "subst_eqs" : tactic =>
6363
open Elab.Tactic in
64-
liftMetaTactic1 fun mvarId => substEqs mvarId
64+
liftMetaTactic1 fun mvarId => mvarId.substEqs
6565

6666
scoped macro "ext_proof%" : term =>
6767
`(fun {..} {..} => by intros; subst_eqs; rfl)
@@ -146,7 +146,7 @@ elab "apply_ext_lemma" : tactic => do
146146
let s ← saveState
147147
for lem in ← (extLemmas (← getEnv)).getMatch ty do
148148
try
149-
liftMetaTactic (apply · (← mkConstWithFreshMVarLevels lem))
149+
liftMetaTactic (·.apply (← mkConstWithFreshMVarLevels lem))
150150
return
151151
catch _ => s.restore
152152
throwError "no applicable extensionality lemma found for{indentExpr ty}"

Mathlib/Tactic/Have.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ syntax "suffices" Parser.Term.haveIdLhs' : tactic
3636
open Elab Term in
3737
def haveLetCore (mvarId : MVarId) (name : Option Syntax) (bis : Array Syntax)
3838
(t : Option Syntax) (keepTerm : Bool) : TermElabM (MVarId × MVarId) :=
39-
let declFn := if keepTerm then define else assert
40-
withMVarContext mvarId do
39+
let declFn := if keepTerm then MVarId.define else MVarId.assert
40+
mvarId.withContext do
4141
let n := if let some n := name then n.getId else `this
4242
let elabBinders k := if bis.isEmpty then k #[] else elabBinders bis k
4343
let (mvar1, t, p) ← elabBinders fun es => do
@@ -46,9 +46,9 @@ def haveLetCore (mvarId : MVarId) (name : Option Syntax) (bis : Array Syntax)
4646
| some t => Tactic.elabTerm.go t none
4747
let p ← mkFreshExprMVar t MetavarKind.syntheticOpaque n
4848
pure (p.mvarId!, ← mkForallFVars es t, ← mkLambdaFVars es p)
49-
let (fvar, mvar2) ← intro1P (← declFn mvarId n t p)
49+
let (fvar, mvar2) ← (← declFn mvarId n t p).intro1P
5050
if let some stx := name then
51-
withMVarContext mvar2 do
51+
mvar2.withContext do
5252
Term.addTermInfo' (isBinder := true) stx (mkFVar fvar)
5353
pure (mvar1, mvar2)
5454

0 commit comments

Comments
 (0)