Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 7 additions & 31 deletions Mathlib/Tactic/Replace.lean
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ public import Mathlib.Tactic.Have
/-!
# Extending `replace`

This file extends the `replace` tactic from `Batteries` to allow the addition of hypotheses to
the context without requiring their proofs to be provided immediately.
This file extends the `replace` tactic from the standard library to allow the addition of hypotheses
to the context without requiring their proofs to be provided immediately.

As a style choice, this should not be used in mathlib; but is provided for downstream users who
preferred the old style.
Expand All @@ -24,36 +24,12 @@ namespace Mathlib.Tactic
open Lean Elab.Tactic

/--
Acts like `have`, but removes a hypothesis with the same name as
this one if possible. For example, if the state is:

Then after `replace h : β` the state will be:

```lean
case h
f : α → β
h : α
⊢ β

f : α → β
h : β
⊢ goal
```

whereas `have h : β` would result in:

```lean
case h
f : α → β
h : α
⊢ β

f : α → β
h✝ : α
h : β
⊢ goal
```
`replace h : t`, without a subsequent proof, creates a new main goal `case h : ... ⊢ t`.
This form is considered deprecated in Mathlib: use `replace h : t := _` instead.
-/
tactic_extension Lean.Parser.Tactic.replace

@[tactic_alt Lean.Parser.Tactic.replace]
syntax (name := replace') "replace" haveIdLhs' : tactic

elab_rules : tactic
Expand Down
Loading