The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V34. The tactics of Mathlib

Mathlib.Tactic.Find

5 declarations. Mathlib docs · Source

opaque Mathlib.Tactic.Find.findDeclsPerHead E1 #

Batteries.Tactic.DeclCache (Std.HashMap Lean.HeadIndex (Array Lean.Name))

def Mathlib.Tactic.Find.findType E1 #

Lean.Expr → Lean.Elab.TermElabM Unit

def Mathlib.Tactic.Find.«command#find_» E1 #

Lean.ParserDescr

#find t finds definitions and theorems whose result type matches the term t, and prints them as info lines. Use holes in t to indicate arbitrary subexpressions, for example #find _ ∧ _ will match any conjunction.

#find is also available as a tactic, and there is also the find tactic which looks for lemmas which are applyable against the current goal.

Examples:

#find _ + _ = _ + _
#find ?n + _ = _ + ?n
#find (_ : Nat) + _ = _ + _
#find Nat → Nat

def Mathlib.Tactic.Find.tacticFind E1 #

Lean.ParserDescr

find finds definitions and theorems whose result type matches the current goal exactly, and prints them as info lines. In other words, find lists definitions and theorems that are applyable against the current goal. find will not affect the goal by itself and should be removed from the finished proof.

For a command or tactic that takes the type to search for as an argument, see #find.

Example:

example : True := by
  find
  -- True.intro: True
  -- trivial: True
  -- ...

def Mathlib.Tactic.Find.«tactic#find_» E1 #

Lean.ParserDescr

#find t finds definitions and theorems whose result type matches the term t, and prints them as info lines. Use holes in t to indicate arbitrary subexpressions, for example #find _ ∧ _ will match any conjunction. #find is also available as a command. #find will not affect the goal by itself and should be removed from the finished proof.

There is also the find tactic which looks for lemmas which are applyable against the current goal.

Examples:

#find _ + _ = _ + _
#find ?n + _ = _ + ?n
#find (_ : Nat) + _ = _ + _
#find Nat → Nat