Documentation

Lean.Meta.Tactic.Simp.Main

Return true if e is of the form ofNat n where n is a kernel Nat literal

Equations
Instances For

    If e is a raw Nat literal and OfNat.ofNat is not in the list of declarations to unfold, return an OfNat.ofNat-application.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For

      Return true if e is of the form ofScientific n b m where n and m are kernel Nat literals.

      Equations
      Instances For

        Return true if e is of the form Char.ofNat n where n is a kernel Nat literals.

        Equations
        Instances For
          Equations
          • One or more equations did not get rendered due to their size.
          partial def Lean.Meta.Simp.lambdaTelescopeDSimp.go {α : Type} (k : Array ExprExprSimpM α) (xs : Array Expr) (e : Expr) :
          Instances For
            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              def Lean.Meta.Simp.withNewLemmas {α : Type} (xs : Array Expr) (f : SimpM α) :

              We use withNewlemmas whenever updating the local context.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                Equations
                • One or more equations did not get rendered due to their size.
                Instances For
                  Equations
                  Instances For
                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For
                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For
                        Equations
                        • One or more equations did not get rendered due to their size.
                        Instances For
                          Equations
                          Instances For
                            Equations
                            • One or more equations did not get rendered due to their size.
                            Instances For
                              Equations
                              • One or more equations did not get rendered due to their size.
                              Instances For

                                Process the given congruence theorem hypothesis. Return true if it made "progress".

                                Equations
                                • One or more equations did not get rendered due to their size.
                                Instances For

                                  Try to rewrite e children using the given congruence theorem

                                  Equations
                                  • One or more equations did not get rendered due to their size.
                                  Instances For
                                    Equations
                                    • One or more equations did not get rendered due to their size.
                                    Instances For

                                      Returns true if e is of the form @letFun _ (fun _ => β) _ _

                                      β must not contain loose bound variables. Recall that simp does not have support for let_funs where resulting type depends on the let-value. Example:

                                      let_fun n := 10;
                                      BitVec.zero n
                                      
                                      Equations
                                      • One or more equations did not get rendered due to their size.
                                      Instances For

                                        Simplifies a sequence of let_fun declarations. It attempts to minimize the quadratic overhead imposed by the locally nameless discipline.

                                        Equations
                                        • One or more equations did not get rendered due to their size.
                                        Instances For
                                          Equations
                                          • One or more equations did not get rendered due to their size.
                                          Instances For
                                            Equations
                                            Instances For
                                              Equations
                                              • One or more equations did not get rendered due to their size.
                                              Instances For
                                                @[export lean_simp]
                                                Equations
                                                • One or more equations did not get rendered due to their size.
                                                Instances For
                                                  Equations
                                                  • One or more equations did not get rendered due to their size.
                                                  Instances For
                                                    def Lean.Meta.Simp.main (e : Expr) (ctx : Context) (stats : Stats := { usedTheorems := { map := { root := PersistentHashMap.Node.entries PersistentHashMap.mkEmptyEntriesArray }, size := 0 }, diag := { usedThmCounter := { root := PersistentHashMap.Node.entries PersistentHashMap.mkEmptyEntriesArray }, triedThmCounter := { root := PersistentHashMap.Node.entries PersistentHashMap.mkEmptyEntriesArray }, congrThmCounter := { root := PersistentHashMap.Node.entries PersistentHashMap.mkEmptyEntriesArray }, thmsWithBadKeys := { root := PersistentArrayNode.node (Array.mkEmpty PersistentArray.branching.toNat), tail := Array.mkEmpty PersistentArray.branching.toNat, size := 0, shift := PersistentArray.initShift, tailOff := 0 } } }) (methods : Methods := { pre := fun (x : Expr) => pure Step.continue, post := fun (e : Expr) => pure (Step.done { expr := e, proof? := none, cache := true }), dpre := fun (x : Expr) => pure TransformStep.continue, dpost := fun (e : Expr) => pure (TransformStep.done e), discharge? := fun (x : Expr) => pure none, wellBehavedDischarge := true }) :
                                                    Equations
                                                    • One or more equations did not get rendered due to their size.
                                                    Instances For
                                                      Equations
                                                      • One or more equations did not get rendered due to their size.
                                                      Instances For
                                                        def Lean.Meta.Simp.dsimpMain (e : Expr) (ctx : Context) (stats : Stats := { usedTheorems := { map := { root := PersistentHashMap.Node.entries PersistentHashMap.mkEmptyEntriesArray }, size := 0 }, diag := { usedThmCounter := { root := PersistentHashMap.Node.entries PersistentHashMap.mkEmptyEntriesArray }, triedThmCounter := { root := PersistentHashMap.Node.entries PersistentHashMap.mkEmptyEntriesArray }, congrThmCounter := { root := PersistentHashMap.Node.entries PersistentHashMap.mkEmptyEntriesArray }, thmsWithBadKeys := { root := PersistentArrayNode.node (Array.mkEmpty PersistentArray.branching.toNat), tail := Array.mkEmpty PersistentArray.branching.toNat, size := 0, shift := PersistentArray.initShift, tailOff := 0 } } }) (methods : Methods := { pre := fun (x : Expr) => pure Step.continue, post := fun (e : Expr) => pure (Step.done { expr := e, proof? := none, cache := true }), dpre := fun (x : Expr) => pure TransformStep.continue, dpost := fun (e : Expr) => pure (TransformStep.done e), discharge? := fun (x : Expr) => pure none, wellBehavedDischarge := true }) :
                                                        Equations
                                                        • One or more equations did not get rendered due to their size.
                                                        Instances For
                                                          Equations
                                                          • One or more equations did not get rendered due to their size.
                                                          Instances For
                                                            def Lean.Meta.simp (e : Expr) (ctx : Simp.Context) (simprocs : Simp.SimprocsArray := #[]) (discharge? : Option Simp.Discharge := none) (stats : Simp.Stats := { usedTheorems := { map := { root := PersistentHashMap.Node.entries PersistentHashMap.mkEmptyEntriesArray }, size := 0 }, diag := { usedThmCounter := { root := PersistentHashMap.Node.entries PersistentHashMap.mkEmptyEntriesArray }, triedThmCounter := { root := PersistentHashMap.Node.entries PersistentHashMap.mkEmptyEntriesArray }, congrThmCounter := { root := PersistentHashMap.Node.entries PersistentHashMap.mkEmptyEntriesArray }, thmsWithBadKeys := { root := PersistentArrayNode.node (Array.mkEmpty PersistentArray.branching.toNat), tail := Array.mkEmpty PersistentArray.branching.toNat, size := 0, shift := PersistentArray.initShift, tailOff := 0 } } }) :
                                                            Equations
                                                            • One or more equations did not get rendered due to their size.
                                                            Instances For
                                                              def Lean.Meta.dsimp (e : Expr) (ctx : Simp.Context) (simprocs : Simp.SimprocsArray := #[]) (stats : Simp.Stats := { usedTheorems := { map := { root := PersistentHashMap.Node.entries PersistentHashMap.mkEmptyEntriesArray }, size := 0 }, diag := { usedThmCounter := { root := PersistentHashMap.Node.entries PersistentHashMap.mkEmptyEntriesArray }, triedThmCounter := { root := PersistentHashMap.Node.entries PersistentHashMap.mkEmptyEntriesArray }, congrThmCounter := { root := PersistentHashMap.Node.entries PersistentHashMap.mkEmptyEntriesArray }, thmsWithBadKeys := { root := PersistentArrayNode.node (Array.mkEmpty PersistentArray.branching.toNat), tail := Array.mkEmpty PersistentArray.branching.toNat, size := 0, shift := PersistentArray.initShift, tailOff := 0 } } }) :
                                                              Equations
                                                              • One or more equations did not get rendered due to their size.
                                                              Instances For
                                                                def Lean.Meta.simpTargetCore (mvarId : MVarId) (ctx : Simp.Context) (simprocs : Simp.SimprocsArray := #[]) (discharge? : Option Simp.Discharge := none) (mayCloseGoal : Bool := true) (stats : Simp.Stats := { usedTheorems := { map := { root := PersistentHashMap.Node.entries PersistentHashMap.mkEmptyEntriesArray }, size := 0 }, diag := { usedThmCounter := { root := PersistentHashMap.Node.entries PersistentHashMap.mkEmptyEntriesArray }, triedThmCounter := { root := PersistentHashMap.Node.entries PersistentHashMap.mkEmptyEntriesArray }, congrThmCounter := { root := PersistentHashMap.Node.entries PersistentHashMap.mkEmptyEntriesArray }, thmsWithBadKeys := { root := PersistentArrayNode.node (Array.mkEmpty PersistentArray.branching.toNat), tail := Array.mkEmpty PersistentArray.branching.toNat, size := 0, shift := PersistentArray.initShift, tailOff := 0 } } }) :

                                                                See simpTarget. This method assumes mvarId is not assigned, and we are already using mvarIds local context.

                                                                Equations
                                                                • One or more equations did not get rendered due to their size.
                                                                Instances For
                                                                  def Lean.Meta.simpTarget (mvarId : MVarId) (ctx : Simp.Context) (simprocs : Simp.SimprocsArray := #[]) (discharge? : Option Simp.Discharge := none) (mayCloseGoal : Bool := true) (stats : Simp.Stats := { usedTheorems := { map := { root := PersistentHashMap.Node.entries PersistentHashMap.mkEmptyEntriesArray }, size := 0 }, diag := { usedThmCounter := { root := PersistentHashMap.Node.entries PersistentHashMap.mkEmptyEntriesArray }, triedThmCounter := { root := PersistentHashMap.Node.entries PersistentHashMap.mkEmptyEntriesArray }, congrThmCounter := { root := PersistentHashMap.Node.entries PersistentHashMap.mkEmptyEntriesArray }, thmsWithBadKeys := { root := PersistentArrayNode.node (Array.mkEmpty PersistentArray.branching.toNat), tail := Array.mkEmpty PersistentArray.branching.toNat, size := 0, shift := PersistentArray.initShift, tailOff := 0 } } }) :

                                                                  Simplify the given goal target (aka type). Return none if the goal was closed. Return some mvarId' otherwise, where mvarId' is the simplified new goal.

                                                                  Equations
                                                                  • One or more equations did not get rendered due to their size.
                                                                  Instances For
                                                                    def Lean.Meta.applySimpResultToProp (mvarId : MVarId) (proof prop : Expr) (r : Simp.Result) (mayCloseGoal : Bool := true) :

                                                                    Apply the result r for prop (which is inhabited by proof). Return none if the goal was closed. Return some (proof', prop') otherwise, where proof' : prop' and prop' is the simplified prop.

                                                                    This method assumes mvarId is not assigned, and we are already using mvarIds local context.

                                                                    Equations
                                                                    • One or more equations did not get rendered due to their size.
                                                                    Instances For
                                                                      def Lean.Meta.applySimpResultToFVarId (mvarId : MVarId) (fvarId : FVarId) (r : Simp.Result) (mayCloseGoal : Bool) :
                                                                      Equations
                                                                      Instances For
                                                                        def Lean.Meta.simpStep (mvarId : MVarId) (proof prop : Expr) (ctx : Simp.Context) (simprocs : Simp.SimprocsArray := #[]) (discharge? : Option Simp.Discharge := none) (mayCloseGoal : Bool := true) (stats : Simp.Stats := { usedTheorems := { map := { root := PersistentHashMap.Node.entries PersistentHashMap.mkEmptyEntriesArray }, size := 0 }, diag := { usedThmCounter := { root := PersistentHashMap.Node.entries PersistentHashMap.mkEmptyEntriesArray }, triedThmCounter := { root := PersistentHashMap.Node.entries PersistentHashMap.mkEmptyEntriesArray }, congrThmCounter := { root := PersistentHashMap.Node.entries PersistentHashMap.mkEmptyEntriesArray }, thmsWithBadKeys := { root := PersistentArrayNode.node (Array.mkEmpty PersistentArray.branching.toNat), tail := Array.mkEmpty PersistentArray.branching.toNat, size := 0, shift := PersistentArray.initShift, tailOff := 0 } } }) :

                                                                        Simplify prop (which is inhabited by proof). Return none if the goal was closed. Return some (proof', prop') otherwise, where proof' : prop' and prop' is the simplified prop.

                                                                        This method assumes mvarId is not assigned, and we are already using mvarIds local context.

                                                                        Equations
                                                                        • One or more equations did not get rendered due to their size.
                                                                        Instances For
                                                                          Equations
                                                                          Instances For
                                                                            def Lean.Meta.applySimpResultToLocalDecl (mvarId : MVarId) (fvarId : FVarId) (r : Simp.Result) (mayCloseGoal : Bool) :

                                                                            Simplify simp result to the given local declaration. Return none if the goal was closed. This method assumes mvarId is not assigned, and we are already using mvarIds local context.

                                                                            Equations
                                                                            • One or more equations did not get rendered due to their size.
                                                                            Instances For
                                                                              def Lean.Meta.simpLocalDecl (mvarId : MVarId) (fvarId : FVarId) (ctx : Simp.Context) (simprocs : Simp.SimprocsArray := #[]) (discharge? : Option Simp.Discharge := none) (mayCloseGoal : Bool := true) (stats : Simp.Stats := { usedTheorems := { map := { root := PersistentHashMap.Node.entries PersistentHashMap.mkEmptyEntriesArray }, size := 0 }, diag := { usedThmCounter := { root := PersistentHashMap.Node.entries PersistentHashMap.mkEmptyEntriesArray }, triedThmCounter := { root := PersistentHashMap.Node.entries PersistentHashMap.mkEmptyEntriesArray }, congrThmCounter := { root := PersistentHashMap.Node.entries PersistentHashMap.mkEmptyEntriesArray }, thmsWithBadKeys := { root := PersistentArrayNode.node (Array.mkEmpty PersistentArray.branching.toNat), tail := Array.mkEmpty PersistentArray.branching.toNat, size := 0, shift := PersistentArray.initShift, tailOff := 0 } } }) :
                                                                              Equations
                                                                              • One or more equations did not get rendered due to their size.
                                                                              Instances For
                                                                                def Lean.Meta.simpGoal (mvarId : MVarId) (ctx : Simp.Context) (simprocs : Simp.SimprocsArray := #[]) (discharge? : Option Simp.Discharge := none) (simplifyTarget : Bool := true) (fvarIdsToSimp : Array FVarId := #[]) (stats : Simp.Stats := { usedTheorems := { map := { root := PersistentHashMap.Node.entries PersistentHashMap.mkEmptyEntriesArray }, size := 0 }, diag := { usedThmCounter := { root := PersistentHashMap.Node.entries PersistentHashMap.mkEmptyEntriesArray }, triedThmCounter := { root := PersistentHashMap.Node.entries PersistentHashMap.mkEmptyEntriesArray }, congrThmCounter := { root := PersistentHashMap.Node.entries PersistentHashMap.mkEmptyEntriesArray }, thmsWithBadKeys := { root := PersistentArrayNode.node (Array.mkEmpty PersistentArray.branching.toNat), tail := Array.mkEmpty PersistentArray.branching.toNat, size := 0, shift := PersistentArray.initShift, tailOff := 0 } } }) :
                                                                                Equations
                                                                                • One or more equations did not get rendered due to their size.
                                                                                Instances For
                                                                                  def Lean.Meta.simpTargetStar (mvarId : MVarId) (ctx : Simp.Context) (simprocs : Simp.SimprocsArray := #[]) (discharge? : Option Simp.Discharge := none) (stats : Simp.Stats := { usedTheorems := { map := { root := PersistentHashMap.Node.entries PersistentHashMap.mkEmptyEntriesArray }, size := 0 }, diag := { usedThmCounter := { root := PersistentHashMap.Node.entries PersistentHashMap.mkEmptyEntriesArray }, triedThmCounter := { root := PersistentHashMap.Node.entries PersistentHashMap.mkEmptyEntriesArray }, congrThmCounter := { root := PersistentHashMap.Node.entries PersistentHashMap.mkEmptyEntriesArray }, thmsWithBadKeys := { root := PersistentArrayNode.node (Array.mkEmpty PersistentArray.branching.toNat), tail := Array.mkEmpty PersistentArray.branching.toNat, size := 0, shift := PersistentArray.initShift, tailOff := 0 } } }) :
                                                                                  Equations
                                                                                  • One or more equations did not get rendered due to their size.
                                                                                  Instances For
                                                                                    def Lean.Meta.dsimpGoal (mvarId : MVarId) (ctx : Simp.Context) (simprocs : Simp.SimprocsArray := #[]) (simplifyTarget : Bool := true) (fvarIdsToSimp : Array FVarId := #[]) (stats : Simp.Stats := { usedTheorems := { map := { root := PersistentHashMap.Node.entries PersistentHashMap.mkEmptyEntriesArray }, size := 0 }, diag := { usedThmCounter := { root := PersistentHashMap.Node.entries PersistentHashMap.mkEmptyEntriesArray }, triedThmCounter := { root := PersistentHashMap.Node.entries PersistentHashMap.mkEmptyEntriesArray }, congrThmCounter := { root := PersistentHashMap.Node.entries PersistentHashMap.mkEmptyEntriesArray }, thmsWithBadKeys := { root := PersistentArrayNode.node (Array.mkEmpty PersistentArray.branching.toNat), tail := Array.mkEmpty PersistentArray.branching.toNat, size := 0, shift := PersistentArray.initShift, tailOff := 0 } } }) :
                                                                                    Equations
                                                                                    • One or more equations did not get rendered due to their size.
                                                                                    Instances For