Built with doc-gen4, running Lean4.
Bubbles () indicate interactive fragments: hover for details, tap to reveal contents.
Use Ctrl+โCtrl+โto navigate, Ctrl+๐ฑ๏ธto focus.
On Mac, use Cmdinstead of Ctrl.
/-
Copyright (c) 2022 Moritz Doll. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Moritz Doll, Mario Carneiro, Robert Y. Lewis
-/
import Mathlib.Tactic.Basic
import Mathlib.Tactic.NormCast
import Mathlib.Tactic.Zify.Attr
import Mathlib.Data.Int.Basic
/-!
# `zify` tactic
The `zify` tactic is used to shift propositions from `โ` to `โค`.
This is often useful since `โค` has well-behaved subtraction.
```
example (a b c x y z : โ) (h : ยฌ x*y*z < 0) : c < a + 3*b := by
zify
zify at h
/-
h : ยฌโx * โy * โz < 0
โข โc < โa + 3 * โb
-/
```
-/
namespace Mathlib.Tactic.Zify
open Lean
open Lean.Meta
open Lean.Parser.Tactic
open Lean.Elab.Tactic
/--
The `zify` tactic is used to shift propositions from `โ` to `โค`.
This is often useful since `โค` has well-behaved subtraction.
```
example (a b c x y z : โ) (h : ยฌ x*y*z < 0) : c < a + 3*b := by
zify
zify at h
/-
h : ยฌโx * โy * โz < 0
โข โc < โa + 3 * โb
-/
```
`zify` can be given extra lemmas to use in simplification. This is especially useful in the
presence of nat subtraction: passing `โค` arguments will allow `push_cast` to do more work.
```
example (a b c : โ) (h : a - b < c) (hab : b โค a) : false := by
zify [hab] at h
/- h : โa - โb < โc -/
```
`zify` makes use of the `@[zify_simps]` attribute to move propositions,
and the `push_cast` tactic to simplify the `โค`-valued expressions.
`zify` is in some sense dual to the `lift` tactic. `lift (z : โค) to โ` will change the type of an
integer `z` (in the supertype) to `โ` (the subtype), given a proof that `z โฅ 0`;
propositions concerning `z` will still be over `โค`. `zify` changes propositions about `โ` (the
subtype) to propositions about `โค` (the supertype), without changing the type of any variable.
-/
syntax (name :=
false
/-- A variant of `applySimpResultToProp` that cannot close the goal, but does not need a meta
variable and returns a tuple of a proof and the corresponding simplified proposition. -/
def