The areas / V34. The tactics of Mathlib
Mathlib.Tactic.Push.Attr
20 declarations. Mathlib docs · Source
The @[push] attribute for the push and pull tactics
This file defines the @[push] attribute, so that it can be used without importing
the tactic itself.
def Mathlib.Tactic.Push.instInhabitedHead.default E1 #
Mathlib.Tactic.Push.Head
theorem Mathlib.Tactic.Push.Head.const.inj E1 #
∀ {c c_1 : Lean.Name}, Mathlib.Tactic.Push.Head.const c = Mathlib.Tactic.Push.Head.const c_1 → c = c_1
def Mathlib.Tactic.Push.Head.ctorIdx E1 #
Mathlib.Tactic.Push.Head → ℕ
theorem Mathlib.Tactic.Push.Head.const.injEq E0 #
∀ (c c_1 : Lean.Name), (Mathlib.Tactic.Push.Head.const c = Mathlib.Tactic.Push.Head.const c_1) = (c = c_1)
abbrev Mathlib.Tactic.Push.Head.ctorElimType E1 #
{motive : Mathlib.Tactic.Push.Head → Sort u} → ℕ → Sort (max 1 u)
inductive Mathlib.Tactic.Push.Head E1 #
Type
The type for a constant to be pushed by push.
ctor Mathlib.Tactic.Push.Head.const E0 #
Lean.Name → Mathlib.Tactic.Push.Head
ctor Mathlib.Tactic.Push.Head.lambda E0 #
Mathlib.Tactic.Push.Head
ctor Mathlib.Tactic.Push.Head.forall E0 #
Mathlib.Tactic.Push.Head
instance Mathlib.Tactic.Push.instInhabitedHead E0 #
Inhabited Mathlib.Tactic.Push.Head
def Mathlib.Tactic.Push.instBEqHead.beq E1 #
Mathlib.Tactic.Push.Head → Mathlib.Tactic.Push.Head → Bool
instance Mathlib.Tactic.Push.instBEqHead E0 #
BEq Mathlib.Tactic.Push.Head
def Mathlib.Tactic.Push.Head.toString E1 #
Mathlib.Tactic.Push.Head → String
Converts a Head to a string.
instance Mathlib.Tactic.Push.instToStringHead E0 #
ToString Mathlib.Tactic.Push.Head
def Mathlib.Tactic.Push.Head.ofExpr? E1 #
Lean.Expr → Option Mathlib.Tactic.Push.Head
Returns the head of an expression.
opaque Mathlib.Tactic.Push.pushExt E1 #
Lean.SimpleScopedEnvExtension Lean.Meta.SimpTheorem (Lean.Meta.DiscrTree Lean.Meta.SimpTheorem)
The push environment extension
def Mathlib.Tactic.Push.isPullThm E1 #
Lean.Name → Bool → Lean.MetaM (Option Mathlib.Tactic.Push.Head)
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.
abbrev Mathlib.Tactic.Push.PullTheorem E1 #
Type
A theorem for the pull tactic
opaque Mathlib.Tactic.Push.pullExt E1 #
Lean.SimpleScopedEnvExtension Mathlib.Tactic.Push.PullTheorem (Lean.Meta.DiscrTree Mathlib.Tactic.Push.PullTheorem)
The pull environment extension
def Mathlib.Tactic.Push.pushAttr E1 #
Lean.ParserDescr
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 ←].