Documentation

Mathlib.Tactic.Basic

Basic tactics and utilities for tactic writing #

This file defines some basic utilities for tactic writing, and also

Syntax for the variables command: this command is just a stub, and merely warns that it has been renamed to variable in Lean 4.

Equations
  • One or more equations did not get rendered due to their size.
Instances For

    The variables command: this is just a stub, and merely warns that it has been renamed to variable in Lean 4.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For

      Given two arrays of FVarIds, one from an old local context and the other from a new local context, pushes FVarAliasInfos into the info tree for corresponding pairs of FVarIds. Recall that variables linked this way should be considered to be semantically identical.

      The effect of this is, for example, the unused variable linter will see that variables from the first array are used if corresponding variables in the second array are used.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For

        introv introduces the parameters to a dependent function according to their parameter name. If the first parameter is not depended on by the rest of the function type, introv with no (remaining) arguments does nothing.

        • introv h₁ h₂ ... introduces non-depended-on parameters in between sequences of depended-on parameters, using the names h₁, h₂, ... in turn. Use _ to anonymize a specific hypothesis.

        Examples:

        example : ∀ a b : Nat, a = b → b = a := by
          introv h
          /-
          The goal state is:
          a b : ℕ,
          h : a = b
          ⊢ b = a
          -/
          exact h.symm
        
        example : ∀ a b : Nat, a = b → ∀ c, b = c → a = c := by
          introv h₁ h₂
          /-
          The goal state is:
          a b : ℕ,
          h₁ : a = b,
          c : ℕ,
          h₂ : b = c
          ⊢ a = c
          -/
          exact h₁.trans h₂
        
        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          Equations
          • One or more equations did not get rendered due to their size.
          Instances For

            Try calling assumption on all goals; succeeds if it closes at least one goal.

            Equations
            Instances For
              @[deprecated "Use `guard_target =~` instead." (since := "2025-12-11")]

              Deprecated: use guard_target =~ t instead.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For

                This tactic clears all auxiliary declarations from the context.

                Equations
                Instances For

                  Result of withResetServerInfo.

                  Instances For

                    Runs a tactic, returning any new messages and info trees rather than adding them to the state.

                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For