Documentation

Mathlib.Tactic.FunProp.Types

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.

Instances For
    @[implicit_reducible]
    def Mathlib.Meta.FunProp.Origin.name (origin : Origin) :
    Lean.Name

    Name of the origin.

    Instances For
      def Mathlib.Meta.FunProp.Origin.getValue (origin : Origin) :
      Lean.MetaM Lean.Expr

      Get the expression specified by origin.

      Instances For
        def Mathlib.Meta.FunProp.ppOrigin {m : TypeType} [Monad m] [Lean.MonadEnv m] [Lean.MonadError m] :
        Originm Lean.MessageData

        Pretty print FunProp.Origin.

        Instances For
          def Mathlib.Meta.FunProp.ppOrigin' (origin : Origin) :
          Lean.MetaM String

          Pretty print FunProp.Origin. Returns string unlike ppOrigin.

          Instances For

            Get origin of the head function.

            Instances For

              Default names to be considered reducible by fun_prop

              Instances For

                fun_prop configuration

                • maxTransitionDepth :

                  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.

                • maxSteps :

                  Maximum number of steps fun_prop can take.

                Instances For
                  @[implicit_reducible]

                  fun_prop context

                  • config : Config

                    fun_prop config

                  • constToUnfold : Std.TreeSet Lean.Name Lean.Name.quickCmp

                    Name to unfold

                  • disch : Lean.ExprLean.MetaM (Option Lean.Expr)

                    Custom discharger to satisfy theorem hypotheses.

                  • transitionDepth :

                    current transition depth

                  Instances For

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

                    Instances For

                      Structure holding transition or morphism theorems for fun_prop tactic.

                      Instances For

                        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.

                        • msgLog : List String

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

                        • morTheorems : GeneralTheorems

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

                        • transitionTheorems : GeneralTheorems

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

                        Instances For
                          @[reducible, inline]

                          Monad to run fun_prop tactic in.

                          Instances For

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

                            • proof : Lean.Expr
                            Instances For

                              Default names to unfold

                              Instances For

                                Get predicate on names indicating whether they should be unfolded.

                                Instances For

                                  Increase heartbeat, throws error when maxSteps was reached

                                  Instances For
                                    def Mathlib.Meta.FunProp.withIncreasedTransitionDepth {α : Type} (go : FunPropM (Option α)) :
                                    FunPropM (Option α)

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

                                    Instances For
                                      def Mathlib.Meta.FunProp.logError (msg : String) :

                                      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.

                                      Instances For