The areas / V34. The tactics of Mathlib
Mathlib.Tactic.RenameBVar
3 declarations. Mathlib docs · Source
The rename_bvar tactic
This file defines the rename_bvar tactic, for renaming bound variables.
def Mathlib.Tactic.renameBVarHyp E1 #
Lean.MVarId → Lean.FVarId → Lean.Name → Lean.Name → Lean.MetaM Unit
Renames a bound variable in a hypothesis.
def Mathlib.Tactic.renameBVarTarget E1 #
Lean.MVarId → Lean.Name → Lean.Name → Lean.MetaM Unit
Renames a bound variable in the target.
def Mathlib.Tactic.«tacticRename_bvar_→__» E1 #
Lean.ParserDescr
rename_bvar old → newrenames all bound variables namedoldtonewin the target.rename_bvar old → new at hdoes the same in hypothesish.
example (P : ℕ → ℕ → Prop) (h : ∀ n, ∃ m, P n m) : ∀ l, ∃ m, P l m := by
rename_bvar n → q at h -- h is now ∀ (q : ℕ), ∃ (m : ℕ), P q m,
rename_bvar m → n -- target is now ∀ (l : ℕ), ∃ (n : ℕ), P k n,
exact h -- Lean does not care about those bound variable names
Note: name clashes are resolved automatically.