Documentation

Lean.Meta.Tactic.Simp.Rewrite

Helper type for implementing discharge?'

Instances For
    def Lean.Meta.Simp.discharge?' (thmId : Origin) (x type : Expr) :

    Wrapper for invoking discharge? method. It checks for maximum discharge depth, create trace nodes, and ensure the generated proof was successfully assigned to x.

    Instances For
      Instances For
        Instances For
          def Lean.Meta.Simp.rewrite? (e : Expr) (s : SimpTheoremTree) (erased : PHashSet Origin) (tag : String) (rflOnly : Bool) :

          Remark: the parameter tag is used for creating trace messages. It is irrelevant otherwise.

          Instances For
            @[inline]
            Instances For

              Given a match-application e with MatcherInfo info, return some result if at least of one of the discriminants has been simplified.

              Instances For
                def Lean.Meta.Simp.simpMatchCore (matcherName : Name) (e : Expr) :
                Instances For
                  Instances For
                    Instances For

                      Discharge procedure for the ground/symbolic evaluator.

                      Instances For

                        Try to unfold ground term in the ground/symbolic evaluator.

                        Instances For

                          Invoke ground/symbolic evaluator from simp. It uses the seval theorems and simprocs.

                          Instances For

                            Try to unfold ground term in the ground/symbolic evaluator.

                            Instances For

                              Return true if e is of the form (x : α) → ... → s = t → ... → False

                              Recall that this kind of proposition is generated by Lean when creating equations for functions and match-expressions with overlapping cases. Example: the following match-expression has overlapping cases.

                              def f (x y : Nat) :=
                                match x, y with
                                | Nat.succ n, Nat.succ m => ...
                                | _, _ => 0
                              

                              The second equation is of the form

                              (x y : Nat) → ((n m : Nat) → x = Nat.succ n → y = Nat.succ m → False) → f x y = 0
                              

                              The hypothesis (n m : Nat) → x = Nat.succ n → y = Nat.succ m → False is essentially saying the first case is not applicable.

                              Instances For

                                Tries to solve e using unifyEq?. It assumes that isEqnThmHypothesis e is true.

                                Instances For

                                  Discharges assumptions of the form ∀ …, a = b using rfl. This is particularly useful for higher order assumptions of the form ∀ …, e = ?g x y to instantiate a parameter g even if that does not appear on the lhs of the rule.

                                  Instances For
                                    @[reducible, inline]
                                    Instances For
                                      def Lean.Meta.Simp.mkMethods (s : SimprocsArray) (discharge? : Discharge) (wellBehavedDischarge : Bool) :
                                      Instances For