Documentation

Lean.Meta.Tactic.Apply

Compute the number of expected arguments and whether the result type is of the form (?m ...) where ?m is an unassigned metavariable.

Instances For
    def Lean.Meta.synthAppInstances (tacticName : Name) (mvarId : MVarId) (mvarsNew : Array Expr) (binderInfos : Array BinderInfo) (synthAssignedInstances allowSynthFailures : Bool) :
    Instances For
      def Lean.Meta.appendParentTag (mvarId : MVarId) (newMVars : Array Expr) (binderInfos : Array BinderInfo) :
      Instances For
        def Lean.Meta.postprocessAppMVars (tacticName : Name) (mvarId : MVarId) (newMVars : Array Expr) (binderInfos : Array BinderInfo) (synthAssignedInstances : Bool := true) (allowSynthFailures : Bool := false) :

        If synthAssignedInstances is true, then apply will synthesize instance implicit arguments even if they have assigned by isDefEq, and then check whether the synthesized value matches the one inferred. The congr tactic sets this flag to false.

        Instances For
          def Lean.MVarId.apply (mvarId : MVarId) (e : Expr) (cfg : Meta.ApplyConfig := { }) (term? : Option MessageData := none) :

          Close the given goal using apply e.

          Instances For

            Short-hand for applying a constant to the goal.

            Instances For
              def Lean.MVarId.applyN (mvarId : MVarId) (e : Expr) (n : Nat) (useApproxDefEq : Bool := true) :

              Close the given goal using e, instantiated with n metavariables.

              Instances For
                Instances For
                  @[reducible, inline]

                  Apply And.intro as much as possible to goal mvarId.

                  Instances For
                    Instances For
                      def Lean.MVarId.nthConstructor (name : Name) (idx : Nat) (expected? : Option Nat := none) (goal : MVarId) :

                      Apply the n-th constructor of the target type, checking that it is an inductive type, and that there are the expected number of constructors.

                      Instances For

                        Try to convert an Iff into an Eq by applying iff_of_eq. If successful, returns the new goal, and otherwise returns the original MVarId.

                        This may be regarded as being a special case of Lean.MVarId.liftReflToEq, specifically for Iff.

                        Instances For

                          Try to convert an Eq into an Iff by applying propext. If successful, then returns then new goal, otherwise returns the original MVarId.

                          Instances For

                            Try to close the goal using proof_irrel_heq. Returns whether or not it succeeds.

                            We need to be somewhat careful not to assign metavariables while doing this, otherwise we might specialize Sort _ to Prop.

                            Instances For

                              Try to close the goal using Subsingleton.elim. Returns whether or not it succeeds.

                              We are careful to apply Subsingleton.elim in a way that does not assign any metavariables. This is to prevent the Subsingleton Prop instance from being used as justification to specialize Sort _ to Prop.

                              Instances For