The @[push]
attribute for the push
, push_neg
and pull
tactics #
This file defines the @[push]
attribute, so that it can be used without importing
the tactic itself.
Equations
Equations
Equations
- Mathlib.Tactic.Push.instBEqHead.beq (Mathlib.Tactic.Push.Head.const a) (Mathlib.Tactic.Push.Head.const b) = (a == b)
- Mathlib.Tactic.Push.instBEqHead.beq Mathlib.Tactic.Push.Head.lambda Mathlib.Tactic.Push.Head.lambda = true
- Mathlib.Tactic.Push.instBEqHead.beq Mathlib.Tactic.Push.Head.forall Mathlib.Tactic.Push.Head.forall = true
- Mathlib.Tactic.Push.instBEqHead.beq x✝¹ x✝ = false
Instances For
Equations
Returns the head of an expression.
Equations
- Mathlib.Tactic.Push.Head.ofExpr? (f.app arg) = Option.map Mathlib.Tactic.Push.Head.const f.getAppFn.constName?
- Mathlib.Tactic.Push.Head.ofExpr? (Lean.Expr.lam binderName binderType body binderInfo) = some Mathlib.Tactic.Push.Head.lambda
- Mathlib.Tactic.Push.Head.ofExpr? (Lean.Expr.forallE binderName binderType body binderInfo) = some Mathlib.Tactic.Push.Head.forall
- Mathlib.Tactic.Push.Head.ofExpr? x✝ = none
Instances For
The push
environment extension
Checks if the theorem is suitable for the pull
tactic. That is,
check if it is of the form x = f ...
where x
contains the head f
,
but f
is not the head of x
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Checks if the expression has the head in any subexpression.
We don't need to check this for .lambda
, because the term being a function
is sufficient for pull fun _ ↦ _
to be applicable.
Equations
- One or more equations did not get rendered due to their size.
- Mathlib.Tactic.Push.isPullThm.containsHead e (Mathlib.Tactic.Push.Head.const c) = e.containsConst fun (x : Lean.Name) => x == c
- Mathlib.Tactic.Push.isPullThm.containsHead e Mathlib.Tactic.Push.Head.lambda = true
Instances For
A theorem for the pull
tactic
Instances For
The pull
environment extension
The push
attribute is used to tag lemmas that "push" a constant into an expression.
For example:
@[push] theorem log_mul (hx : x ≠ 0) (hy : y ≠ 0) : log (x * y) = log x + log y
@[push] theorem log_abs : log |x| = log x
@[push] theorem not_imp (p q : Prop) : ¬(p → q) ↔ p ∧ ¬q
@[push] theorem not_iff (p q : Prop) : ¬(p ↔ q) ↔ (p ∧ ¬q) ∨ (¬p ∧ q)
@[push] theorem not_not (p : Prop) : ¬ ¬p ↔ p
@[push] theorem not_le : ¬a ≤ b ↔ b < a
Note that some push
lemmas don't push the constant away from the head (log_abs
) and
some push
lemmas cancel the constant out (not_not
and not_le
).
For the other lemmas that are "genuine" push
lemmas, a pull
attribute is automatically added
in the reverse direction. To not add a pull
tag, use @[push only]
.
To tag the reverse direction of the lemma, use @[push ←]
.
Equations
- One or more equations did not get rendered due to their size.