funProp
#
this file defines environment extension for funProp
Indicated origin of a function or a statement.
- decl
(name : Lean.Name)
: Origin
It is a constant defined in the environment.
- fvar
(fvarId : Lean.FVarId)
: Origin
It is a free variable in the local context.
Equations
Equations
Name of the origin.
Equations
- (Mathlib.Meta.FunProp.Origin.decl name).name = name
- (Mathlib.Meta.FunProp.Origin.fvar id).name = id.name
Get the expression specified by origin
.
Equations
Pretty print FunProp.Origin
.
Equations
- One or more equations did not get rendered due to their size.
- Mathlib.Meta.FunProp.ppOrigin (Mathlib.Meta.FunProp.Origin.fvar id) = pure (Lean.MessageData.ofExpr (Lean.mkFVar id))
Pretty print FunProp.Origin
. Returns string unlike ppOrigin
.
Equations
- One or more equations did not get rendered due to their size.
- Mathlib.Meta.FunProp.ppOrigin' origin = pure (toString origin.name)
Get origin of the head function.
Equations
- One or more equations did not get rendered due to their size.
fun_prop
configuration
- maxTransitionDepth : ℕ
Maximum number of transitions between function properties. For example inferring continuity from differentiability and then differentiability from smoothness (
ContDiff ℝ ∞
) requiresmaxTransitionDepth = 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 smoothenss.Setting
maxTransitionDepth
to zero will disable all transition theorems. This can be very useful whenfun_prop
should fail quickly. For example when usingfun_prop
as discharger insimp
. - maxSteps : ℕ
Maximum number of steps
fun_prop
can take.
Equations
- Mathlib.Meta.FunProp.instInhabitedConfig = { default := { maxTransitionDepth := default, maxSteps := default } }
Equations
fun_prop
context
- config : Config
fun_prop config
- constToUnfold : Std.TreeSet Lean.Name Lean.Name.quickCmp
Name to unfold
- disch : Lean.Expr → Lean.MetaM (Option Lean.Expr)
Custom discharger to satisfy theorem hypotheses.
- transitionDepth : ℕ
current transition depth
fun_prop
state
- cache : 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. - failureCache : Lean.ExprSet
Cache storing failed goals such that they are not tried again.
- numSteps : ℕ
Count the number of steps and stop when maxSteps is reached.
Log progress and failures messages that should be displayed to the user at the end.
Increase depth
Equations
- ctx.increaseTransitionDepth = { config := ctx.config, constToUnfold := ctx.constToUnfold, disch := ctx.disch, transitionDepth := ctx.transitionDepth + 1 }
Monad to run fun_prop
tactic in.
Result of funProp
, it is a proof of function property P f
- proof : Lean.Expr
Default names to unfold
Get predicate on names indicating if theys shoulds be unfolded.
Equations
- Mathlib.Meta.FunProp.unfoldNamePred = do let __do_lift ← read let toUnfold : Std.TreeSet Lean.Name Lean.Name.quickCmp := __do_lift.constToUnfold pure fun (n : Lean.Name) => toUnfold.contains n
Increase heartbeat, throws error when maxSteps
was reached
Equations
- One or more equations did not get rendered due to their size.
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
.
Equations
- One or more equations did not get rendered due to their size.