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

42 declarations. Mathlib docs · Source

Support for grw suggestions in #click_suggestions

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

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

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

Mathlib.Tactic.ClickSuggestions.GrwLemma → ℕ

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

∀ {rootExpr subExpr : Lean.Expr} {rflTarget? : Option Lean.Expr} {gpos : Array Mathlib.Tactic.ClickSuggestions.GrwPos}
  {rwKind : Mathlib.Tactic.ClickSuggestions.RwKind} {rootExpr_1 subExpr_1 : Lean.Expr} {rflTarget?_1 : Option Lean.Expr}
  {gpos_1 : Array Mathlib.Tactic.ClickSuggestions.GrwPos} {rwKind_1 : Mathlib.Tactic.ClickSuggestions.RwKind},
  { rootExpr := rootExpr, subExpr := subExpr, rflTarget? := rflTarget?, gpos := gpos, rwKind := rwKind } =
      { rootExpr := rootExpr_1, subExpr := subExpr_1, rflTarget? := rflTarget?_1, gpos := gpos_1, rwKind := rwKind_1 } →
    rootExpr = rootExpr_1 ∧ subExpr = subExpr_1 ∧ rflTarget? = rflTarget?_1 ∧ gpos = gpos_1 ∧ rwKind = rwKind_1

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

∀ {relName : Lean.Name} {relation : Lean.Expr} {symm? : Option Bool} {relName_1 : Lean.Name} {relation_1 : Lean.Expr}
  {symm?_1 : Option Bool},
  { relName := relName, relation := relation, symm? := symm? } =
      { relName := relName_1, relation := relation_1, symm? := symm?_1 } →
    relName = relName_1 ∧ relation = relation_1 ∧ symm? = symm?_1

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

Mathlib.Tactic.ClickSuggestions.GrwPos → ℕ

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

Mathlib.Tactic.ClickSuggestions.GrwKey

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

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

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

Mathlib.Tactic.ClickSuggestions.GrwInfo → ℕ

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

∀ (relName : Lean.Name) (relation : Lean.Expr) (symm? : Option Bool) (relName_1 : Lean.Name) (relation_1 : Lean.Expr)
  (symm?_1 : Option Bool),
  ({ relName := relName, relation := relation, symm? := symm? } =
      { relName := relName_1, relation := relation_1, symm? := symm?_1 }) =
    (relName = relName_1 ∧ relation = relation_1 ∧ symm? = symm?_1)

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

∀ (rootExpr subExpr : Lean.Expr) (rflTarget? : Option Lean.Expr) (gpos : Array Mathlib.Tactic.ClickSuggestions.GrwPos)
  (rwKind : Mathlib.Tactic.ClickSuggestions.RwKind) (rootExpr_1 subExpr_1 : Lean.Expr) (rflTarget?_1 : Option Lean.Expr)
  (gpos_1 : Array Mathlib.Tactic.ClickSuggestions.GrwPos) (rwKind_1 : Mathlib.Tactic.ClickSuggestions.RwKind),
  ({ rootExpr := rootExpr, subExpr := subExpr, rflTarget? := rflTarget?, gpos := gpos, rwKind := rwKind } =
      { rootExpr := rootExpr_1, subExpr := subExpr_1, rflTarget? := rflTarget?_1, gpos := gpos_1,
        rwKind := rwKind_1 }) =
    (rootExpr = rootExpr_1 ∧ subExpr = subExpr_1 ∧ rflTarget? = rflTarget?_1 ∧ gpos = gpos_1 ∧ rwKind = rwKind_1)

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

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

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

Mathlib.Tactic.ClickSuggestions.GrwKey → ℕ

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

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

structure Mathlib.Tactic.ClickSuggestions.GrwPos E1 #

Type

GRewritePos contains the information about a given subexpression position needed for applying a grw lemma.

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

Lean.Name → Lean.Expr → Option Bool → Mathlib.Tactic.ClickSuggestions.GrwPos

abbrev Mathlib.Tactic.ClickSuggestions.GrwPos.relName E1 #

Mathlib.Tactic.ClickSuggestions.GrwPos → Lean.Name

The name of the relation.

abbrev Mathlib.Tactic.ClickSuggestions.GrwPos.relation E1 #

Mathlib.Tactic.ClickSuggestions.GrwPos → Lean.Expr

The expression of the relation.

abbrev Mathlib.Tactic.ClickSuggestions.GrwPos.symm? E1 #

Mathlib.Tactic.ClickSuggestions.GrwPos → Option Bool

symm is none if the given relations are symmetric. symm is true when you can only rewrite from right to left.

def Mathlib.Tactic.ClickSuggestions.getGrwPos? E1 #

Lean.Expr → Lean.Expr → Lean.SubExpr.Pos → Bool → Lean.MetaM (Array Mathlib.Tactic.ClickSuggestions.GrwPos)

Determine possible ways in which a grw call could rewrite at the given subexpression.

structure Mathlib.Tactic.ClickSuggestions.GrwLemma E1 #

Type

The structure for rewrite lemmas stored in the RefinedDiscrTree.

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

Mathlib.Tactic.ClickSuggestions.Premise → Bool → Lean.Name → Mathlib.Tactic.ClickSuggestions.GrwLemma

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

Mathlib.Tactic.ClickSuggestions.GrwLemma → Mathlib.Tactic.ClickSuggestions.Premise

The lemma

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

Mathlib.Tactic.ClickSuggestions.GrwLemma → Bool

symm is true when rewriting from right to left

abbrev Mathlib.Tactic.ClickSuggestions.GrwLemma.relName E1 #

Mathlib.Tactic.ClickSuggestions.GrwLemma → Lean.Name

relName is the relation of the lemma.

structure Mathlib.Tactic.ClickSuggestions.GrwInfo E1 #

Type

The information needed for doing a grewrite.

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

Lean.Expr →
  Lean.Expr →
    Option Lean.Expr →
      Array Mathlib.Tactic.ClickSuggestions.GrwPos →
        Mathlib.Tactic.ClickSuggestions.RwKind → Mathlib.Tactic.ClickSuggestions.GrwInfo

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

Mathlib.Tactic.ClickSuggestions.GrwInfo → Lean.Expr

The outer expression in which the rewrite takes place.

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

Mathlib.Tactic.ClickSuggestions.GrwInfo → Lean.Expr

The expression that is being rewritten.

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

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

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

abbrev Mathlib.Tactic.ClickSuggestions.GrwInfo.gpos E1 #

Mathlib.Tactic.ClickSuggestions.GrwInfo → Array Mathlib.Tactic.ClickSuggestions.GrwPos

The relations that can be used for rewriting.

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

Mathlib.Tactic.ClickSuggestions.GrwInfo → Mathlib.Tactic.ClickSuggestions.RwKind

Some information about the rewrite position.

structure Mathlib.Tactic.ClickSuggestions.GrwKey E1 #

Type

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

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

ℕ → ℕ → ℕ → String → Lean.Meta.AbstractMVarsResult → Mathlib.Tactic.ClickSuggestions.GrwKey

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

Mathlib.Tactic.ClickSuggestions.GrwKey → ℕ

The number of side goals created.

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

Mathlib.Tactic.ClickSuggestions.GrwKey → ℕ

The name length of the used lemma.

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

Mathlib.Tactic.ClickSuggestions.GrwKey → ℕ

The length of the new subexpression.

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

Mathlib.Tactic.ClickSuggestions.GrwKey → String

The nae of the used lemma.

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

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

The new subexpression.

instance Mathlib.Tactic.ClickSuggestions.instInhabitedGrwKey E0 #

Inhabited Mathlib.Tactic.ClickSuggestions.GrwKey

instance Mathlib.Tactic.ClickSuggestions.instOrdGrwKey E0 #

Ord Mathlib.Tactic.ClickSuggestions.GrwKey

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

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

Whether the two suggestions are duplicates of each other.

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

Mathlib.Tactic.ClickSuggestions.GrwInfo →
  Mathlib.Tactic.ClickSuggestions.GrwLemma →
    Array Lean.Expr →
      Mathlib.Tactic.ClickSuggestions.ClickSuggestionsM
        (Mathlib.Tactic.ClickSuggestions.Result Mathlib.Tactic.ClickSuggestions.GrwKey)

Generate the suggestion for rewriting with lem.