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.ClickSuggestions.Rewrite

33 declarations. Mathlib docs · Source

theorem Mathlib.Tactic.ClickSuggestions.RwKey.mk.inj E1 #

∀ {numGoals : ℕ} {symm : Bool} {nameLength replacementSize : ℕ} {name : String}
  {replacement : Lean.Meta.AbstractMVarsResult} {numGoals_1 : ℕ} {symm_1 : Bool} {nameLength_1 replacementSize_1 : ℕ}
  {name_1 : String} {replacement_1 : Lean.Meta.AbstractMVarsResult},
  { numGoals := numGoals, symm := symm, nameLength := nameLength, replacementSize := replacementSize, name := name,
        replacement := replacement } =
      { numGoals := numGoals_1, symm := symm_1, nameLength := nameLength_1, replacementSize := replacementSize_1,
        name := name_1, replacement := replacement_1 } →
    numGoals = numGoals_1 ∧
      symm = symm_1 ∧
        nameLength = nameLength_1 ∧ replacementSize = replacementSize_1 ∧ name = name_1 ∧ replacement = replacement_1

theorem Mathlib.Tactic.ClickSuggestions.RwInfo.mk.inj E1 #

∀ {rootExpr subExpr : Lean.Expr} {rflTarget? : Option Lean.Expr} {pos : Lean.SubExpr.Pos}
  {rwKind : Mathlib.Tactic.ClickSuggestions.RwKind} {rootExpr_1 subExpr_1 : Lean.Expr} {rflTarget?_1 : Option Lean.Expr}
  {pos_1 : Lean.SubExpr.Pos} {rwKind_1 : Mathlib.Tactic.ClickSuggestions.RwKind},
  { rootExpr := rootExpr, subExpr := subExpr, rflTarget? := rflTarget?, pos := pos, rwKind := rwKind } =
      { rootExpr := rootExpr_1, subExpr := subExpr_1, rflTarget? := rflTarget?_1, pos := pos_1, rwKind := rwKind_1 } →
    rootExpr = rootExpr_1 ∧ subExpr = subExpr_1 ∧ rflTarget? = rflTarget?_1 ∧ pos = pos_1 ∧ rwKind = rwKind_1

def Mathlib.Tactic.ClickSuggestions.instInhabitedRwKey.default E1 #

Mathlib.Tactic.ClickSuggestions.RwKey

def Mathlib.Tactic.ClickSuggestions.RwLemma.ctorIdx E1 #

Mathlib.Tactic.ClickSuggestions.RwLemma → ℕ

theorem Mathlib.Tactic.ClickSuggestions.RwKey.mk.injEq E0 #

∀ (numGoals : ℕ) (symm : Bool) (nameLength replacementSize : ℕ) (name : String)
  (replacement : Lean.Meta.AbstractMVarsResult) (numGoals_1 : ℕ) (symm_1 : Bool) (nameLength_1 replacementSize_1 : ℕ)
  (name_1 : String) (replacement_1 : Lean.Meta.AbstractMVarsResult),
  ({ numGoals := numGoals, symm := symm, nameLength := nameLength, replacementSize := replacementSize, name := name,
        replacement := replacement } =
      { numGoals := numGoals_1, symm := symm_1, nameLength := nameLength_1, replacementSize := replacementSize_1,
        name := name_1, replacement := replacement_1 }) =
    (numGoals = numGoals_1 ∧
      symm = symm_1 ∧
        nameLength = nameLength_1 ∧ replacementSize = replacementSize_1 ∧ name = name_1 ∧ replacement = replacement_1)

theorem Mathlib.Tactic.ClickSuggestions.RwInfo.mk.injEq E0 #

∀ (rootExpr subExpr : Lean.Expr) (rflTarget? : Option Lean.Expr) (pos : Lean.SubExpr.Pos)
  (rwKind : Mathlib.Tactic.ClickSuggestions.RwKind) (rootExpr_1 subExpr_1 : Lean.Expr) (rflTarget?_1 : Option Lean.Expr)
  (pos_1 : Lean.SubExpr.Pos) (rwKind_1 : Mathlib.Tactic.ClickSuggestions.RwKind),
  ({ rootExpr := rootExpr, subExpr := subExpr, rflTarget? := rflTarget?, pos := pos, rwKind := rwKind } =
      { rootExpr := rootExpr_1, subExpr := subExpr_1, rflTarget? := rflTarget?_1, pos := pos_1, rwKind := rwKind_1 }) =
    (rootExpr = rootExpr_1 ∧ subExpr = subExpr_1 ∧ rflTarget? = rflTarget?_1 ∧ pos = pos_1 ∧ rwKind = rwKind_1)

def Mathlib.Tactic.ClickSuggestions.RwInfo.ctorIdx E1 #

Mathlib.Tactic.ClickSuggestions.RwInfo → ℕ

def Mathlib.Tactic.ClickSuggestions.RwKey.ctorIdx E1 #

Mathlib.Tactic.ClickSuggestions.RwKey → ℕ

theorem Mathlib.Tactic.ClickSuggestions.RwLemma.mk.injEq E0 #

∀ (name : Mathlib.Tactic.ClickSuggestions.Premise) (symm : Bool) (name_1 : Mathlib.Tactic.ClickSuggestions.Premise)
  (symm_1 : Bool),
  ({ name := name, symm := symm } = { name := name_1, symm := symm_1 }) = (name = name_1 ∧ symm = symm_1)

theorem Mathlib.Tactic.ClickSuggestions.RwLemma.mk.inj E1 #

∀ {name : Mathlib.Tactic.ClickSuggestions.Premise} {symm : Bool} {name_1 : Mathlib.Tactic.ClickSuggestions.Premise}
  {symm_1 : Bool}, { name := name, symm := symm } = { name := name_1, symm := symm_1 } → name = name_1 ∧ symm = symm_1

structure Mathlib.Tactic.ClickSuggestions.RwLemma E1 #

Type

The structure for rewrite lemmas stored in the RefinedDiscrTree.

ctor Mathlib.Tactic.ClickSuggestions.RwLemma.mk E0 #

Mathlib.Tactic.ClickSuggestions.Premise → Bool → Mathlib.Tactic.ClickSuggestions.RwLemma

abbrev Mathlib.Tactic.ClickSuggestions.RwLemma.name E1 #

Mathlib.Tactic.ClickSuggestions.RwLemma → Mathlib.Tactic.ClickSuggestions.Premise

The lemma

abbrev Mathlib.Tactic.ClickSuggestions.RwLemma.symm E1 #

Mathlib.Tactic.ClickSuggestions.RwLemma → Bool

symm is true when rewriting from right to left

structure Mathlib.Tactic.ClickSuggestions.RwInfo E1 #

Type

The information needed for doing a rewrite.

ctor Mathlib.Tactic.ClickSuggestions.RwInfo.mk E0 #

Lean.Expr →
  Lean.Expr →
    Option Lean.Expr →
      Lean.SubExpr.Pos → Mathlib.Tactic.ClickSuggestions.RwKind → Mathlib.Tactic.ClickSuggestions.RwInfo

abbrev Mathlib.Tactic.ClickSuggestions.RwInfo.rootExpr E1 #

Mathlib.Tactic.ClickSuggestions.RwInfo → Lean.Expr

The outer expression in which the rewrite takes place.

abbrev Mathlib.Tactic.ClickSuggestions.RwInfo.subExpr E1 #

Mathlib.Tactic.ClickSuggestions.RwInfo → Lean.Expr

The expression that is being rewritten.

abbrev Mathlib.Tactic.ClickSuggestions.RwInfo.rflTarget? E1 #

Mathlib.Tactic.ClickSuggestions.RwInfo → Option Lean.Expr

If we rewrite into this expression, then the goal will be solved.

abbrev Mathlib.Tactic.ClickSuggestions.RwInfo.pos E1 #

Mathlib.Tactic.ClickSuggestions.RwInfo → Lean.SubExpr.Pos

The expression that is being rewritten. This may not be the same as the selected expression, because we also suggest rewriting partial applications.

abbrev Mathlib.Tactic.ClickSuggestions.RwInfo.rwKind E1 #

Mathlib.Tactic.ClickSuggestions.RwInfo → Mathlib.Tactic.ClickSuggestions.RwKind

Some information about the rewrite position.

structure Mathlib.Tactic.ClickSuggestions.RwKey E1 #

Type

The key that is used for sorting and deduplicating rw lemmas.

ctor Mathlib.Tactic.ClickSuggestions.RwKey.mk E0 #

ℕ → Bool → ℕ → ℕ → String → Lean.Meta.AbstractMVarsResult → Mathlib.Tactic.ClickSuggestions.RwKey

abbrev Mathlib.Tactic.ClickSuggestions.RwKey.numGoals E1 #

Mathlib.Tactic.ClickSuggestions.RwKey → ℕ

The number of side goals created.

abbrev Mathlib.Tactic.ClickSuggestions.RwKey.symm E1 #

Mathlib.Tactic.ClickSuggestions.RwKey → Bool

If symm := true, then the rewrite is right-to-left.

abbrev Mathlib.Tactic.ClickSuggestions.RwKey.nameLength E1 #

Mathlib.Tactic.ClickSuggestions.RwKey → ℕ

The name length of the used lemma.

abbrev Mathlib.Tactic.ClickSuggestions.RwKey.replacementSize E1 #

Mathlib.Tactic.ClickSuggestions.RwKey → ℕ

The length of the new subexpression.

abbrev Mathlib.Tactic.ClickSuggestions.RwKey.name E1 #

Mathlib.Tactic.ClickSuggestions.RwKey → String

The nae of the used lemma.

abbrev Mathlib.Tactic.ClickSuggestions.RwKey.replacement E1 #

Mathlib.Tactic.ClickSuggestions.RwKey → Lean.Meta.AbstractMVarsResult

The new subexpression.

instance Mathlib.Tactic.ClickSuggestions.instInhabitedRwKey E0 #

Inhabited Mathlib.Tactic.ClickSuggestions.RwKey

instance Mathlib.Tactic.ClickSuggestions.instOrdRwKey E0 #

Ord Mathlib.Tactic.ClickSuggestions.RwKey

def Mathlib.Tactic.ClickSuggestions.RwKey.isDuplicate E1 #

Mathlib.Tactic.ClickSuggestions.RwKey → Mathlib.Tactic.ClickSuggestions.RwKey → Lean.MetaM Bool

Whether the two suggestions are duplicates of each other.

def Mathlib.Tactic.ClickSuggestions.RwLemma.try E1 #

Mathlib.Tactic.ClickSuggestions.RwInfo →
  Mathlib.Tactic.ClickSuggestions.RwLemma →
    Array Lean.Expr →
      Mathlib.Tactic.ClickSuggestions.ClickSuggestionsM
        (Mathlib.Tactic.ClickSuggestions.Result Mathlib.Tactic.ClickSuggestions.RwKey)

Generate the suggestion for rewriting with lem.