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.Tauto

25 declarations. Mathlib docs · Source

def Mathlib.Tactic.Tauto.Config.ctorIdx E1 #

Mathlib.Tactic.Tauto.Config → ℕ

theorem Mathlib.Tactic.Tauto.DistribNotState.mk.inj E1 #

∀ {fvars : List Lean.Expr} {currentGoal : Lean.MVarId} {fvars_1 : List Lean.Expr} {currentGoal_1 : Lean.MVarId},
  { fvars := fvars, currentGoal := currentGoal } = { fvars := fvars_1, currentGoal := currentGoal_1 } →
    fvars = fvars_1 ∧ currentGoal = currentGoal_1

def Mathlib.Tactic.Tauto.DistribNotState.ctorIdx E1 #

Mathlib.Tactic.Tauto.DistribNotState → ℕ

theorem Mathlib.Tactic.Tauto.DistribNotState.mk.injEq E0 #

∀ (fvars : List Lean.Expr) (currentGoal : Lean.MVarId) (fvars_1 : List Lean.Expr) (currentGoal_1 : Lean.MVarId),
  ({ fvars := fvars, currentGoal := currentGoal } = { fvars := fvars_1, currentGoal := currentGoal_1 }) =
    (fvars = fvars_1 ∧ currentGoal = currentGoal_1)

def Mathlib.Tactic.Tauto.distribNotOnceAt E1 #

Lean.Expr → Lean.MVarId → Lean.MetaM Lean.Meta.AssertAfterResult

Tries to apply de-Morgan-like rules on a hypothesis.

structure Mathlib.Tactic.Tauto.DistribNotState E1 #

Type

State of the distribNotAt function. We need to carry around the list of remaining hypothesis as fvars so that we can incrementally apply the AssertAfterResult.subst from each step to each of them. Otherwise, they could end up referring to old hypotheses.

ctor Mathlib.Tactic.Tauto.DistribNotState.mk E0 #

List Lean.Expr → Lean.MVarId → Mathlib.Tactic.Tauto.DistribNotState

abbrev Mathlib.Tactic.Tauto.DistribNotState.fvars E1 #

Mathlib.Tactic.Tauto.DistribNotState → List Lean.Expr

The list of hypothesis left to work on, renamed to be up-to-date with the current goal.

abbrev Mathlib.Tactic.Tauto.DistribNotState.currentGoal E1 #

Mathlib.Tactic.Tauto.DistribNotState → Lean.MVarId

The current goal.

opaque Mathlib.Tactic.Tauto.distribNotAt E1 #

ℕ → Mathlib.Tactic.Tauto.DistribNotState → Lean.MetaM Mathlib.Tactic.Tauto.DistribNotState

Calls distribNotAt on the head of state.fvars up to nIters times, returning early on failure.

opaque Mathlib.Tactic.Tauto.distribNotAux E0 #

List Lean.Expr → Lean.MVarId → Lean.MetaM Lean.MVarId

For each fvar in fvars, calls distribNotAt and carries along the resulting renamings.

def Mathlib.Tactic.Tauto.distribNot E1 #

Lean.Elab.Tactic.TacticM Unit

Tries to apply de-Morgan-like rules on all hypotheses. Always succeeds, regardless of whether any progress was actually made.

structure Mathlib.Tactic.Tauto.Config E1 #

Type

Config for the tauto tactic. Currently empty. TODO: add closer option.

ctor Mathlib.Tactic.Tauto.Config.mk E0 #

Mathlib.Tactic.Tauto.Config

def Mathlib.Tactic.Tauto.elabConfig E1 #

Lean.Syntax →
  optParam Mathlib.Tactic.Tauto.Config { } → optParam Bool true → Lean.Elab.Tactic.TacticM Mathlib.Tactic.Tauto.Config

Function elaborating Config.

def Mathlib.Tactic.Tauto.coreConstructorMatcher E1 #

Q(Prop) → Lean.MetaM Bool

Matches propositions where we want to apply the constructor tactic in the core loop of tauto.

def Mathlib.Tactic.Tauto.casesMatcher E1 #

Q(Prop) → Lean.MetaM Bool

Matches propositions where we want to apply the cases tactic in the core loop of tauto.

def Mathlib.Tactic.Tauto.tautoCore E1 #

Lean.Elab.Tactic.TacticM Unit

The core loop of the tauto tactic. Repeatedly tries to break down propositions until no more progress can be made. Tries assumption and contradiction at every step, to discharge goals as soon as possible. Does not do anything that requires backtracking.

TODO: The Lean 3 version uses more-powerful versions of contradiction and assumption that additionally apply symm and use a fancy union-find data structure to avoid duplicated work.

def Mathlib.Tactic.Tauto.finishingConstructorMatcher E1 #

Q(Prop) → Lean.MetaM Bool

Matches propositions where we want to apply the constructor tactic in the finishing stage of tauto.

def Mathlib.Tactic.Tauto.tautology E1 #

Lean.Elab.Tactic.TacticM Unit

Implementation of the tauto tactic.

def Mathlib.Tactic.Tauto.tauto E1 #

Lean.ParserDescr

tauto proves tautologies in classical propositional logic. It breaks down assumptions of the form _ ∧ _, _ ∨ _, _ ↔ _ and ∃ _, _ and splits a goal of the form _ ∧ _, _ ↔ _ or ∃ _, _ until it can be discharged using rfl, contradiction or solve_by_elim. This is a finishing tactic: it either closes the goal or raises an error.

This tactic makes no attempt to avoid classical reasoning. The itauto tactic is designed for that purpose.

opaque linter.tacticAnalysis.tautoToGrind E1 #

Lean.Option Bool

Report places where tauto can be replaced by grind.

def tautoToGrind E1 #

Mathlib.TacticAnalysis.Config

Report places where tauto can be replaced by grind.

opaque linter.tacticAnalysis.regressions.tautoToGrind E1 #

Lean.Option Bool

Debug grind by identifying places where it does not yet supersede tauto.

def tautoToGrindRegressions E1 #

Mathlib.TacticAnalysis.Config

Debug grind by identifying places where it does not yet supersede tauto.