Documentation

Lean.Meta.Tactic.Grind.Types

We use this auxiliary constant to mark delayed congruence proofs.

Equations
Instances For

    We use this auxiliary constant to mark delayed symmetric congruence proofs. Example: a = b is symmetrically congruent to c = d if a = d and b = c.

    Note: We previously used congrPlaceholderProof for this case, but it caused non-termination during proof term construction when a = b = c = d. The issue was that we did not have enough information to determine how a = b and c = d became congruent. The new marker resolves this issue.

    If congrPlaceholderProof is used, then a = b became congruent to c = d because a = c and b = d. If eqCongrSymmPlaceholderProof is used, then it was because a = d and b = c.

    Example: suppose we have the following equivalence class:

    {p, q, p = q, q = p, True}
    

    Recall that True is always the root of its equivalence class. Assume we also have the following two paths in the class:

    1. p -> p = q -> q = p -> True
    2. q -> True
    

    Now suppose we try to build a proof for p = True. We must construct a proof for (p = q) = (q = p). These equalities are congruent, but if we try to prove p = q and q = p using the facts p = True and q = True, we end up trying to prove p = True again. In other words, we are missing the information that p = q became congruent to q = p because of the symmetric case. By using eqCongrSymmPlaceholderProof, we retain this information.

    Equations
    Instances For

      Literal applications that internalize handles specially.

      Instances For

        Classifies the application e. For example, BitVec and Fin are parametric literals, but Nat is not. The types of nonparametric literals are reduced using whnfD, but BitVec and Fin must occur syntactically. The type of a negative literal -n must also occur syntactically because internalize does not visit n: the ring normalizer, used for Int, Int8, Int16, Int32, and Int64, treats -n as a constant, but linarith reifies -n : α for def α := Int as the negation of the variable n. internalize does not add literal applications to the congruence table.

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

          Returns true if e is True, False, or a literal value. See Lean.Meta.LitValues for supported literals. grind assumes distinct interpreted terms denote distinct values, so a literal is interpreted only if it is in normal form, and in particular its type must be structurally a supported builtin type, with a numeral parameter for Fin/BitVec. LitValues recognizes literals up to whnfD on their types, e.g. (1 : BitVec w) for def w := 32, but the canonicalizer does not unfold w, and (1 : BitVec w) and (1 : BitVec 32) would be distinct interpreted terms denoting the same value.

          The type of a literal is read from e itself. For negated literals, both the outer and inner types must be the same normal type. Rat, Float, and Float32 literals are never interpreted. A literal of a signed fixed-width type is interpreted only in the form produced by its ToExpr instance, i.e., when it is in range: the canonicalizer reduces OfNat numerals modulo 2^w, but (200 : Int8) and (-56 : Int8) still denote the same value, as do -0 and 0. Assumes e has no assigned metavariables.

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

            The following options deliberately break the suggestions produced by grind?. They are for debugging and testing only, e.g., for testing that grind? reports suggestions that fail.

            Anchors are used to reference terms, local theorems, and case-splits in the grind state. We also use anchors to prune the search space when they are provided as grind parameters and the finish tactic.

            Instances For

              Opaque solver extension state.

              Case-split source. That is, where it came from. We store the current source in the grind context.

              Instances For

                Auxiliary type used to implement grind.ematch.instance.

                Instances For

                  Context for GrindM monad.

                  • simpMethods : Simp.Methods
                  • symSimpMethods : Sym.Simp.Methods

                    Methods of the Sym.simp-based normalizer. Unused when backward.grind.normalizer is set.

                  • symDSimpMethods : Sym.DSimp.Methods

                    Methods of the Sym.dsimp-based normalizer. Unused when backward.grind.normalizer is set.

                  • config : Grind.Config
                  • identity : Name

                    Name of the tactic running grind, e.g., lia or grind_order. Each tactic sets it at startup.

                  • activeSolvers : Array Nat

                    Ids of the solver extensions that config enables, see SolverExtension.enabled.

                  • anchorRefs? : Option (Array AnchorRef)

                    If anchorRefs? := some anchorRefs, then only local instances and case-splits in anchorRefs are considered.

                  • anchors : Bool

                    anchors := true if anchors may be observed in this run: when generating tactic scripts, restricting the search using anchorRefs?, or in interactive mode. Otherwise, getAnchor returns 0 and local variable anchors are not assigned. It must not change during a run, since local variable anchors are assigned when the variables are introduced.

                  • cheapCases : Bool

                    If cheapCases is true, grind only applies cases to types that contain at most one minor premise. Recall that grind applies cases when introducing types tagged with [grind cases eager], and at Split.lean Remark: We add this option to implement the lookahead feature, we don't want to create several subgoals when performing lookahead.

                  • reportMVarIssue : Bool
                  • splitSource : SplitSource

                    Current source of case-splits.

                  • ematchDiagSource : EMatchDiagSource

                    Current source of tracking E-matching theorem instantiation (see grind.ematch.instances).

                  • symPrios : SymbolPriorities

                    Symbol priorities for inferring E-matching patterns

                  • extensions : ExtensionStateArray
                  • debug : Bool
                  • ematchDiag : Bool
                  Instances For

                    Key for the congruence theorem cache.

                    Instances For
                      • Number of times E-match theorem has been instantiated.

                      • fvarUserNames : PHashMap FVarId Name

                        User names for theorem origins that are .fvars. We need to store this information because subgoals are created while we are solving subgoals.

                      • Number of times a cases has been performed on an inductive type/predicate

                      • Number of applications per function symbol. This information is only collected if set_option diagnostics true

                      Instances For

                        Case-split diagnostic information

                        Instances For

                          A node in the E-matching diagnostics hyper-graph.

                          Instances For
                            Equations
                            Instances For

                              An entry {thm_1, ..., thm_n} => {thm}. Each thm_i and thm is the proof of a theorem instance. It means terms created while instantiating thm_i were used to create theorem thm.

                              Instances For

                                A declaration hoisted to the goal of a case split, see hoistDecl: the proof of a fact, or a value such as the variable context of a solver. The subgoals of the split refer to it using fvarId, and mkHoistedDecls declares it in the proof of the split.

                                • fvarId : FVarId
                                • name : Name

                                  Binder name of the declaration.

                                • type : Expr
                                • value? : Option Expr

                                  none while the value is postponed, see reserveHoistedDecl.

                                • nondep : Bool

                                  false for a let whose value must be visible to the kernel, e.g., the variable context of a solver.

                                Instances For

                                  Identifies a hoisted declaration, so that it is created only once and shared by all subgoals of a case split, see hoistDecl.

                                  • ptr (obj : Sym.ObjectPtr) : HoistKey

                                    A solver object, compared by address. The subgoals of a case split share the objects created before it, so they also share the declaration associated with the object.

                                  • ctx (atoms : Array Expr) : HoistKey

                                    The variable context of a solver with the given atoms, e.g., a cutsat RArray. Proofs that use equal contexts share one let declaration, which keeps the kernel from checking copies of it.

                                  Instances For

                                    The declarations hoisted to the goal of a case split in progress, see Action.splitCore. They are shared by all subgoals of the split, and declared in the order front.reverse ++ decls.

                                    Instances For

                                      Summary of the instantiation of a proof, see getProofInfo: its free variables, and whether it contains a synthetic sorry.

                                      • fvars : FVarIdSet
                                      • hasSorry : Bool
                                      • hasUnassigned : Bool

                                        Whether the proof contains an unassigned metavariable of grind's depth, e.g., the goal of a subgoal that is still open. Assigning it may change the summary.

                                      Instances For

                                        State for the GrindM monad.

                                        • Congruence theorems generated so far. Recall that for constant symbols we rely on the reserved name feature (i.e., mkHCongrWithArityForConst?). Remark: we currently do not reuse congruence theorems

                                        • simp : Simp.State
                                        • symSimp : Sym.Simp.State

                                          State (cache) of the Sym.simp-based normalizer.

                                        • symDSimp : Sym.DSimp.State

                                          State (cache) of the Sym.dsimp-based normalizer.

                                        • lastTag : Name

                                          Used to generate trace messages of the for [grind] working on <tag>, and implement the macro trace_goal.

                                        • counters : Counters

                                          Performance counters

                                        • splitDiags : PArray SplitDiagInfo

                                          Split diagnostic information. This information is only collected when set_option diagnostics true

                                        • ematchDiags : PArray EMatchDiagInfo

                                          E-matching theorem instantiation diagnostics

                                        • lawfulEqCmpMap : PHashMap ExprPtr (Option Expr)

                                          Mapping from binary functions f to a theorem thm : ∀ a b, f a b = .eq → a = b if it implements the LawfulEqCmp type class.

                                        • reflCmpMap : PHashMap ExprPtr (Option Expr)

                                          Mapping from binary functions f to a theorem thm : ∀ a, f a a = .eq if it implements the ReflCmp type class.

                                        • Cached anchors (aka stable hash codes) for terms in the grind state.

                                        • fvarAnchors : PHashMap FVarId UInt64

                                          Anchors of the local variables introduced by grind. They are based on how each variable was introduced instead of its name or position. See registerFVarAnchor.

                                        • Accumulated E-matching instance map for precise unused lemma tracking. Only populated when config.markInstances is true.

                                        • Declarations hoisted to the case splits in progress, indexed by the metavariable of the goal being split.

                                        • Cache for getProofInfo: maps a metavariable to its assignment and the summary of the assignment's instantiation. An entry is only valid while the metavariable is assigned to the same expression.

                                        • numBranches : Nat

                                          Number of branches created by the case-splits performed so far, including the cases that have not been explored yet, but not the ones skipped by non-chronological backtracking. See Grind.Config.branches and Action.splitCore.

                                        Instances For
                                          @[inline]
                                          def Lean.Meta.Grind.mapGrindM {m : Type → Type u_1} [MonadControlT GrindM m] [Monad m] (f : {α : Type} → GrindM α → GrindM α) {α : Type} (x : m α) :
                                          m α
                                          Equations
                                          Instances For
                                            @[inline]

                                            Returns true if grind.debug is set

                                            Equations
                                            Instances For

                                              Backtrackable state for the GrindM monad.

                                              Instances For
                                                Equations
                                                Instances For

                                                  Restore backtrackable parts of the state.

                                                  Equations
                                                  Instances For
                                                    def Lean.Meta.Grind.withoutReportingMVarIssues {m : Type → Type u_1} {α : Type} [MonadControlT GrindM m] [Monad m] :
                                                    m α → m α

                                                    withoutReportingMVarIssues x executes x without reporting metavariables found during internalization. See comment at Grind.Context.reportMVarIssue for additional details.

                                                    Equations
                                                    • One or more equations did not get rendered due to their size.
                                                    Instances For
                                                      @[reducible, inline]
                                                      abbrev Lean.Meta.Grind.withSplitSource {m : Type → Type u_1} {α : Type} [MonadControlT GrindM m] [Monad m] (splitSource : SplitSource) :
                                                      m α → m α

                                                      withSplitSource s x executes x and uses s as the split source for any case-split registered.

                                                      Equations
                                                      • One or more equations did not get rendered due to their size.
                                                      Instances For
                                                        @[reducible, inline]
                                                        abbrev Lean.Meta.Grind.withEmatchDiagSource {m : Type → Type u_1} {α : Type} [MonadControlT GrindM m] [Monad m] (ematchDiagSource : EMatchDiagSource) :
                                                        m α → m α

                                                        withEmatchDiagSource s x executes x and uses s as the E-matching diagnostics source for any term created.

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

                                                          Returns the user-defined configuration options

                                                          Equations
                                                          Instances For

                                                            Returns the name of the tactic running grind. See Context.identity.

                                                            Equations
                                                            Instances For

                                                              Returns extension states associate with grind attributes in use

                                                              Equations
                                                              Instances For
                                                                @[reducible, inline]
                                                                abbrev Lean.Meta.Grind.withGTransparency {n : Type → Type u_1} {α : Type} [MonadControlT MetaM n] [MonadLiftT GrindM n] [Monad n] (k : n α) :
                                                                n α

                                                                Runs k with the transparency setting specified by Config.reducible. Uses reducible transparency if reducible is true, otherwise default transparency.

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

                                                                  Returns the anchor references (if any) being used to restrict the search.

                                                                  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

                                                                        Returns symbol priorities for inferring E-matching patterns.

                                                                        Equations
                                                                        Instances For

                                                                          Returns true if we declName is tagged with funCC modifier.

                                                                          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
                                                                                • One or more equations did not get rendered due to their size.
                                                                                Instances For

                                                                                  Returns true if declName is the name of a match equation or a match congruence equation.

                                                                                  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
                                                                                        def Lean.Meta.Grind.saveSplitDiagInfo (c : Expr) (gen numCases : Nat) (splitSource : SplitSource) :
                                                                                        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 maximum term generation that is considered during ematching.

                                                                                            Equations
                                                                                            Instances For

                                                                                              Abstracts nested proofs in e. This is a preprocessing step performed before internalization.

                                                                                              Equations
                                                                                              Instances For

                                                                                                Creates a congruence theorem for a f-applications with numArgs arguments.

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

                                                                                                  Each E-node may have "solver terms" attached to them. Each term is an element of the equivalence class that the solver cares about. Each solver is responsible for marking the terms they care about. The grind core propagates equalities and disequalities to the theory solvers using these "marked" terms. The root of the equivalence class contains a list of representatives sorted by solver id. Note that many E-nodes do not have any solver terms attached to them.

                                                                                                  A solver has one representative per type in the equivalence class. A class contains terms of different types (e.g., Fin n and Fin m) only if it was merged via HEq (see ENode.heqProofs). Thus, the solvers are only notified about equalities and disequalities between terms of the same type.

                                                                                                  "Solver terms" are referenced as "theory variables" in the SMT literature. The SMT solver Z3 uses a similar representation.

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

                                                                                                      Stores information for a node in the E-graph. Each internalized expression e has an ENode associated with it.

                                                                                                      • self : Expr

                                                                                                        Node represented by this ENode.

                                                                                                      • next : Expr

                                                                                                        Next element in the equivalence class.

                                                                                                      • root : Expr

                                                                                                        Root (aka canonical representative) of the equivalence class

                                                                                                      • congr : Expr

                                                                                                        congr is the term self is congruent to. We say self is the congruence class root if isSameExpr congr self. This field is initialized to self even if e is not an application.

                                                                                                      • target? : Option Expr

                                                                                                        When e was added to this equivalence class because of an equality h : e = target, then we store target here, and h at proof?.

                                                                                                      • proof? : Option Expr
                                                                                                      • flipped : Bool

                                                                                                        Proof has been flipped.

                                                                                                      • size : Nat

                                                                                                        Number of elements in the equivalence class, this field is meaningless if node is not the root.

                                                                                                      • interpreted : Bool

                                                                                                        interpreted := true if node should be viewed as an abstract value.

                                                                                                      • ctor : Bool

                                                                                                        ctor := true if the head symbol is a constructor application.

                                                                                                      • hasLambdas : Bool

                                                                                                        hasLambdas := true if the equivalence class contains lambda expressions.

                                                                                                      • heqProofs : Bool

                                                                                                        If heqProofs := true, then some proofs in the equivalence class are based on heterogeneous equality.

                                                                                                      • idx : Nat

                                                                                                        Unique index used for pretty printing and debugging purposes.

                                                                                                      • generation : Nat

                                                                                                        The generation in which this enode was created.

                                                                                                      • mt : Nat

                                                                                                        Modification time

                                                                                                      • sTerms : SolverTerms

                                                                                                        Solver terms attached to this E-node.

                                                                                                      • funCC : Bool

                                                                                                        If funCC := true, then the expression associated with this entry is an application, and function congruence closure is enabled for it. See Grind.Config.funCC for additional details.

                                                                                                      • ematchDiagSource : EMatchDiagSource

                                                                                                        Auxiliary field used to implement grind.ematch.diagnostics

                                                                                                      Instances For

                                                                                                        Work queued for processToDo: equalities and facts to assert, and terms to propagate.

                                                                                                        • eq (lhs rhs proof : Expr) (isHEq : Bool) : ToProcessElement
                                                                                                        • fact (prop proof : Expr) (generation : Nat) : ToProcessElement
                                                                                                        • propagateUp (e : Expr) : ToProcessElement

                                                                                                          Run the upward propagators of e. Internalization queues this instead of propagating eagerly: a propagator may internalize terms, and must not do so while the arguments of an enclosing application are still being internalized.

                                                                                                        • internalizeRhsAddEq (lhs rhs proof : Expr) (generation : Nat) : ToProcessElement

                                                                                                          Internalize only rhs (lhs must already be internalized), and then add lhs = rhs. Internalization queues this when rhs may contain an application whose arguments are still being internalized.

                                                                                                        • solverEq (solverId : Nat) (lhs rhs : Expr) : ToProcessElement

                                                                                                          Run the newEq callback of the solver solverId on its terms lhs and rhs. SolverExtension.markTerm queues this instead of running the callback eagerly. markTerm runs inside the internalize hook of a solver, that is, while the enclosing applications of the term being internalized may still have unvisited arguments. The callback may internalize new terms containing such an application. See GoalState.internalizing.

                                                                                                        • solverDiseq (solverId : Nat) (lhs rhs : Expr) : ToProcessElement

                                                                                                          Run the newDiseq callback of the solver solverId. See solverEq.

                                                                                                        Instances For
                                                                                                          structure Lean.Meta.Grind.CongrKey (enodes : ENodeMap) :

                                                                                                          Key for the congruence table. We need access to the enodes to be able to retrieve the equivalence class roots.

                                                                                                          Instances For

                                                                                                            Note: congrHash and isCongruent must satisfy the BEq/Hashable invariant for PHashSet: if isCongruent e₁ e₂ returns true, then congrHash e₁ == congrHash e₂.

                                                                                                            When funCC = true, congrHash hashes only the immediate function and argument: mixHash (hashRoot f) (hashRoot a). When funCC = false, it recursively decomposes all application layers. These produce fundamentally different hash values, so isCongruent must require matching funCC flags. Here is the scenario that leads to a nondeterministic crash if mismatched flags are allowed:

                                                                                                            1. e₁ (with funCC = true) is inserted into the congruence table.
                                                                                                            2. e₂ (with funCC = false) is inserted. Its hash is computed using the non-funCC path.
                                                                                                            3. Because hashRoot uses pointer addresses (ptrAddrUnsafe), the two different hash computations can accidentally collide, placing e₂ in the same bucket as e₁.
                                                                                                            4. isCongruent e₁ e₂ is called. If it used only e₁'s funCC flag (the old behavior), the funCC comparison path could declare them congruent even when they have different numbers of top-level arguments.
                                                                                                            5. addCongrTable calls pushEqHEq e₂ e₁ congrPlaceholderProof, where e₂ is the new node with funCC = false.
                                                                                                            6. During proof reconstruction, mkCongrProof e₂ e₁ checks useFunCC e₂ = false, enters the standard (non-funCC) proof path, and hits assert! rhs.getAppNumArgs == numArgs because e₁ and e₂ have different argument counts.

                                                                                                            This was observed as a nondeterministic crash in Mathlib (e.g., at Analysis/ODE/PicardLindelof.lean).

                                                                                                            @[instance_reducible]
                                                                                                            instance Lean.Meta.Grind.instBEqCongrKey {enodeMap : ENodeMap} :
                                                                                                            BEq (CongrKey enodeMap)
                                                                                                            Equations
                                                                                                            @[reducible, inline]
                                                                                                            Equations
                                                                                                            Instances For
                                                                                                              Instances For
                                                                                                                Equations
                                                                                                                Instances For
                                                                                                                  Equations
                                                                                                                  Instances For

                                                                                                                    The E-matching module instantiates theorems using the EMatchTheorem proof and a (partial) assignment. We want to avoid instantiating the same theorem with the same assignment more than once. Therefore, we store the (pre-)instance information in set. Recall that the proofs of activated theorems have been hash-consed. The assignment contains internalized expressions, which have also been hash-consed.

                                                                                                                    Note: We used to use pointer equality to implement PreInstanceSet. However, this low-level trick was incorrect in interactive mode because we add new EMatchTheorem objects using instantiate [...]. For example, suppose we write

                                                                                                                    instantiate [thm_1]; instantiate [thm_1]
                                                                                                                    

                                                                                                                    The EMatchTheorem object thm_1 is created twice. Using pointer equality will miss instances created using the two different objects. Recall we do not use hash-consing on proof objects. If we hash-cons the proof objects, it would be ok to use pointer equality.

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

                                                                                                                      New raw fact to be preprocessed, and then asserted.

                                                                                                                      Instances For
                                                                                                                        Instances For
                                                                                                                          Equations
                                                                                                                          Instances For

                                                                                                                            Trace information for a case split.

                                                                                                                            Instances For

                                                                                                                              Users can attach guards to grind_patterns. A guard ensures that a theorem is instantiated only when the guard expression becomes provably true.

                                                                                                                              If check is true, then grind attempts to prove e by asserting its negation and checking whether this leads to a contradiction.

                                                                                                                              Instances For

                                                                                                                                A delayed theorem instantiation is an instantiation that includes one or more guards. See TheoremGuard.

                                                                                                                                Instances For

                                                                                                                                  E-matching related fields for the grind goal.

                                                                                                                                  • Inactive global theorems. As we internalize terms, we activate theorems as we find their symbols. Local theorem provided by users are added directly into newThms.

                                                                                                                                  • gmt : Nat

                                                                                                                                    Goal modification time.

                                                                                                                                  • Active theorems that we have performed ematching at least once.

                                                                                                                                  • Active theorems that we have not performed any round of ematching yet.

                                                                                                                                  • numInstances : Nat

                                                                                                                                    Number of theorem instances generated so far.

                                                                                                                                  • numDelayedInstances : Nat

                                                                                                                                    Number of delayed theorem instances generated so far. We track them to decide whether E-match made progress or not.

                                                                                                                                  • num : Nat

                                                                                                                                    Number of E-matching rounds performed in this goal since the last case-split.

                                                                                                                                  • preInstances : PreInstanceSet

                                                                                                                                    (pre-)instances found so far. It includes instances that failed to be instantiated.

                                                                                                                                  • nextThmIdx : Nat

                                                                                                                                    Next local E-match theorem idx.

                                                                                                                                  • matchEqNames : PHashSet Name

                                                                                                                                    match auxiliary functions whose equations have already been created and activated.

                                                                                                                                  • Delayed instantiations is a mapping from guards to theorems that are waiting them to become True.

                                                                                                                                  Instances For

                                                                                                                                    Case-split information.

                                                                                                                                    • default (e : Expr) (source : SplitSource) : SplitInfo

                                                                                                                                      Term e may be an inductive predicate, match-expression, if-expression, implication, etc.

                                                                                                                                    • imp (e : Expr) (h : e.isForall = true) (source : SplitSource) : SplitInfo

                                                                                                                                      e is an implication and we want to split on its antecedent.

                                                                                                                                    • arg (a b : Expr) (i : Nat) (eq : Expr) (source : SplitSource) : SplitInfo

                                                                                                                                      Given applications a and b, case-split on whether the corresponding i-th arguments are equal or not. The split is only performed if all other arguments are already known to be equal or are also tagged as split candidates.

                                                                                                                                    Instances For
                                                                                                                                      Equations
                                                                                                                                      Instances For
                                                                                                                                        Equations
                                                                                                                                        Instances For

                                                                                                                                          Argument arg : type of an application app in SplitInfo.

                                                                                                                                          Instances For

                                                                                                                                            Case splitting related fields for the grind goal.

                                                                                                                                            • candidates : List SplitInfo

                                                                                                                                              Case-split candidates.

                                                                                                                                            • Case-splits that have been inserted at candidates at some point.

                                                                                                                                            • resolved : PHashSet ExprPtr

                                                                                                                                              Case-splits that have already been performed, or that do not have to be performed anymore.

                                                                                                                                            • trace : List CaseTrace

                                                                                                                                              Sequence of cases steps that generated this goal. We only use this information for diagnostics.

                                                                                                                                            • lookaheads : List SplitInfo

                                                                                                                                              Lookahead "case-splits".

                                                                                                                                            • argPosMap : Std.HashMap (Expr × Expr) (List Nat)

                                                                                                                                              A mapping (a, b) ↦ is s.t. for each SplitInfo.arg a b i eq in candidates or lookaheads we have i ∈ is. We use this information to decide whether the split/lookahead is "ready" to be tried or not.

                                                                                                                                            • Mapping from pairs (f, i) to a list of arguments. Each argument occurs as the i-th of an f-application. We use this information to add splits/lookaheads for triggering extensionality theorems and model-based theory combination. See addSplitCandidatesForExt.

                                                                                                                                            Instances For

                                                                                                                                              Clean name generator.

                                                                                                                                              Instances For

                                                                                                                                                Cache for Unit-like types. It maps the type to its element. We say a type is Unit-like if it is a subsingleton and is inhabited.

                                                                                                                                                Instances For
                                                                                                                                                  • us : List Level
                                                                                                                                                  • α : Expr
                                                                                                                                                  • β : Expr
                                                                                                                                                  • h : Expr
                                                                                                                                                  • inv? : Option (Expr × Expr)

                                                                                                                                                    Inverse function and a proof that ∀ a, inv (f a) = a Note: The following two fields are none if no f-application has been found yet.

                                                                                                                                                  Instances For

                                                                                                                                                    State for injective theorem support.

                                                                                                                                                    Instances For

                                                                                                                                                      The grind state for a goal, excluding the metavariable.

                                                                                                                                                      This separation from Goal allows multiple goals with different metavariables to share the same GoalState. This is useful for automation such as symbolic simulation, where applying theorems create multiple goals that inherit the same E-graph, congruence closure state, and other accumulated facts.

                                                                                                                                                      • nextDeclIdx : Nat

                                                                                                                                                        Next local declaration index to process.

                                                                                                                                                      • enodeMap : ENodeMap
                                                                                                                                                      • exprs : PArray Expr
                                                                                                                                                      • parents : ParentMap
                                                                                                                                                      • congrTable : CongrTable self.enodeMap
                                                                                                                                                      • A mapping from each function application index (HeadIndex) to a list of applications with that index. Recall that the HeadIndex for a constant is its constant name, and for a free variable, it is its unique id.

                                                                                                                                                      • indicesFound : PHashSet HeadIndex

                                                                                                                                                        All constants (not in appMap) that have been internalized, and appMap's domain. We use this collection during theorem activation.

                                                                                                                                                      • Pending work for processToDo: equalities, facts, upward propagations, and solver callbacks.

                                                                                                                                                      • internalizing : Array Expr

                                                                                                                                                        Applications whose ENode exists but whose arguments are still being visited, outermost first. Maintained only when isDebugEnabled holds, and empty whenever no internalization is in progress. The internalizer uses it to check that solver code never internalizes one of these applications; see the section on re-entrant internalization in Lean.Meta.Tactic.Grind.Internalize.

                                                                                                                                                      • inconsistent : Bool

                                                                                                                                                        inconsistent := true if ENodes for True and False are in the same equivalence class.

                                                                                                                                                      • nextIdx : Nat

                                                                                                                                                        Next unique index for creating ENodes

                                                                                                                                                      • newRawFacts : Std.Queue NewRawFact

                                                                                                                                                        new facts to be preprocessed and then asserted.

                                                                                                                                                      • facts : PArray Expr

                                                                                                                                                        Asserted facts

                                                                                                                                                      • Cached extensionality theorems for types.

                                                                                                                                                      • ematch : EMatch.State

                                                                                                                                                        State of the E-matching module.

                                                                                                                                                      • State of the injective function procedure.

                                                                                                                                                      • split : Split.State

                                                                                                                                                        State of the case-splitting module.

                                                                                                                                                      • clean : Clean.State

                                                                                                                                                        State of the clean name generator.

                                                                                                                                                      • Solver states.

                                                                                                                                                      • goalStack : Array (MVarId × GoalState)

                                                                                                                                                        Goals of the enclosing case splits in progress, outermost first. Its size is the split depth of the goal. See hoistDecl. Remark: each case split copies the array when pushing its goal, but the split depth is small, and hoisting needs constant-time access by depth.

                                                                                                                                                      • introBase : UInt64

                                                                                                                                                        Provenance of the local variables introduced next: the numIntros-th one gets anchor mixHash introBase (hash numIntros). Steps that introduce variables, such as case-splits, reset it. See registerFVarAnchor.

                                                                                                                                                      • numIntros : Nat
                                                                                                                                                      Instances For
                                                                                                                                                        Equations
                                                                                                                                                        Instances For
                                                                                                                                                          @[inline]
                                                                                                                                                          def Lean.Meta.Grind.GoalM.runCore {α : Type} (goal : Goal) (x : GoalM α) :
                                                                                                                                                          Equations
                                                                                                                                                          Instances For
                                                                                                                                                            @[inline]
                                                                                                                                                            def Lean.Meta.Grind.GoalM.run {α : Type} (goal : Goal) (x : GoalM α) :
                                                                                                                                                            Equations
                                                                                                                                                            Instances For
                                                                                                                                                              @[inline]
                                                                                                                                                              Equations
                                                                                                                                                              Instances For

                                                                                                                                                                Returns the number of enclosing case splits.

                                                                                                                                                                Equations
                                                                                                                                                                Instances For

                                                                                                                                                                  Returns the goal at split depth depth: the goal of the enclosing case split at depth, or the current goal if depth is its split depth.

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

                                                                                                                                                                    Returns the free variable of the declaration registered for key in the goal of the enclosing case split at depth, if any.

                                                                                                                                                                    Equations
                                                                                                                                                                    • One or more equations did not get rendered due to their size.
                                                                                                                                                                    Instances For
                                                                                                                                                                      def Lean.Meta.Grind.hoistDecl (depth : Nat) (key : HoistKey) (name : Name) (type : Expr) (value : GoalM Expr) (nondep : Bool := true) (front : Bool := false) :

                                                                                                                                                                      Returns the free variable of the declaration name : type := value hoisted to the goal of the enclosing case split at depth. value is only executed if no declaration has been registered for key yet, and it must be valid in that goal.

                                                                                                                                                                      As with local declarations, hoisted declarations must be created in the right order: the value of a declaration may only use declarations created before it. If front := true, the declaration is added before the existing ones, and its value may only use declarations of enclosing case splits. This is useful for values that are known only after the declarations that use them are created, e.g., the variable context of a solver.

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

                                                                                                                                                                        Similar to hoistDecl, but postpones the value. Returns the free variable of a new declaration of type type hoisted to the goal of the enclosing case split at depth, and its index in HoistedDecls.decls. No declaration may be registered for key yet (see findHoistedDecl?). The value must be provided with setHoistedDeclValue before the case split completes, and it may only use declarations created before this one.

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

                                                                                                                                                                          Sets the value of the postponed declaration at index idx of HoistedDecls.decls in the goal of the enclosing case split at depth, see reserveHoistedDecl.

                                                                                                                                                                          Equations
                                                                                                                                                                          • One or more equations did not get rendered due to their size.
                                                                                                                                                                          Instances For
                                                                                                                                                                            def Lean.Meta.Grind.withHoistedDecls {α : Type} (goal : Goal) (k : GrindM α) :

                                                                                                                                                                            Executes k, which proves goal using case splits, while declarations can be hoisted to goal, see hoistDecl. The subgoals of the split must include goal in their goalStack.

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

                                                                                                                                                                              Returns the declarations hoisted to goal, see withHoistedDecls.

                                                                                                                                                                              Equations
                                                                                                                                                                              Instances For

                                                                                                                                                                                Similar to instantiateMVars, but also resolves the delayed assignments ?m #[xs] := ?pending created inside the current withNewMCtxDepth block, which is entered by grind during its startup. instantiateMVars only resolves a delayed assignment when ?pending's assignment val is ground (no unassigned expression metavariables). This ground restriction exists because val may contain metavariables that have xs in their scope. For example, if xs = #[x] and val = ?n + x where x is in the scope of ?n, then mkLambda creates fun x => ?n + x. If ?n is later assigned to f x, the term becomes ill-formed with a dangling free variable.

                                                                                                                                                                                This scenario cannot occur here: in a grind proof, val only contains metavariables created before withNewMCtxDepth, and they cannot contain free variables created by grind, so the conversion is safe. Delayed assignments created before withNewMCtxDepth are left untouched, as they are meant to be resolved by other tactics.

                                                                                                                                                                                Returns a ProofInfo summary of e by following metavariable assignments without constructing the instantiated expression. Collects free variables and synthetic sorry occurrences, and reports whether the traversal encounters an unassigned metavariable at the current depth.

                                                                                                                                                                                For an ordinary metavariable application ?m as, combines the summary of ?m's assignment, if any, with the summaries of all arguments as, including arguments the assignment ignores. For a delayed assignment ?d #[xs] := ?p, summarizes ?p's assignment, removes xs from its free variables, and combines the result with the summaries of all arguments to ?d. The local declarations of xs are not traversed, so dependencies in binder types that would remain after resolving a partially applied delayed assignment are not included.

                                                                                                                                                                                Unassigned metavariables contribute no free variables or synthetic sorry occurrences. Only those at the current depth set hasUnassigned. During grind's protected withNewMCtxDepth block, outer-depth metavariables cannot be assigned, and their local contexts cannot contain free variables introduced by grind. Their eventual assignments may change the summary after the protected computation ends.

                                                                                                                                                                                Summaries of assigned metavariables with hasUnassigned = false are cached in State.proofInfos. A cached summary is reused only while the metavariable's assignment is the same expression. This avoids repeatedly traversing shared assignments, such as proofs used by nested case splits.

                                                                                                                                                                                Wraps e : type in let bindings for selected hoisted declarations. The proof may refer to hoisted free variables, directly or through metavariable assignments, even when those variables are absent from the current local context.

                                                                                                                                                                                Declarations are ordered as decls.front.reverse ++ decls.decls. Using getProofInfo, selects declarations referenced by e and recursively by the values of selected declarations. Each value may depend only on earlier declarations in this order. If the summary of e has hasUnassigned, keeps all declarations; if the summary of a selected value has hasUnassigned, keeps all earlier declarations, since later assignments may introduce dependencies on them.

                                                                                                                                                                                Dependency selection does not inspect type or declaration types. Declaration types are copied unchanged into the let bindings, so they must not refer to the hoisted free variables being bound. Every selected declaration must have a value; otherwise, throws an internal error.

                                                                                                                                                                                The body of the let bindings is an application of a fresh delayed-assigned metavariable whose pending metavariable is assigned e. This postpones abstraction of the selected free variables in e until the delayed assignment is resolved, without instantiating e here. Returns e unchanged if no declarations are selected.

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

                                                                                                                                                                                  Sets nextDeclIdx to point past the last local declaration in the local context.

                                                                                                                                                                                  This marks all existing local declarations as already processed by grind. Use this when initializing a goal whose hypotheses should not be processed or after internalizing all of them.

                                                                                                                                                                                  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 the goal has local declarations that have not yet been processed by grind.

                                                                                                                                                                                      A local declaration is "pending" if its index is greater than or equal to nextDeclIdx. This is used to determine whether grind needs to internalize new hypotheses.

                                                                                                                                                                                      Equations
                                                                                                                                                                                      Instances For

                                                                                                                                                                                        Sets the provenance of the local variables introduced next in goal. See GoalState.introBase.

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

                                                                                                                                                                                          Assigns the anchor of a local variable just introduced in the current goal.

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

                                                                                                                                                                                            Assigns the anchors of the local variables in the initial local context of a goal. Variables are distinguished by their name and their rank among the variables with the same base name (i.e., without macro scopes), e.g., a hidden x✝ or a shadowed x. Variables that already have an anchor keep it, since goals may be created during a run (e.g., by vcgen).

                                                                                                                                                                                            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

                                                                                                                                                                                                Macro similar to trace[...], but it includes the trace message trace[grind] "working on <current goal>" if the tag has changed since the last trace message.

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

                                                                                                                                                                                                  A helper function used to mark a theorem instance found by the E-matching module. It returns true if it is a new instance and false otherwise.

                                                                                                                                                                                                  Equations
                                                                                                                                                                                                  • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                  Instances For
                                                                                                                                                                                                    def Lean.Meta.Grind.addNewRawFact (proof prop : Expr) (generation : Nat) (splitSource : SplitSource) (ematchDiagSource : EMatchDiagSource) :

                                                                                                                                                                                                    Adds a new fact prop with proof proof to the queue for preprocessing and the assertion.

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

                                                                                                                                                                                                      Returns the number of theorem instances generated so far.

                                                                                                                                                                                                      Equations
                                                                                                                                                                                                      Instances For

                                                                                                                                                                                                        Returns true if the maximum number of instances has been reached.

                                                                                                                                                                                                        Equations
                                                                                                                                                                                                        Instances For

                                                                                                                                                                                                          Returns true if the maximum number of branches has been reached.

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

                                                                                                                                                                                                            Returns true if the maximum number of E-matching rounds has been reached.

                                                                                                                                                                                                            Equations
                                                                                                                                                                                                            Instances For

                                                                                                                                                                                                              Returns some n if e has already been "internalized" into the Otherwise, returns nones.

                                                                                                                                                                                                              Equations
                                                                                                                                                                                                              Instances For
                                                                                                                                                                                                                @[inline]

                                                                                                                                                                                                                Returns some n if e has already been "internalized" into the Otherwise, returns nones.

                                                                                                                                                                                                                Equations
                                                                                                                                                                                                                Instances For
                                                                                                                                                                                                                  Equations
                                                                                                                                                                                                                  Instances For

                                                                                                                                                                                                                    Returns node associated with e. It assumes e has already been internalized.

                                                                                                                                                                                                                    Equations
                                                                                                                                                                                                                    Instances For
                                                                                                                                                                                                                      @[inline]

                                                                                                                                                                                                                      Returns node associated with e. It assumes e has already been internalized.

                                                                                                                                                                                                                      Equations
                                                                                                                                                                                                                      Instances For
                                                                                                                                                                                                                        Equations
                                                                                                                                                                                                                        Instances For

                                                                                                                                                                                                                          Returns the generation of the given term. Is assumes it has been internalized

                                                                                                                                                                                                                          Equations
                                                                                                                                                                                                                          Instances For

                                                                                                                                                                                                                            Returns true if e is in the equivalence class of True.

                                                                                                                                                                                                                            Equations
                                                                                                                                                                                                                            Instances For

                                                                                                                                                                                                                              Returns true if e is in the equivalence class of False.

                                                                                                                                                                                                                              Equations
                                                                                                                                                                                                                              Instances For

                                                                                                                                                                                                                                Returns true if e is in the equivalence class of Bool.true.

                                                                                                                                                                                                                                Equations
                                                                                                                                                                                                                                Instances For

                                                                                                                                                                                                                                  Returns true if e is in the equivalence class of Bool.false.

                                                                                                                                                                                                                                  Equations
                                                                                                                                                                                                                                  Instances For

                                                                                                                                                                                                                                    Returns true if a and b are in the same equivalence class.

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

                                                                                                                                                                                                                                      Returns true if the root of its equivalence class.

                                                                                                                                                                                                                                      Equations
                                                                                                                                                                                                                                      Instances For

                                                                                                                                                                                                                                        Returns the root element in the equivalence class of e IF e has been internalized.

                                                                                                                                                                                                                                        Equations
                                                                                                                                                                                                                                        Instances For
                                                                                                                                                                                                                                          @[inline]

                                                                                                                                                                                                                                          Returns the root element in the equivalence class of e IF e has been internalized.

                                                                                                                                                                                                                                          Equations
                                                                                                                                                                                                                                          Instances For

                                                                                                                                                                                                                                            Returns the root element in the equivalence class of e.

                                                                                                                                                                                                                                            Equations
                                                                                                                                                                                                                                            Instances For
                                                                                                                                                                                                                                              @[inline]

                                                                                                                                                                                                                                              Returns the root element in the equivalence class of e.

                                                                                                                                                                                                                                              Equations
                                                                                                                                                                                                                                              Instances For

                                                                                                                                                                                                                                                Returns the root enode in the equivalence class of e.

                                                                                                                                                                                                                                                Equations
                                                                                                                                                                                                                                                Instances For

                                                                                                                                                                                                                                                  Returns the root enode in the equivalence class of e if it is in an equivalence class.

                                                                                                                                                                                                                                                  Equations
                                                                                                                                                                                                                                                  Instances For

                                                                                                                                                                                                                                                    Returns true if the ENode associate with e has support for function equality congruence closure. See Grind.Config.funCC for additional details.

                                                                                                                                                                                                                                                    Equations
                                                                                                                                                                                                                                                    Instances For

                                                                                                                                                                                                                                                      Returns the next element in the equivalence class of e if e has been internalized in the given goal.

                                                                                                                                                                                                                                                      Equations
                                                                                                                                                                                                                                                      Instances For

                                                                                                                                                                                                                                                        Returns the next element in the equivalence class of e.

                                                                                                                                                                                                                                                        Equations
                                                                                                                                                                                                                                                        Instances For
                                                                                                                                                                                                                                                          @[inline]

                                                                                                                                                                                                                                                          Returns the root element in the equivalence class of e.

                                                                                                                                                                                                                                                          Equations
                                                                                                                                                                                                                                                          Instances For

                                                                                                                                                                                                                                                            Returns true if e has already been internalized.

                                                                                                                                                                                                                                                            Equations
                                                                                                                                                                                                                                                            Instances For
                                                                                                                                                                                                                                                              Equations
                                                                                                                                                                                                                                                              Instances For
                                                                                                                                                                                                                                                                @[inline]
                                                                                                                                                                                                                                                                Equations
                                                                                                                                                                                                                                                                Instances For
                                                                                                                                                                                                                                                                  def Lean.Meta.Grind.pushEqCore (lhs rhs proof : Expr) (isHEq : Bool) :

                                                                                                                                                                                                                                                                  If isHEq is false, it pushes lhs = rhs with proof to newEqs. Otherwise, it pushes lhs ≍ rhs.

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

                                                                                                                                                                                                                                                                    Return true if a and b have the same type.

                                                                                                                                                                                                                                                                    Equations
                                                                                                                                                                                                                                                                    Instances For

                                                                                                                                                                                                                                                                      Similar to hasSameType, but uses instances transparency. hasSameType may be exponential when the types are equal only modulo the E-graph, e.g., Fin (a.set! i v).size and Fin a.size. Use hasSameTypeI where a false answer is acceptable, e.g., using HEq, missing a congruence, or not propagating an equality to a solver.

                                                                                                                                                                                                                                                                      Equations
                                                                                                                                                                                                                                                                      Instances For
                                                                                                                                                                                                                                                                        @[inline]
                                                                                                                                                                                                                                                                        def Lean.Meta.Grind.pushEqHEq (lhs rhs proof : Expr) :

                                                                                                                                                                                                                                                                        Pushes lhs = rhs if hasSameTypeI lhs rhs, and lhs ≍ rhs otherwise. If the types are definitionally equal only with default transparency, we push lhs ≍ rhs. This is valid, but marks the equivalence class with heqProofs: its proofs use HEq, E-matching visits all its terms, and solvers only receive equalities between its terms whose types pass hasSameTypeI.

                                                                                                                                                                                                                                                                        Equations
                                                                                                                                                                                                                                                                        • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                                                                                        Instances For
                                                                                                                                                                                                                                                                          @[inline]
                                                                                                                                                                                                                                                                          def Lean.Meta.Grind.pushEq (lhs rhs proof : Expr) :

                                                                                                                                                                                                                                                                          Pushes lhs = rhs with proof to newEqs.

                                                                                                                                                                                                                                                                          Equations
                                                                                                                                                                                                                                                                          Instances For

                                                                                                                                                                                                                                                                            Queues the upward propagation of e. See ToProcessElement.propagateUp.

                                                                                                                                                                                                                                                                            Equations
                                                                                                                                                                                                                                                                            • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                                                                                            Instances For
                                                                                                                                                                                                                                                                              def Lean.Meta.Grind.pushInternalizeRhsAddEq (lhs rhs proof : Expr) (generation : Nat) :

                                                                                                                                                                                                                                                                              Queues the internalization of rhs and the equality lhs = rhs. See ToProcessElement.internalizeRhsAddEq.

                                                                                                                                                                                                                                                                              Equations
                                                                                                                                                                                                                                                                              • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                                                                                              Instances For
                                                                                                                                                                                                                                                                                def Lean.Meta.Grind.pushNewFactCore (prop proof : Expr) (generation : Nat) :

                                                                                                                                                                                                                                                                                Queues the fact prop with the given proof, without preprocessing it. prop is internalized when the fact is processed, so this is the way to assert a fact about a term that must not be internalized yet. See GoalState.internalizing.

                                                                                                                                                                                                                                                                                Equations
                                                                                                                                                                                                                                                                                • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                                                                                                Instances For
                                                                                                                                                                                                                                                                                  @[inline]
                                                                                                                                                                                                                                                                                  def Lean.Meta.Grind.pushHEq (lhs rhs proof : Expr) :

                                                                                                                                                                                                                                                                                  Pushes lhs ≍ rhs with proof to newEqs.

                                                                                                                                                                                                                                                                                  Equations
                                                                                                                                                                                                                                                                                  Instances For

                                                                                                                                                                                                                                                                                    Pushes a = True with proof to newEqs.

                                                                                                                                                                                                                                                                                    Equations
                                                                                                                                                                                                                                                                                    Instances For

                                                                                                                                                                                                                                                                                      Pushes a = False with proof to newEqs.

                                                                                                                                                                                                                                                                                      Equations
                                                                                                                                                                                                                                                                                      Instances For

                                                                                                                                                                                                                                                                                        Pushes a = Bool.true with proof to newEqs.

                                                                                                                                                                                                                                                                                        Equations
                                                                                                                                                                                                                                                                                        Instances For

                                                                                                                                                                                                                                                                                          Pushes a = Bool.false with proof to newEqs.

                                                                                                                                                                                                                                                                                          Equations
                                                                                                                                                                                                                                                                                          Instances For

                                                                                                                                                                                                                                                                                            Records that parent is a parent of child. This function actually stores the information in the root (aka canonical representative) of child.

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

                                                                                                                                                                                                                                                                                              Returns the set of expressions e is a child of, or an expression in es equivalence class is a child of. The information is only up to date if e is the root (aka canonical representative) of the equivalence class.

                                                                                                                                                                                                                                                                                              Equations
                                                                                                                                                                                                                                                                                              Instances For

                                                                                                                                                                                                                                                                                                Removes the entry e ↦ parents from the parent map.

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

                                                                                                                                                                                                                                                                                                  Copy parents to the parents of root. root must be the root of its equivalence class.

                                                                                                                                                                                                                                                                                                  Equations
                                                                                                                                                                                                                                                                                                  • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                                                                                                                  Instances For
                                                                                                                                                                                                                                                                                                    def Lean.Meta.Grind.mkENodeCore (e : Expr) (interpreted ctor : Bool) (generation : Nat) (funCC : Bool) :
                                                                                                                                                                                                                                                                                                    Equations
                                                                                                                                                                                                                                                                                                    • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                                                                                                                    Instances For
                                                                                                                                                                                                                                                                                                      def Lean.Meta.Grind.mkENode (e : Expr) (generation : Nat) (funCC : Bool := false) :

                                                                                                                                                                                                                                                                                                      Creates an ENode for e if one does not already exist. This method assumes e has been hash-consed.

                                                                                                                                                                                                                                                                                                      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 type of t is definitionally equal to α

                                                                                                                                                                                                                                                                                                          Equations
                                                                                                                                                                                                                                                                                                          Instances For
                                                                                                                                                                                                                                                                                                            @[inline]

                                                                                                                                                                                                                                                                                                            For each equality b = c in parents, executes k b c IF

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

                                                                                                                                                                                                                                                                                                              Returns true is e is the root of its congruence class.

                                                                                                                                                                                                                                                                                                              Equations
                                                                                                                                                                                                                                                                                                              Instances For

                                                                                                                                                                                                                                                                                                                Returns the root of the congruence class containing e.

                                                                                                                                                                                                                                                                                                                Return true if the goal is inconsistent.

                                                                                                                                                                                                                                                                                                                Equations
                                                                                                                                                                                                                                                                                                                Instances For
                                                                                                                                                                                                                                                                                                                  @[extern lean_grind_mk_eq_proof]

                                                                                                                                                                                                                                                                                                                  Returns a proof that a = b. It assumes a and b are in the same equivalence class, and have the same type.

                                                                                                                                                                                                                                                                                                                  @[extern lean_grind_mk_heq_proof]

                                                                                                                                                                                                                                                                                                                  Returns a proof that a ≍ b. It assumes a and b are in the same equivalence class.

                                                                                                                                                                                                                                                                                                                  @[extern lean_grind_process_to_do]
                                                                                                                                                                                                                                                                                                                  @[extern lean_grind_internalize]
                                                                                                                                                                                                                                                                                                                  opaque Lean.Meta.Grind.internalize (e : Expr) (generation : Nat) (parent? : Option Expr := none) :
                                                                                                                                                                                                                                                                                                                  @[extern lean_grind_preprocess]

                                                                                                                                                                                                                                                                                                                  Internalizes a local declaration which is not a proposition. Note: We must internalize local variables because their types may be empty, and may not be referenced anywhere else. Example:

                                                                                                                                                                                                                                                                                                                  example (a : { x : Int // x < 0 ∧ x > 0 }) : False := by grind
                                                                                                                                                                                                                                                                                                                  

                                                                                                                                                                                                                                                                                                                  etaStruct may also be applicable.

                                                                                                                                                                                                                                                                                                                  Equations
                                                                                                                                                                                                                                                                                                                  Instances For

                                                                                                                                                                                                                                                                                                                    Returns a proof that a = b if they have the same type. Otherwise, returns a proof of a ≍ b. It assumes a and b are in the same equivalence class.

                                                                                                                                                                                                                                                                                                                    Equations
                                                                                                                                                                                                                                                                                                                    Instances For

                                                                                                                                                                                                                                                                                                                      Returns a proof that a = True. It assumes a and True are in the same equivalence class.

                                                                                                                                                                                                                                                                                                                      Equations
                                                                                                                                                                                                                                                                                                                      Instances For

                                                                                                                                                                                                                                                                                                                        Returns a proof that a = False. It assumes a and False are in the same equivalence class.

                                                                                                                                                                                                                                                                                                                        Equations
                                                                                                                                                                                                                                                                                                                        Instances For

                                                                                                                                                                                                                                                                                                                          Returns a proof that a = Bool.true. It assumes a and Bool.true are in the same equivalence class.

                                                                                                                                                                                                                                                                                                                          Equations
                                                                                                                                                                                                                                                                                                                          Instances For

                                                                                                                                                                                                                                                                                                                            Returns a proof that a = Bool.false. It assumes a and Bool.false are in the same equivalence class.

                                                                                                                                                                                                                                                                                                                            Equations
                                                                                                                                                                                                                                                                                                                            Instances For

                                                                                                                                                                                                                                                                                                                              Marks current goal as inconsistent without assigning mvarId.

                                                                                                                                                                                                                                                                                                                              Equations
                                                                                                                                                                                                                                                                                                                              • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                                                                                                                                              Instances For
                                                                                                                                                                                                                                                                                                                                def Lean.MVarId.assignFalseProof (mvarId : MVarId) (falseProof : Expr) :

                                                                                                                                                                                                                                                                                                                                Assign the mvarId using the given proof of False. If type of mvarId is not False, then use False.elim.

                                                                                                                                                                                                                                                                                                                                Equations
                                                                                                                                                                                                                                                                                                                                • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                                                                                                                                                Instances For
                                                                                                                                                                                                                                                                                                                                  @[inline]
                                                                                                                                                                                                                                                                                                                                  def Lean.Meta.Grind.Goal.withContext {m : Type → Type u_1} {α : Type} [MonadControlT MetaM m] [Monad m] (goal : Goal) :
                                                                                                                                                                                                                                                                                                                                  m α → m α

                                                                                                                                                                                                                                                                                                                                  goal.withContext x executes x using the given metavariable LocalContext and LocalInstances. The type class resolution cache is flushed when executing x if its LocalInstances are different from the current ones.

                                                                                                                                                                                                                                                                                                                                  Equations
                                                                                                                                                                                                                                                                                                                                  Instances For

                                                                                                                                                                                                                                                                                                                                    Creates an auxiliary metavariable with the same type and context of goal.mvarId. We use this function to perform cases on the current goal without eagerly assigning it.

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

                                                                                                                                                                                                                                                                                                                                      Closes the current goal using the given proof of False and marks it as inconsistent if it is not already marked so.

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

                                                                                                                                                                                                                                                                                                                                        Returns all enodes in the goal

                                                                                                                                                                                                                                                                                                                                        Equations
                                                                                                                                                                                                                                                                                                                                        Instances For
                                                                                                                                                                                                                                                                                                                                          @[inline]

                                                                                                                                                                                                                                                                                                                                          Executes f to each term in the equivalence class containing e

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

                                                                                                                                                                                                                                                                                                                                            Executes f to each term in the equivalence class containing e, and stops as soon as f returns true.

                                                                                                                                                                                                                                                                                                                                            Equations
                                                                                                                                                                                                                                                                                                                                            • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                                                                                                                                                            Instances For
                                                                                                                                                                                                                                                                                                                                              @[inline]
                                                                                                                                                                                                                                                                                                                                              def Lean.Meta.Grind.foldEqc {α : Type} (e : Expr) (init : α) (f : ENode → α → GoalM α) :

                                                                                                                                                                                                                                                                                                                                              Folds using f and init over the equivalence class containing e

                                                                                                                                                                                                                                                                                                                                              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
                                                                                                                                                                                                                                                                                                                                                    • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                                                                                                                                                                    Instances For
                                                                                                                                                                                                                                                                                                                                                      Instances For
                                                                                                                                                                                                                                                                                                                                                        def Lean.Meta.Grind.evalTactic (goal : Goal) (stx : TSyntax `grind) :
                                                                                                                                                                                                                                                                                                                                                        Equations
                                                                                                                                                                                                                                                                                                                                                        Instances For
                                                                                                                                                                                                                                                                                                                                                          def Lean.Meta.Grind.Goal.getEqc (goal : Goal) (e : Expr) (sort : Bool := false) :

                                                                                                                                                                                                                                                                                                                                                          Returns expressions in the given expression equivalence class.

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

                                                                                                                                                                                                                                                                                                                                                            Returns expressions in the given expression equivalence class.

                                                                                                                                                                                                                                                                                                                                                            Equations
                                                                                                                                                                                                                                                                                                                                                            Instances For

                                                                                                                                                                                                                                                                                                                                                              Returns all equivalence classes in the current goal.

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

                                                                                                                                                                                                                                                                                                                                                                Returns all equivalence classes in the current goal.

                                                                                                                                                                                                                                                                                                                                                                Equations
                                                                                                                                                                                                                                                                                                                                                                Instances For

                                                                                                                                                                                                                                                                                                                                                                  Returns true if s has been already added to the case-split list at one point. Remark: this function returns true even if the split has already been resolved and is not in the list anymore.

                                                                                                                                                                                                                                                                                                                                                                  Equations
                                                                                                                                                                                                                                                                                                                                                                  Instances For

                                                                                                                                                                                                                                                                                                                                                                    Returns true if e is a case-split that does not need to be performed anymore.

                                                                                                                                                                                                                                                                                                                                                                    Equations
                                                                                                                                                                                                                                                                                                                                                                    Instances For

                                                                                                                                                                                                                                                                                                                                                                      Marks e as a case-split that does not need to be performed anymore. Remark: we currently use this feature to disable match-case-splits. Remark: we also use this feature to record the case-splits that have already been performed.

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

                                                                                                                                                                                                                                                                                                                                                                        Inserts e into the list of case-split candidates if it was not inserted before.

                                                                                                                                                                                                                                                                                                                                                                        Equations
                                                                                                                                                                                                                                                                                                                                                                        • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                                                                                                                                                                                        Instances For
                                                                                                                                                                                                                                                                                                                                                                          def Lean.Meta.Grind.addTheoremInstance (thm : EMatchTheorem) (proof prop : Expr) (generation : Nat) (guards : List TheoremGuard) (sources : List EMatchDiagNode) :

                                                                                                                                                                                                                                                                                                                                                                          Adds a new theorem instance produced using E-matching.

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

                                                                                                                                                                                                                                                                                                                                                                              Returns extensionality theorems for the given type if available. If Config.ext is false, the result is #[].

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

                                                                                                                                                                                                                                                                                                                                                                                Add a new lookahead candidate.

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

                                                                                                                                                                                                                                                                                                                                                                                  Helper function for executing x with a fresh toProcess and without modifying the goal state.

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

                                                                                                                                                                                                                                                                                                                                                                                    Action is the control interface for grind’s search steps. It is defined in Continuation-Passing Style (CPS). See Grind/Action.lean for additional details.

                                                                                                                                                                                                                                                                                                                                                                                    @[reducible, inline]
                                                                                                                                                                                                                                                                                                                                                                                    Equations
                                                                                                                                                                                                                                                                                                                                                                                    Instances For

                                                                                                                                                                                                                                                                                                                                                                                      Result type for a grind Action

                                                                                                                                                                                                                                                                                                                                                                                      • closed (seq : List TGrind) : ActionResult

                                                                                                                                                                                                                                                                                                                                                                                        The goal has been closed, and you can use seq to close the goal efficiently.

                                                                                                                                                                                                                                                                                                                                                                                      • stuck (gs : List Goal) : ActionResult

                                                                                                                                                                                                                                                                                                                                                                                        The action could not make further progress. gs are subgoals that could not be closed. They are used for producing error messages.

                                                                                                                                                                                                                                                                                                                                                                                      Instances For

                                                                                                                                                                                                                                                                                                                                                                                        Solver Extensions

                                                                                                                                                                                                                                                                                                                                                                                        Solver extension, can only be generated by registerSolverExtension that allocates a unique index for this extension into each goal's extension state's array.

                                                                                                                                                                                                                                                                                                                                                                                        Instances For

                                                                                                                                                                                                                                                                                                                                                                                          Registers a new solver extension for grind. Solver extensions can only be registered during initialization. Reason: We do not use any synchronization primitive to access solverExtensionsRef.

                                                                                                                                                                                                                                                                                                                                                                                          Equations
                                                                                                                                                                                                                                                                                                                                                                                          • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                                                                                                                                                                                                          Instances For
                                                                                                                                                                                                                                                                                                                                                                                            def Lean.Meta.Grind.SolverExtension.setMethods {σ : Type} (ext : SolverExtension σ) (enabled : Grind.Config → Bool := fun (x : Grind.Config) => true) (internalize : Expr → Option Expr → GoalM Unit := fun (x : Expr) (x_1 : Option Expr) => pure ()) (newEq newDiseq : Expr → Expr → GoalM Unit := fun (x x_1 : Expr) => pure ()) (mbtc : GoalM Bool := pure false) (action : Action := Action.notApplicable) (check : GoalM Bool := pure false) (checkInv : GoalM Unit := pure ()) :

                                                                                                                                                                                                                                                                                                                                                                                            Sets methods/handlers for solver extension ext. Solver extension methods can only be registered during initialization. Reason: We do not use any synchronization primitive to access solverExtensionsRef.

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

                                                                                                                                                                                                                                                                                                                                                                                              Returns initial state for registered solvers.

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

                                                                                                                                                                                                                                                                                                                                                                                                Returns the ids of the solver extensions that config enables.

                                                                                                                                                                                                                                                                                                                                                                                                Equations
                                                                                                                                                                                                                                                                                                                                                                                                • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                                                                                                                                                                                                                Instances For
                                                                                                                                                                                                                                                                                                                                                                                                  @[instance_reducible]
                                                                                                                                                                                                                                                                                                                                                                                                  Equations
                                                                                                                                                                                                                                                                                                                                                                                                  @[implemented_by _private.Lean.Meta.Tactic.Grind.Types.0.Lean.Meta.Grind.SolverExtension.modifyStateImpl]
                                                                                                                                                                                                                                                                                                                                                                                                  @[implemented_by _private.Lean.Meta.Tactic.Grind.Types.0.Lean.Meta.Grind.SolverExtension.getStateCoreImpl]
                                                                                                                                                                                                                                                                                                                                                                                                  Equations
                                                                                                                                                                                                                                                                                                                                                                                                  Instances For

                                                                                                                                                                                                                                                                                                                                                                                                    Internalizes given expression in all active solvers.

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

                                                                                                                                                                                                                                                                                                                                                                                                      Checks invariants of all active solvers.

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

                                                                                                                                                                                                                                                                                                                                                                                                        Performs (expensive) satisfiability checks in all active solvers, and returns the solver ids that made progress.

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

                                                                                                                                                                                                                                                                                                                                                                                                          Invokes model-based theory combination extensions in all active solvers.

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

                                                                                                                                                                                                                                                                                                                                                                                                            Sequential conjunction: executes both x and y.

                                                                                                                                                                                                                                                                                                                                                                                                            • Runs x and always runs y afterward, regardless of whether x made progress.
                                                                                                                                                                                                                                                                                                                                                                                                            • It is not applicable only if both x and y are not applicable.
                                                                                                                                                                                                                                                                                                                                                                                                            Equations
                                                                                                                                                                                                                                                                                                                                                                                                            Instances For

                                                                                                                                                                                                                                                                                                                                                                                                              Combines the active solver extensions into a single action using Action.andAlso. Does not drain newRawFacts; use Solvers.mkAction (defined in Intro.lean) which wraps this with assertAll.

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

                                                                                                                                                                                                                                                                                                                                                                                                                Given a new disequality lhs ≠ rhs, propagates it to relevant theories.

                                                                                                                                                                                                                                                                                                                                                                                                                Equations
                                                                                                                                                                                                                                                                                                                                                                                                                • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                                                                                                                                                                                                                                Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                  def Lean.Meta.Grind.Solvers.newEq (solverId : Nat) (lhs rhs : Expr) :

                                                                                                                                                                                                                                                                                                                                                                                                                  Runs the queued newEq callback. See ToProcessElement.solverEq.

                                                                                                                                                                                                                                                                                                                                                                                                                  Equations
                                                                                                                                                                                                                                                                                                                                                                                                                  Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                    def Lean.Meta.Grind.Solvers.newDiseq (solverId : Nat) (lhs rhs : Expr) :

                                                                                                                                                                                                                                                                                                                                                                                                                    Runs the queued newDiseq callback. See ToProcessElement.solverDiseq.

                                                                                                                                                                                                                                                                                                                                                                                                                    Equations
                                                                                                                                                                                                                                                                                                                                                                                                                    Instances For

                                                                                                                                                                                                                                                                                                                                                                                                                      Registers e as a term of the solver ext. If the equivalence class of e already has a term e' of this solver with the same type, the solver learns e = e'. Otherwise, e becomes a representative of the class, and if a class disequal to it has a term of this solver, the solver learns that disequality. These callbacks are queued, not run here: markTerm is called from internalize hooks, where the callbacks must not internalize new terms yet. See ToProcessElement.solverEq and GoalState.internalizing.

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

                                                                                                                                                                                                                                                                                                                                                                                                                        Returns some t if t is the solver term for ext associated with e. If the equivalence class of e contains terms of different types, t is one of the representatives of ext.

                                                                                                                                                                                                                                                                                                                                                                                                                        Equations
                                                                                                                                                                                                                                                                                                                                                                                                                        Instances For

                                                                                                                                                                                                                                                                                                                                                                                                                          Returns true if the root of es equivalence class is already attached to a term of the given solver.

                                                                                                                                                                                                                                                                                                                                                                                                                          Equations
                                                                                                                                                                                                                                                                                                                                                                                                                          Instances For

                                                                                                                                                                                                                                                                                                                                                                                                                            Merges the solver terms of lhsRoot into rhsRoot, the root of the merged class. heqProofs := true if the merged class contains heterogeneous equalities.

                                                                                                                                                                                                                                                                                                                                                                                                                            Equations
                                                                                                                                                                                                                                                                                                                                                                                                                            • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                                                                                                                                                                                                                                            Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                              def Lean.Meta.Grind.anchorPrefixToString (numDigits : Nat) (anchorPrefix : UInt64) :
                                                                                                                                                                                                                                                                                                                                                                                                                              Equations
                                                                                                                                                                                                                                                                                                                                                                                                                              • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                                                                                                                                                                                                                                              Instances For
                                                                                                                                                                                                                                                                                                                                                                                                                                def Lean.Meta.Grind.anchorToString (numDigits : Nat) (anchor : UInt64) :
                                                                                                                                                                                                                                                                                                                                                                                                                                Equations
                                                                                                                                                                                                                                                                                                                                                                                                                                Instances For

                                                                                                                                                                                                                                                                                                                                                                                                                                  Returns activated match-declaration equations. Recall that in tactics such as instantiate only [...], match-declarations are always instantiated.

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