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.FunProp.Types

82 declarations. Mathlib docs · Source

funProp

this file defines environment extension for funProp

theorem Mathlib.Meta.FunProp.GeneralTheorem.mk.inj E1 #

∀ {funPropName thmName : Lean.Name}
  {keys : List (Lean.Meta.RefinedDiscrTree.Key × Lean.Meta.RefinedDiscrTree.LazyEntry)} {priority : ℕ}
  {funPropName_1 thmName_1 : Lean.Name}
  {keys_1 : List (Lean.Meta.RefinedDiscrTree.Key × Lean.Meta.RefinedDiscrTree.LazyEntry)} {priority_1 : ℕ},
  { funPropName := funPropName, thmName := thmName, keys := keys, priority := priority } =
      { funPropName := funPropName_1, thmName := thmName_1, keys := keys_1, priority := priority_1 } →
    funPropName = funPropName_1 ∧ thmName = thmName_1 ∧ keys = keys_1 ∧ priority = priority_1

theorem Mathlib.Meta.FunProp.GeneralTheorems.mk.inj E1 #

∀ {theorems theorems_1 : Lean.Meta.RefinedDiscrTree Mathlib.Meta.FunProp.GeneralTheorem},
  { theorems := theorems } = { theorems := theorems_1 } → theorems = theorems_1

def Mathlib.Meta.FunProp.Context.ctorIdx E1 #

Mathlib.Meta.FunProp.Context → ℕ

def Mathlib.Meta.FunProp.Result.ctorIdx E1 #

Mathlib.Meta.FunProp.Result → ℕ

def Mathlib.Meta.FunProp.State.ctorIdx E1 #

Mathlib.Meta.FunProp.State → ℕ

theorem Mathlib.Meta.FunProp.Origin.fvar.inj E1 #

∀ {fvarId fvarId_1 : Lean.FVarId},
  Mathlib.Meta.FunProp.Origin.fvar fvarId = Mathlib.Meta.FunProp.Origin.fvar fvarId_1 → fvarId = fvarId_1

theorem Mathlib.Meta.FunProp.Config.mk.inj E1 #

∀ {maxTransitionDepth maxSteps maxTransitionDepth_1 maxSteps_1 : ℕ},
  { maxTransitionDepth := maxTransitionDepth, maxSteps := maxSteps } =
      { maxTransitionDepth := maxTransitionDepth_1, maxSteps := maxSteps_1 } →
    maxTransitionDepth = maxTransitionDepth_1 ∧ maxSteps = maxSteps_1

theorem Mathlib.Meta.FunProp.Origin.decl.injEq E0 #

∀ (name name_1 : Lean.Name),
  (Mathlib.Meta.FunProp.Origin.decl name = Mathlib.Meta.FunProp.Origin.decl name_1) = (name = name_1)

theorem Mathlib.Meta.FunProp.Context.mk.injEq E0 #

∀ (config : Mathlib.Meta.FunProp.Config) (constToUnfold : Std.TreeSet Lean.Name Lean.Name.quickCmp)
  (disch : Lean.Expr → Lean.MetaM (Option Lean.Expr)) (transitionDepth : ℕ) (config_1 : Mathlib.Meta.FunProp.Config)
  (constToUnfold_1 : Std.TreeSet Lean.Name Lean.Name.quickCmp) (disch_1 : Lean.Expr → Lean.MetaM (Option Lean.Expr))
  (transitionDepth_1 : ℕ),
  ({ config := config, constToUnfold := constToUnfold, disch := disch, transitionDepth := transitionDepth } =
      { config := config_1, constToUnfold := constToUnfold_1, disch := disch_1,
        transitionDepth := transitionDepth_1 }) =
    (config = config_1 ∧ constToUnfold = constToUnfold_1 ∧ disch = disch_1 ∧ transitionDepth = transitionDepth_1)

abbrev Mathlib.Meta.FunProp.Origin.ctorElimType E1 #

{motive : Mathlib.Meta.FunProp.Origin → Sort u} → ℕ → Sort (max 1 u)

theorem Mathlib.Meta.FunProp.Result.mk.inj E1 #

∀ {proof proof_1 : Lean.Expr}, { proof := proof } = { proof := proof_1 } → proof = proof_1

theorem Mathlib.Meta.FunProp.Result.mk.injEq E0 #

∀ (proof proof_1 : Lean.Expr), ({ proof := proof } = { proof := proof_1 }) = (proof = proof_1)

theorem Mathlib.Meta.FunProp.Origin.decl.inj E1 #

∀ {name name_1 : Lean.Name},
  Mathlib.Meta.FunProp.Origin.decl name = Mathlib.Meta.FunProp.Origin.decl name_1 → name = name_1

theorem Mathlib.Meta.FunProp.GeneralTheorems.mk.injEq E0 #

∀ (theorems theorems_1 : Lean.Meta.RefinedDiscrTree Mathlib.Meta.FunProp.GeneralTheorem),
  ({ theorems := theorems } = { theorems := theorems_1 }) = (theorems = theorems_1)

def Mathlib.Meta.FunProp.instInhabitedGeneralTheorems.default E1 #

Mathlib.Meta.FunProp.GeneralTheorems

def Mathlib.Meta.FunProp.GeneralTheorems.ctorIdx E1 #

Mathlib.Meta.FunProp.GeneralTheorems → ℕ

theorem Mathlib.Meta.FunProp.State.mk.inj E1 #

∀ {cache : Lean.Meta.Simp.Cache} {failureCache : Lean.ExprSet} {numSteps : ℕ} {msgLog : List String}
  {morTheorems transitionTheorems : Mathlib.Meta.FunProp.GeneralTheorems} {cache_1 : Lean.Meta.Simp.Cache}
  {failureCache_1 : Lean.ExprSet} {numSteps_1 : ℕ} {msgLog_1 : List String}
  {morTheorems_1 transitionTheorems_1 : Mathlib.Meta.FunProp.GeneralTheorems},
  { cache := cache, failureCache := failureCache, numSteps := numSteps, msgLog := msgLog, morTheorems := morTheorems,
        transitionTheorems := transitionTheorems } =
      { cache := cache_1, failureCache := failureCache_1, numSteps := numSteps_1, msgLog := msgLog_1,
        morTheorems := morTheorems_1, transitionTheorems := transitionTheorems_1 } →
    cache = cache_1 ∧
      failureCache = failureCache_1 ∧
        numSteps = numSteps_1 ∧
          msgLog = msgLog_1 ∧ morTheorems = morTheorems_1 ∧ transitionTheorems = transitionTheorems_1

def Mathlib.Meta.FunProp.instInhabitedGeneralTheorem.default E1 #

Mathlib.Meta.FunProp.GeneralTheorem

theorem Mathlib.Meta.FunProp.Config.mk.injEq E0 #

∀ (maxTransitionDepth maxSteps maxTransitionDepth_1 maxSteps_1 : ℕ),
  ({ maxTransitionDepth := maxTransitionDepth, maxSteps := maxSteps } =
      { maxTransitionDepth := maxTransitionDepth_1, maxSteps := maxSteps_1 }) =
    (maxTransitionDepth = maxTransitionDepth_1 ∧ maxSteps = maxSteps_1)

theorem Mathlib.Meta.FunProp.Context.mk.inj E1 #

∀ {config : Mathlib.Meta.FunProp.Config} {constToUnfold : Std.TreeSet Lean.Name Lean.Name.quickCmp}
  {disch : Lean.Expr → Lean.MetaM (Option Lean.Expr)} {transitionDepth : ℕ} {config_1 : Mathlib.Meta.FunProp.Config}
  {constToUnfold_1 : Std.TreeSet Lean.Name Lean.Name.quickCmp} {disch_1 : Lean.Expr → Lean.MetaM (Option Lean.Expr)}
  {transitionDepth_1 : ℕ},
  { config := config, constToUnfold := constToUnfold, disch := disch, transitionDepth := transitionDepth } =
      { config := config_1, constToUnfold := constToUnfold_1, disch := disch_1, transitionDepth := transitionDepth_1 } →
    config = config_1 ∧ constToUnfold = constToUnfold_1 ∧ disch = disch_1 ∧ transitionDepth = transitionDepth_1

def Mathlib.Meta.FunProp.GeneralTheorem.ctorIdx E1 #

Mathlib.Meta.FunProp.GeneralTheorem → ℕ

def Mathlib.Meta.FunProp.Config.ctorIdx E1 #

Mathlib.Meta.FunProp.Config → ℕ

theorem Mathlib.Meta.FunProp.State.mk.injEq E0 #

∀ (cache : Lean.Meta.Simp.Cache) (failureCache : Lean.ExprSet) (numSteps : ℕ) (msgLog : List String)
  (morTheorems transitionTheorems : Mathlib.Meta.FunProp.GeneralTheorems) (cache_1 : Lean.Meta.Simp.Cache)
  (failureCache_1 : Lean.ExprSet) (numSteps_1 : ℕ) (msgLog_1 : List String)
  (morTheorems_1 transitionTheorems_1 : Mathlib.Meta.FunProp.GeneralTheorems),
  ({ cache := cache, failureCache := failureCache, numSteps := numSteps, msgLog := msgLog, morTheorems := morTheorems,
        transitionTheorems := transitionTheorems } =
      { cache := cache_1, failureCache := failureCache_1, numSteps := numSteps_1, msgLog := msgLog_1,
        morTheorems := morTheorems_1, transitionTheorems := transitionTheorems_1 }) =
    (cache = cache_1 ∧
      failureCache = failureCache_1 ∧
        numSteps = numSteps_1 ∧
          msgLog = msgLog_1 ∧ morTheorems = morTheorems_1 ∧ transitionTheorems = transitionTheorems_1)

theorem Mathlib.Meta.FunProp.GeneralTheorem.mk.injEq E0 #

∀ (funPropName thmName : Lean.Name)
  (keys : List (Lean.Meta.RefinedDiscrTree.Key × Lean.Meta.RefinedDiscrTree.LazyEntry)) (priority : ℕ)
  (funPropName_1 thmName_1 : Lean.Name)
  (keys_1 : List (Lean.Meta.RefinedDiscrTree.Key × Lean.Meta.RefinedDiscrTree.LazyEntry)) (priority_1 : ℕ),
  ({ funPropName := funPropName, thmName := thmName, keys := keys, priority := priority } =
      { funPropName := funPropName_1, thmName := thmName_1, keys := keys_1, priority := priority_1 }) =
    (funPropName = funPropName_1 ∧ thmName = thmName_1 ∧ keys = keys_1 ∧ priority = priority_1)

def Mathlib.Meta.FunProp.instInhabitedConfig.default E1 #

Mathlib.Meta.FunProp.Config

def Mathlib.Meta.FunProp.instInhabitedOrigin.default E1 #

Mathlib.Meta.FunProp.Origin

theorem Mathlib.Meta.FunProp.Origin.fvar.injEq E0 #

∀ (fvarId fvarId_1 : Lean.FVarId),
  (Mathlib.Meta.FunProp.Origin.fvar fvarId = Mathlib.Meta.FunProp.Origin.fvar fvarId_1) = (fvarId = fvarId_1)

def Mathlib.Meta.FunProp.Origin.ctorIdx E1 #

Mathlib.Meta.FunProp.Origin → ℕ

inductive Mathlib.Meta.FunProp.Origin E1 #

Type

Indicated origin of a function or a statement.

ctor Mathlib.Meta.FunProp.Origin.decl E0 #

Lean.Name → Mathlib.Meta.FunProp.Origin

It is a constant defined in the environment.

ctor Mathlib.Meta.FunProp.Origin.fvar E0 #

Lean.FVarId → Mathlib.Meta.FunProp.Origin

It is a free variable in the local context.

instance Mathlib.Meta.FunProp.instInhabitedOrigin E0 #

Inhabited Mathlib.Meta.FunProp.Origin

instance Mathlib.Meta.FunProp.instBEqOrigin E0 #

BEq Mathlib.Meta.FunProp.Origin

def Mathlib.Meta.FunProp.instBEqOrigin.beq E1 #

Mathlib.Meta.FunProp.Origin → Mathlib.Meta.FunProp.Origin → Bool

def Mathlib.Meta.FunProp.Origin.name E1 #

Mathlib.Meta.FunProp.Origin → Lean.Name

Name of the origin.

def Mathlib.Meta.FunProp.Origin.getValue E1 #

Mathlib.Meta.FunProp.Origin → Lean.MetaM Lean.Expr

Get the expression specified by origin.

def Mathlib.Meta.FunProp.ppOrigin E1 #

{m : Type → Type} →
  [Monad m] → [Lean.MonadEnv m] → [Lean.MonadError m] → Mathlib.Meta.FunProp.Origin → m Lean.MessageData

Pretty print FunProp.Origin.

def Mathlib.Meta.FunProp.ppOrigin' E1 #

Mathlib.Meta.FunProp.Origin → Lean.MetaM String

Pretty print FunProp.Origin. Returns string unlike ppOrigin.

def Mathlib.Meta.FunProp.FunctionData.getFnOrigin E1 #

Mathlib.Meta.FunProp.FunctionData → Mathlib.Meta.FunProp.Origin

Get origin of the head function.

def Mathlib.Meta.FunProp.defaultNamesToUnfold E1 #

Array Lean.Name

Default names to be considered reducible by fun_prop

structure Mathlib.Meta.FunProp.Config E1 #

Type

fun_prop configuration

ctor Mathlib.Meta.FunProp.Config.mk E0 #

ℕ → ℕ → Mathlib.Meta.FunProp.Config

abbrev Mathlib.Meta.FunProp.Config.maxTransitionDepth E1 #

Mathlib.Meta.FunProp.Config → ℕ

Maximum number of transitions between function properties. For example inferring continuity from differentiability and then differentiability from smoothness (ContDiff ℝ ∞) requires maxTransitionDepth = 2. The default value of one expects that transition theorems are transitively closed e.g. there is a transition theorem that infers continuity directly from smoothness.

Setting maxTransitionDepth to zero will disable all transition theorems. This can be very useful when fun_prop should fail quickly. For example when using fun_prop as discharger in simp.

abbrev Mathlib.Meta.FunProp.Config.maxSteps E1 #

Mathlib.Meta.FunProp.Config → ℕ

Maximum number of steps fun_prop can take.

instance Mathlib.Meta.FunProp.instInhabitedConfig E0 #

Inhabited Mathlib.Meta.FunProp.Config

instance Mathlib.Meta.FunProp.instBEqConfig E0 #

BEq Mathlib.Meta.FunProp.Config

def Mathlib.Meta.FunProp.instBEqConfig.beq E1 #

Mathlib.Meta.FunProp.Config → Mathlib.Meta.FunProp.Config → Bool

structure Mathlib.Meta.FunProp.Context E1 #

Type

fun_prop context

ctor Mathlib.Meta.FunProp.Context.mk E0 #

Mathlib.Meta.FunProp.Config →
  Std.TreeSet Lean.Name Lean.Name.quickCmp →
    (Lean.Expr → Lean.MetaM (Option Lean.Expr)) → ℕ → Mathlib.Meta.FunProp.Context

abbrev Mathlib.Meta.FunProp.Context.config E1 #

Mathlib.Meta.FunProp.Context → Mathlib.Meta.FunProp.Config

fun_prop config

abbrev Mathlib.Meta.FunProp.Context.constToUnfold E1 #

Mathlib.Meta.FunProp.Context → Std.TreeSet Lean.Name Lean.Name.quickCmp

Name to unfold

abbrev Mathlib.Meta.FunProp.Context.disch E1 #

Mathlib.Meta.FunProp.Context → Lean.Expr → Lean.MetaM (Option Lean.Expr)

Custom discharger to satisfy theorem hypotheses.

abbrev Mathlib.Meta.FunProp.Context.transitionDepth E1 #

Mathlib.Meta.FunProp.Context → ℕ

current transition depth

structure Mathlib.Meta.FunProp.GeneralTheorem E1 #

Type

General theorem about a function property used for transition and morphism theorems

ctor Mathlib.Meta.FunProp.GeneralTheorem.mk E0 #

Lean.Name →
  Lean.Name →
    List (Lean.Meta.RefinedDiscrTree.Key × Lean.Meta.RefinedDiscrTree.LazyEntry) →
      ℕ → Mathlib.Meta.FunProp.GeneralTheorem

abbrev Mathlib.Meta.FunProp.GeneralTheorem.funPropName E1 #

Mathlib.Meta.FunProp.GeneralTheorem → Lean.Name

function property name

abbrev Mathlib.Meta.FunProp.GeneralTheorem.thmName E1 #

Mathlib.Meta.FunProp.GeneralTheorem → Lean.Name

theorem name

abbrev Mathlib.Meta.FunProp.GeneralTheorem.keys E1 #

Mathlib.Meta.FunProp.GeneralTheorem → List (Lean.Meta.RefinedDiscrTree.Key × Lean.Meta.RefinedDiscrTree.LazyEntry)

discrimination tree keys used to index this theorem

abbrev Mathlib.Meta.FunProp.GeneralTheorem.priority E1 #

Mathlib.Meta.FunProp.GeneralTheorem → ℕ

priority

instance Mathlib.Meta.FunProp.instInhabitedGeneralTheorem E0 #

Inhabited Mathlib.Meta.FunProp.GeneralTheorem

structure Mathlib.Meta.FunProp.GeneralTheorems E1 #

Type

Structure holding transition or morphism theorems for fun_prop tactic.

ctor Mathlib.Meta.FunProp.GeneralTheorems.mk E0 #

Lean.Meta.RefinedDiscrTree Mathlib.Meta.FunProp.GeneralTheorem → Mathlib.Meta.FunProp.GeneralTheorems

abbrev Mathlib.Meta.FunProp.GeneralTheorems.theorems E1 #

Mathlib.Meta.FunProp.GeneralTheorems → Lean.Meta.RefinedDiscrTree Mathlib.Meta.FunProp.GeneralTheorem

Discrimination tree indexing theorems.

instance Mathlib.Meta.FunProp.instInhabitedGeneralTheorems E0 #

Inhabited Mathlib.Meta.FunProp.GeneralTheorems

structure Mathlib.Meta.FunProp.State E1 #

Type

fun_prop state

ctor Mathlib.Meta.FunProp.State.mk E0 #

Lean.Meta.Simp.Cache →
  Lean.ExprSet →
    ℕ →
      List String →
        Mathlib.Meta.FunProp.GeneralTheorems → Mathlib.Meta.FunProp.GeneralTheorems → Mathlib.Meta.FunProp.State

abbrev Mathlib.Meta.FunProp.State.cache E1 #

Mathlib.Meta.FunProp.State → Lean.Meta.Simp.Cache

Simp's cache is used as the fun_prop tactic is designed to be used inside of simp and utilize its cache. It holds successful goals.

abbrev Mathlib.Meta.FunProp.State.failureCache E1 #

Mathlib.Meta.FunProp.State → Lean.ExprSet

Cache storing failed goals such that they are not tried again.

abbrev Mathlib.Meta.FunProp.State.numSteps E1 #

Mathlib.Meta.FunProp.State → ℕ

Count the number of steps and stop when maxSteps is reached.

abbrev Mathlib.Meta.FunProp.State.msgLog E1 #

Mathlib.Meta.FunProp.State → List String

Log progress and failures messages that should be displayed to the user at the end.

abbrev Mathlib.Meta.FunProp.State.morTheorems E1 #

Mathlib.Meta.FunProp.State → Mathlib.Meta.FunProp.GeneralTheorems

RefinedDiscrTree is lazy, so we store the partially evaluated tree.

abbrev Mathlib.Meta.FunProp.State.transitionTheorems E1 #

Mathlib.Meta.FunProp.State → Mathlib.Meta.FunProp.GeneralTheorems

RefinedDiscrTree is lazy, so we store the partially evaluated tree.

def Mathlib.Meta.FunProp.Context.increaseTransitionDepth E1 #

Mathlib.Meta.FunProp.Context → Mathlib.Meta.FunProp.Context

Increase depth

abbrev Mathlib.Meta.FunProp.FunPropM E1 #

Type → Type

Monad to run fun_prop tactic in.

structure Mathlib.Meta.FunProp.Result E1 #

Type

Result of funProp, it is a proof of function property P f

ctor Mathlib.Meta.FunProp.Result.mk E0 #

Lean.Expr → Mathlib.Meta.FunProp.Result

abbrev Mathlib.Meta.FunProp.Result.proof E1 #

Mathlib.Meta.FunProp.Result → Lean.Expr

def Mathlib.Meta.FunProp.unfoldPred E1 #

optParam Lean.NameSet (Lean.NameSet.ofArray Mathlib.Meta.FunProp.defaultNamesToUnfold) →
  Lean.Meta.Config → Lean.ConstantInfo → Lean.CoreM Bool

Predicate for unfolding the constants that are considered reducible by fun_prop.

def Mathlib.Meta.FunProp.getUnfoldPred E1 #

Mathlib.Meta.FunProp.FunPropM (Lean.Meta.Config → Lean.ConstantInfo → Lean.CoreM Bool)

Returns an unfolding predicate that also unfolds constants given with the fun_prop [c] syntax.

def Mathlib.Meta.FunProp.increaseSteps E1 #

Mathlib.Meta.FunProp.FunPropM Unit

Increase heartbeat, throws error when maxSteps was reached

def Mathlib.Meta.FunProp.withIncreasedTransitionDepth E1 #

{α : Type} → Mathlib.Meta.FunProp.FunPropM (Option α) → Mathlib.Meta.FunProp.FunPropM (Option α)

Increase transition depth. Return none if maximum transition depth has been reached.

def Mathlib.Meta.FunProp.logError E1 #

String → Mathlib.Meta.FunProp.FunPropM Unit

Log error message that will displayed to the user at the end.

Messages are logged only when transitionDepth = 0 i.e. when fun_prop is not trying to infer function property like continuity from another property like differentiability. The main reason is that if the user forgets to add a continuity theorem for function foo then fun_prop should report that there is a continuity theorem for foo missing. If we would log messages transitionDepth > 0 then user will see messages saying that there is a missing theorem for differentiability, smoothness, ... for foo.