Documentation

Mathlib.Tactic.FunProp.ToBatteries

funProp missing function from standard library #

def Mathlib.Meta.FunProp.isOrderedSubsetOf {ฮฑ : Type u_1} [Inhabited ฮฑ] [DecidableEq ฮฑ] (a b : Array ฮฑ) :
Bool

Check if a can be obtained by removing elements from b.

Instances For
    def Lean.Expr.swapBVars (e : Expr) (i j : โ„•) :
    Expr

    Swaps bvars indices i and j

    NOTE: the indices i and j do not correspond to the n in bvar n. Rather they behave like indices in Expr.lowerLooseBVars, Expr.liftLooseBVars, etc.

    TODO: This has to have a better implementation, but I'm still beyond confused with how bvar indices work

    Instances For
      def Mathlib.Meta.FunProp.mkProdElem (xs : Array Lean.Expr) :
      Lean.MetaM Lean.Expr

      For #[xโ‚, .., xโ‚™] create (xโ‚, .., xโ‚™).

      Instances For
        def Mathlib.Meta.FunProp.mkProdProj (x : Lean.Expr) (i n : โ„•) :
        Lean.MetaM Lean.Expr

        For (xโ‚€, .., xโ‚™โ‚‹โ‚) return xแตข but as a product projection.

        We need to know the total size of the product to be considered.

        For example for xyz : X ร— Y ร— Z

        Instances For
          def Mathlib.Meta.FunProp.mkProdSplitElem (xs : Lean.Expr) (n : โ„•) :
          Lean.MetaM (Array Lean.Expr)

          For an element of a product type (of size n) xs create an array of all possible projections i.e. #[xs.1, xs.2.1, xs.2.2.1, ..., xs.2..2]

          Instances For
            def Mathlib.Meta.FunProp.mkUncurryFun (n : โ„•) (f : Lean.Expr) :
            Lean.MetaM Lean.Expr

            Uncurry function f in n arguments.

            Instances For
              def Mathlib.Meta.FunProp.etaExpand1 (f : Lean.Expr) :
              Lean.MetaM Lean.Expr

              Eta expand f in only one variable and reduce in others.

              Examples:

                f                ==> fun x => f x
                fun x y => f x y ==> fun x => f x
                HAdd.hAdd y      ==> fun x => HAdd.hAdd y x
                HAdd.hAdd        ==> fun x => HAdd.hAdd x
              
              Instances For
                def Mathlib.Meta.FunProp.betaThroughLet (f : Lean.Expr) (args : Array Lean.Expr) :
                Lean.Expr

                Apply the given arguments to f, beta-reducing if f is a lambda expression. This variant does beta-reduction through let bindings without inlining them.

                Example

                beta' (fun x => let y := x * x; fun z => x + y + z) #[a,b]
                ==>
                let y := a * a; a + y + b
                
                Instances For
                  def Mathlib.Meta.FunProp.headBetaThroughLet (e : Lean.Expr) :
                  Lean.Expr

                  Beta reduces head of an expression, (fun x => e) a ==> e[x/a]. This version applies arguments through let bindings without inlining them.

                  Example

                  headBeta' ((fun x => let y := x * x; fun z => x + y + z) a b)
                  ==>
                  let y := a * a; a + y + b
                  
                  Instances For