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

31 declarations. Mathlib docs · Source

Infrastructure for searching and displaying sets of lemmas

This is used for apply, apply at, rw and grw suggestions.

Maintaining the state of the widget

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

∀ {α : Type} (results : Array (Mathlib.Tactic.ClickSuggestions.Result α)) (errors : Array ProofWidgets.Html)
  (results_1 : Array (Mathlib.Tactic.ClickSuggestions.Result α)) (errors_1 : Array ProofWidgets.Html),
  ({ results := results, errors := errors } = { results := results_1, errors := errors_1 }) =
    (results = results_1 ∧ errors = errors_1)

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

∀ {α : Type} {filtered : Option ProofWidgets.Html} {unfiltered : ProofWidgets.Html} {key : α}
  {pattern : ProofWidgets.Html} {filtered_1 : Option ProofWidgets.Html} {unfiltered_1 : ProofWidgets.Html} {key_1 : α}
  {pattern_1 : ProofWidgets.Html},
  { filtered := filtered, unfiltered := unfiltered, key := key, pattern := pattern } =
      { filtered := filtered_1, unfiltered := unfiltered_1, key := key_1, pattern := pattern_1 } →
    filtered = filtered_1 ∧ unfiltered = unfiltered_1 ∧ key = key_1 ∧ pattern = pattern_1

abbrev Mathlib.Tactic.ClickSuggestions.SectionKind.ctorElimType E1 #

{motive : Mathlib.Tactic.ClickSuggestions.SectionKind → Sort u} → ℕ → Sort (max 1 u)

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

∀ {α : Type} (filtered : Option ProofWidgets.Html) (unfiltered : ProofWidgets.Html) (key : α)
  (pattern : ProofWidgets.Html) (filtered_1 : Option ProofWidgets.Html) (unfiltered_1 : ProofWidgets.Html) (key_1 : α)
  (pattern_1 : ProofWidgets.Html),
  ({ filtered := filtered, unfiltered := unfiltered, key := key, pattern := pattern } =
      { filtered := filtered_1, unfiltered := unfiltered_1, key := key_1, pattern := pattern_1 }) =
    (filtered = filtered_1 ∧ unfiltered = unfiltered_1 ∧ key = key_1 ∧ pattern = pattern_1)

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

∀ {α : Type} {results : Array (Mathlib.Tactic.ClickSuggestions.Result α)} {errors : Array ProofWidgets.Html}
  {results_1 : Array (Mathlib.Tactic.ClickSuggestions.Result α)} {errors_1 : Array ProofWidgets.Html},
  { results := results, errors := errors } = { results := results_1, errors := errors_1 } →
    results = results_1 ∧ errors = errors_1

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

{α : Type} → [Inhabited α] → Mathlib.Tactic.ClickSuggestions.Result α

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

{α : Type} → Mathlib.Tactic.ClickSuggestions.SectionState α → ℕ

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

{α : Type} → Mathlib.Tactic.ClickSuggestions.Result α → ℕ

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

Mathlib.Tactic.ClickSuggestions.SectionKind → ℕ

structure Mathlib.Tactic.ClickSuggestions.Result E1 #

Type → Type

Result stores the information from a lemma that was successfully applied.

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

{α : Type} →
  Option ProofWidgets.Html → ProofWidgets.Html → α → ProofWidgets.Html → Mathlib.Tactic.ClickSuggestions.Result α

abbrev Mathlib.Tactic.ClickSuggestions.Result.filtered E1 #

{α : Type} → Mathlib.Tactic.ClickSuggestions.Result α → Option ProofWidgets.Html

filtered will be shown in the filtered view.

abbrev Mathlib.Tactic.ClickSuggestions.Result.unfiltered E1 #

{α : Type} → Mathlib.Tactic.ClickSuggestions.Result α → ProofWidgets.Html

unfiltered will be shown in the unfiltered view.

abbrev Mathlib.Tactic.ClickSuggestions.Result.key E1 #

{α : Type} → Mathlib.Tactic.ClickSuggestions.Result α → α

key is used for sorting and comparing theorems.

abbrev Mathlib.Tactic.ClickSuggestions.Result.pattern E1 #

{α : Type} → Mathlib.Tactic.ClickSuggestions.Result α → ProofWidgets.Html

The pattern of the first lemma in a section is shown as the header of that section.

instance Mathlib.Tactic.ClickSuggestions.instInhabitedResult E0 #

{a : Type} → [Inhabited a] → Inhabited (Mathlib.Tactic.ClickSuggestions.Result a)

instance Mathlib.Tactic.ClickSuggestions.instOrdResult E0 #

{α : Type} → [Ord α] → Ord (Mathlib.Tactic.ClickSuggestions.Result α)

instance Mathlib.Tactic.ClickSuggestions.instLTResult E0 #

{α : Type} → [Ord α] → LT (Mathlib.Tactic.ClickSuggestions.Result α)

structure Mathlib.Tactic.ClickSuggestions.SectionState E1 #

Type → Type

The state of one section of library search suggestions. We use this for 4 kinds of suggestions: rw, grw, apply and apply at.

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

{α : Type} →
  Array (Mathlib.Tactic.ClickSuggestions.Result α) →
    Array ProofWidgets.Html → Mathlib.Tactic.ClickSuggestions.SectionState α

abbrev Mathlib.Tactic.ClickSuggestions.SectionState.results E1 #

{α : Type} → Mathlib.Tactic.ClickSuggestions.SectionState α → Array (Mathlib.Tactic.ClickSuggestions.Result α)

The results of the theorems that successfully applied.

abbrev Mathlib.Tactic.ClickSuggestions.SectionState.errors E1 #

{α : Type} → Mathlib.Tactic.ClickSuggestions.SectionState α → Array ProofWidgets.Html

The results of the theorems that threw an error when trying to apply them. Usually, errors will be caught, except for when using click_suggestions.debug.

instance Mathlib.Tactic.ClickSuggestions.instNonemptySectionState E0 #

∀ {α : Type}, Nonempty (Mathlib.Tactic.ClickSuggestions.SectionState α)

def Mathlib.Tactic.ClickSuggestions.Result.insertInArray E1 #

{α : Type} →
  [Ord α] →
    [Inhabited α] →
      Mathlib.Tactic.ClickSuggestions.Result α →
        Array (Mathlib.Tactic.ClickSuggestions.Result α) →
          (α → α → Lean.MetaM Bool) → Lean.MetaM (Array (Mathlib.Tactic.ClickSuggestions.Result α))

Insert the new result res into the array arr of already existing results.

We maintain the invariants that results is sorted, and for each set of duplicate results, only the first one can have the filtered field set to some.

def Mathlib.Tactic.ClickSuggestions.SectionState.insertResult E1 #

{α : Type} →
  [Ord α] →
    [Inhabited α] →
      Mathlib.Tactic.ClickSuggestions.SectionState α →
        Mathlib.Tactic.ClickSuggestions.Result α →
          (α → α → Lean.MetaM Bool) → Lean.MetaM (Mathlib.Tactic.ClickSuggestions.SectionState α)

Insert res into the section state s.

inductive Mathlib.Tactic.ClickSuggestions.SectionKind E1 #

Type

Whether the section corresponds to local hypotheses, declarations from the current file, or imported declarations.

ctor Mathlib.Tactic.ClickSuggestions.SectionKind.currFile E0 #

Mathlib.Tactic.ClickSuggestions.SectionKind

ctor Mathlib.Tactic.ClickSuggestions.SectionKind.hyp E0 #

Mathlib.Tactic.ClickSuggestions.SectionKind

ctor Mathlib.Tactic.ClickSuggestions.SectionKind.imported E0 #

Mathlib.Tactic.ClickSuggestions.SectionKind

def Mathlib.Tactic.ClickSuggestions.renderSection E1 #

{α : Type} →
  Mathlib.Tactic.ClickSuggestions.SectionKind → Mathlib.Tactic.ClickSuggestions.SectionState α → ProofWidgets.Html

Create the HTML corresponding to s.

def Mathlib.Tactic.ClickSuggestions.spawnTask E1 #

{α : Type} →
  Mathlib.Tactic.ClickSuggestions.Premise →
    Mathlib.Tactic.ClickSuggestions.ClickSuggestionsM α →
      Mathlib.Tactic.ClickSuggestions.ClickSuggestionsM (Task (Except ProofWidgets.Html (Option α)))

Spawn a task that computes a piece of Html to be displayed when finished.