File: Mathlib/Tactic/FunProp/RefinedDiscrTree.lean

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.Key.bvar
code: /-- Discrimination tree key. -/
inductive Key where
  /-- A metavariable. This key matches with anything. It stores an index. -/
  | star : Nat → Key
  /-- An opaque variable. This key only matches with itself or `Key.star`. -/
  | opaque : Key
  /-- A constant. It stores the name and the arity. -/
  | const : Name → Nat → Key
  /-- A free variable. It stores the `FVarId` and the arity. -/
  | fvar : FVarId → Nat → Key
  /-- A bound variable, from a lambda or forall binder.
  It stores the De Bruijn index and the arity. -/
  | bvar : Nat → Nat → Key
  /-- A literal. -/
  | lit : Literal → Key
  /-- A sort. Universe levels are ignored. -/
  | sort : Key
  /-- A lambda function. -/
  | lam : Key
  /-- A dependent arrow. -/
  | forall : Key
  /-- A projection. It stores the structure name, the projection index and the arity. -/
  | proj : Name → Nat → Nat → Key
  deriving Inhabited, BEq, Repr
goal: ℕ → ℕ → Mathlib.Meta.FunProp.RefinedDiscrTree.Key

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.instBEqKey
code: /-- Discrimination tree key. -/
inductive Key where
  /-- A metavariable. This key matches with anything. It stores an index. -/
  | star : Nat → Key
  /-- An opaque variable. This key only matches with itself or `Key.star`. -/
  | opaque : Key
  /-- A constant. It stores the name and the arity. -/
  | const : Name → Nat → Key
  /-- A free variable. It stores the `FVarId` and the arity. -/
  | fvar : FVarId → Nat → Key
  /-- A bound variable, from a lambda or forall binder.
  It stores the De Bruijn index and the arity. -/
  | bvar : Nat → Nat → Key
  /-- A literal. -/
  | lit : Literal → Key
  /-- A sort. Universe levels are ignored. -/
  | sort : Key
  /-- A lambda function. -/
  | lam : Key
  /-- A dependent arrow. -/
  | forall : Key
  /-- A projection. It stores the structure name, the projection index and the arity. -/
  | proj : Name → Nat → Nat → Key
  deriving Inhabited, BEq, Repr
goal: BEq Mathlib.Meta.FunProp.RefinedDiscrTree.Key

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.instInhabitedKey
code: /-- Discrimination tree key. -/
inductive Key where
  /-- A metavariable. This key matches with anything. It stores an index. -/
  | star : Nat → Key
  /-- An opaque variable. This key only matches with itself or `Key.star`. -/
  | opaque : Key
  /-- A constant. It stores the name and the arity. -/
  | const : Name → Nat → Key
  /-- A free variable. It stores the `FVarId` and the arity. -/
  | fvar : FVarId → Nat → Key
  /-- A bound variable, from a lambda or forall binder.
  It stores the De Bruijn index and the arity. -/
  | bvar : Nat → Nat → Key
  /-- A literal. -/
  | lit : Literal → Key
  /-- A sort. Universe levels are ignored. -/
  | sort : Key
  /-- A lambda function. -/
  | lam : Key
  /-- A dependent arrow. -/
  | forall : Key
  /-- A projection. It stores the structure name, the projection index and the arity. -/
  | proj : Name → Nat → Nat → Key
  deriving Inhabited, BEq, Repr
goal: Inhabited Mathlib.Meta.FunProp.RefinedDiscrTree.Key

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.Key.const
code: /-- Discrimination tree key. -/
inductive Key where
  /-- A metavariable. This key matches with anything. It stores an index. -/
  | star : Nat → Key
  /-- An opaque variable. This key only matches with itself or `Key.star`. -/
  | opaque : Key
  /-- A constant. It stores the name and the arity. -/
  | const : Name → Nat → Key
  /-- A free variable. It stores the `FVarId` and the arity. -/
  | fvar : FVarId → Nat → Key
  /-- A bound variable, from a lambda or forall binder.
  It stores the De Bruijn index and the arity. -/
  | bvar : Nat → Nat → Key
  /-- A literal. -/
  | lit : Literal → Key
  /-- A sort. Universe levels are ignored. -/
  | sort : Key
  /-- A lambda function. -/
  | lam : Key
  /-- A dependent arrow. -/
  | forall : Key
  /-- A projection. It stores the structure name, the projection index and the arity. -/
  | proj : Name → Nat → Nat → Key
  deriving Inhabited, BEq, Repr
goal: Lean.Name → ℕ → Mathlib.Meta.FunProp.RefinedDiscrTree.Key

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.Key.lit
code: /-- Discrimination tree key. -/
inductive Key where
  /-- A metavariable. This key matches with anything. It stores an index. -/
  | star : Nat → Key
  /-- An opaque variable. This key only matches with itself or `Key.star`. -/
  | opaque : Key
  /-- A constant. It stores the name and the arity. -/
  | const : Name → Nat → Key
  /-- A free variable. It stores the `FVarId` and the arity. -/
  | fvar : FVarId → Nat → Key
  /-- A bound variable, from a lambda or forall binder.
  It stores the De Bruijn index and the arity. -/
  | bvar : Nat → Nat → Key
  /-- A literal. -/
  | lit : Literal → Key
  /-- A sort. Universe levels are ignored. -/
  | sort : Key
  /-- A lambda function. -/
  | lam : Key
  /-- A dependent arrow. -/
  | forall : Key
  /-- A projection. It stores the structure name, the projection index and the arity. -/
  | proj : Name → Nat → Nat → Key
  deriving Inhabited, BEq, Repr
goal: Lean.Literal → Mathlib.Meta.FunProp.RefinedDiscrTree.Key

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.instReprKey
code: /-- Discrimination tree key. -/
inductive Key where
  /-- A metavariable. This key matches with anything. It stores an index. -/
  | star : Nat → Key
  /-- An opaque variable. This key only matches with itself or `Key.star`. -/
  | opaque : Key
  /-- A constant. It stores the name and the arity. -/
  | const : Name → Nat → Key
  /-- A free variable. It stores the `FVarId` and the arity. -/
  | fvar : FVarId → Nat → Key
  /-- A bound variable, from a lambda or forall binder.
  It stores the De Bruijn index and the arity. -/
  | bvar : Nat → Nat → Key
  /-- A literal. -/
  | lit : Literal → Key
  /-- A sort. Universe levels are ignored. -/
  | sort : Key
  /-- A lambda function. -/
  | lam : Key
  /-- A dependent arrow. -/
  | forall : Key
  /-- A projection. It stores the structure name, the projection index and the arity. -/
  | proj : Name → Nat → Nat → Key
  deriving Inhabited, BEq, Repr
goal: Repr Mathlib.Meta.FunProp.RefinedDiscrTree.Key

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.Key.proj
code: /-- Discrimination tree key. -/
inductive Key where
  /-- A metavariable. This key matches with anything. It stores an index. -/
  | star : Nat → Key
  /-- An opaque variable. This key only matches with itself or `Key.star`. -/
  | opaque : Key
  /-- A constant. It stores the name and the arity. -/
  | const : Name → Nat → Key
  /-- A free variable. It stores the `FVarId` and the arity. -/
  | fvar : FVarId → Nat → Key
  /-- A bound variable, from a lambda or forall binder.
  It stores the De Bruijn index and the arity. -/
  | bvar : Nat → Nat → Key
  /-- A literal. -/
  | lit : Literal → Key
  /-- A sort. Universe levels are ignored. -/
  | sort : Key
  /-- A lambda function. -/
  | lam : Key
  /-- A dependent arrow. -/
  | forall : Key
  /-- A projection. It stores the structure name, the projection index and the arity. -/
  | proj : Name → Nat → Nat → Key
  deriving Inhabited, BEq, Repr
goal: Lean.Name → ℕ → ℕ → Mathlib.Meta.FunProp.RefinedDiscrTree.Key

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.Key
code: /-- Discrimination tree key. -/
inductive Key where
  /-- A metavariable. This key matches with anything. It stores an index. -/
  | star : Nat → Key
  /-- An opaque variable. This key only matches with itself or `Key.star`. -/
  | opaque : Key
  /-- A constant. It stores the name and the arity. -/
  | const : Name → Nat → Key
  /-- A free variable. It stores the `FVarId` and the arity. -/
  | fvar : FVarId → Nat → Key
  /-- A bound variable, from a lambda or forall binder.
  It stores the De Bruijn index and the arity. -/
  | bvar : Nat → Nat → Key
  /-- A literal. -/
  | lit : Literal → Key
  /-- A sort. Universe levels are ignored. -/
  | sort : Key
  /-- A lambda function. -/
  | lam : Key
  /-- A dependent arrow. -/
  | forall : Key
  /-- A projection. It stores the structure name, the projection index and the arity. -/
  | proj : Name → Nat → Nat → Key
  deriving Inhabited, BEq, Repr
goal: Type

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.Key.sort
code: /-- Discrimination tree key. -/
inductive Key where
  /-- A metavariable. This key matches with anything. It stores an index. -/
  | star : Nat → Key
  /-- An opaque variable. This key only matches with itself or `Key.star`. -/
  | opaque : Key
  /-- A constant. It stores the name and the arity. -/
  | const : Name → Nat → Key
  /-- A free variable. It stores the `FVarId` and the arity. -/
  | fvar : FVarId → Nat → Key
  /-- A bound variable, from a lambda or forall binder.
  It stores the De Bruijn index and the arity. -/
  | bvar : Nat → Nat → Key
  /-- A literal. -/
  | lit : Literal → Key
  /-- A sort. Universe levels are ignored. -/
  | sort : Key
  /-- A lambda function. -/
  | lam : Key
  /-- A dependent arrow. -/
  | forall : Key
  /-- A projection. It stores the structure name, the projection index and the arity. -/
  | proj : Name → Nat → Nat → Key
  deriving Inhabited, BEq, Repr
goal: Mathlib.Meta.FunProp.RefinedDiscrTree.Key

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.Key.opaque
code: /-- Discrimination tree key. -/
inductive Key where
  /-- A metavariable. This key matches with anything. It stores an index. -/
  | star : Nat → Key
  /-- An opaque variable. This key only matches with itself or `Key.star`. -/
  | opaque : Key
  /-- A constant. It stores the name and the arity. -/
  | const : Name → Nat → Key
  /-- A free variable. It stores the `FVarId` and the arity. -/
  | fvar : FVarId → Nat → Key
  /-- A bound variable, from a lambda or forall binder.
  It stores the De Bruijn index and the arity. -/
  | bvar : Nat → Nat → Key
  /-- A literal. -/
  | lit : Literal → Key
  /-- A sort. Universe levels are ignored. -/
  | sort : Key
  /-- A lambda function. -/
  | lam : Key
  /-- A dependent arrow. -/
  | forall : Key
  /-- A projection. It stores the structure name, the projection index and the arity. -/
  | proj : Name → Nat → Nat → Key
  deriving Inhabited, BEq, Repr
goal: Mathlib.Meta.FunProp.RefinedDiscrTree.Key

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.Key.lam
code: /-- Discrimination tree key. -/
inductive Key where
  /-- A metavariable. This key matches with anything. It stores an index. -/
  | star : Nat → Key
  /-- An opaque variable. This key only matches with itself or `Key.star`. -/
  | opaque : Key
  /-- A constant. It stores the name and the arity. -/
  | const : Name → Nat → Key
  /-- A free variable. It stores the `FVarId` and the arity. -/
  | fvar : FVarId → Nat → Key
  /-- A bound variable, from a lambda or forall binder.
  It stores the De Bruijn index and the arity. -/
  | bvar : Nat → Nat → Key
  /-- A literal. -/
  | lit : Literal → Key
  /-- A sort. Universe levels are ignored. -/
  | sort : Key
  /-- A lambda function. -/
  | lam : Key
  /-- A dependent arrow. -/
  | forall : Key
  /-- A projection. It stores the structure name, the projection index and the arity. -/
  | proj : Name → Nat → Nat → Key
  deriving Inhabited, BEq, Repr
goal: Mathlib.Meta.FunProp.RefinedDiscrTree.Key

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.Key.star
code: /-- Discrimination tree key. -/
inductive Key where
  /-- A metavariable. This key matches with anything. It stores an index. -/
  | star : Nat → Key
  /-- An opaque variable. This key only matches with itself or `Key.star`. -/
  | opaque : Key
  /-- A constant. It stores the name and the arity. -/
  | const : Name → Nat → Key
  /-- A free variable. It stores the `FVarId` and the arity. -/
  | fvar : FVarId → Nat → Key
  /-- A bound variable, from a lambda or forall binder.
  It stores the De Bruijn index and the arity. -/
  | bvar : Nat → Nat → Key
  /-- A literal. -/
  | lit : Literal → Key
  /-- A sort. Universe levels are ignored. -/
  | sort : Key
  /-- A lambda function. -/
  | lam : Key
  /-- A dependent arrow. -/
  | forall : Key
  /-- A projection. It stores the structure name, the projection index and the arity. -/
  | proj : Name → Nat → Nat → Key
  deriving Inhabited, BEq, Repr
goal: ℕ → Mathlib.Meta.FunProp.RefinedDiscrTree.Key

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.Key.fvar
code: /-- Discrimination tree key. -/
inductive Key where
  /-- A metavariable. This key matches with anything. It stores an index. -/
  | star : Nat → Key
  /-- An opaque variable. This key only matches with itself or `Key.star`. -/
  | opaque : Key
  /-- A constant. It stores the name and the arity. -/
  | const : Name → Nat → Key
  /-- A free variable. It stores the `FVarId` and the arity. -/
  | fvar : FVarId → Nat → Key
  /-- A bound variable, from a lambda or forall binder.
  It stores the De Bruijn index and the arity. -/
  | bvar : Nat → Nat → Key
  /-- A literal. -/
  | lit : Literal → Key
  /-- A sort. Universe levels are ignored. -/
  | sort : Key
  /-- A lambda function. -/
  | lam : Key
  /-- A dependent arrow. -/
  | forall : Key
  /-- A projection. It stores the structure name, the projection index and the arity. -/
  | proj : Name → Nat → Nat → Key
  deriving Inhabited, BEq, Repr
goal: Lean.FVarId → ℕ → Mathlib.Meta.FunProp.RefinedDiscrTree.Key

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.Key.forall
code: /-- Discrimination tree key. -/
inductive Key where
  /-- A metavariable. This key matches with anything. It stores an index. -/
  | star : Nat → Key
  /-- An opaque variable. This key only matches with itself or `Key.star`. -/
  | opaque : Key
  /-- A constant. It stores the name and the arity. -/
  | const : Name → Nat → Key
  /-- A free variable. It stores the `FVarId` and the arity. -/
  | fvar : FVarId → Nat → Key
  /-- A bound variable, from a lambda or forall binder.
  It stores the De Bruijn index and the arity. -/
  | bvar : Nat → Nat → Key
  /-- A literal. -/
  | lit : Literal → Key
  /-- A sort. Universe levels are ignored. -/
  | sort : Key
  /-- A lambda function. -/
  | lam : Key
  /-- A dependent arrow. -/
  | forall : Key
  /-- A projection. It stores the structure name, the projection index and the arity. -/
  | proj : Name → Nat → Nat → Key
  deriving Inhabited, BEq, Repr
goal: Mathlib.Meta.FunProp.RefinedDiscrTree.Key

full_name: _private.Mathlib.Tactic.FunProp.RefinedDiscrTree.0.Mathlib.Meta.FunProp.RefinedDiscrTree.Key.hash
code: private nonrec def Key.hash : Key → UInt64
  
goal: Mathlib.Meta.FunProp.RefinedDiscrTree.Key → UInt64

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.instHashableKey
code: instance : Hashable Key 
goal: Hashable Mathlib.Meta.FunProp.RefinedDiscrTree.Key

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.Key.ctorIdx
code: /-- Constructor index used for ordering `Key`.
Note that the index of the star pattern is 0, so that when looking up in a `Trie`,
we can look at the start of the sorted array for all `.star` patterns. -/
def Key.ctorIdx : Key → Nat
  
goal: Mathlib.Meta.FunProp.RefinedDiscrTree.Key → ℕ

full_name: _private.Mathlib.Tactic.FunProp.RefinedDiscrTree.0.Mathlib.Meta.FunProp.RefinedDiscrTree.Key.lt
code: /-- The order on `Key` used in the `RefinedDiscrTree`. -/
private def Key.lt : Key → Key → Bool
  
goal: Mathlib.Meta.FunProp.RefinedDiscrTree.Key → Mathlib.Meta.FunProp.RefinedDiscrTree.Key → Bool

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.instLTKey
code: instance : LT Key 
goal: LT Mathlib.Meta.FunProp.RefinedDiscrTree.Key

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.instDecidableLtKey
code: instance (a b : Key) : Decidable (a < b) 
goal: Decidable (a < b)

full_name: _private.Mathlib.Tactic.FunProp.RefinedDiscrTree.0.Mathlib.Meta.FunProp.RefinedDiscrTree.Key.format
code: private def Key.format : Key → Format
  
goal: Mathlib.Meta.FunProp.RefinedDiscrTree.Key → Lean.Format

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.instToFormatKey
code: instance : ToFormat Key 
goal: Lean.ToFormat Mathlib.Meta.FunProp.RefinedDiscrTree.Key

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.Key.arity
code: /-- Return the number of arguments that the `Key` takes. -/
def Key.arity : Key → Nat
  
goal: Mathlib.Meta.FunProp.RefinedDiscrTree.Key → ℕ

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.Trie
code: /-- Discrimination tree trie. See `RefinedDiscrTree`. -/
inductive Trie (α : Type) where
  /-- Map from `Key` to `Trie`. Children is an `Array` of size at least 2,
  sorted in increasing order using `Key.lt`. -/
  | node (children : Array (Key × Trie α))
  /-- Sequence of nodes with only one child. `keys` is an `Array` of size at least 1. -/
  | path (keys : Array Key) (child : Trie α)
  /-- Leaf of the Trie. `values` is an `Array` of size at least 1. -/
  | values (vs : Array α)
goal: Type

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.Trie.node
code: /-- Discrimination tree trie. See `RefinedDiscrTree`. -/
inductive Trie (α : Type) where
  /-- Map from `Key` to `Trie`. Children is an `Array` of size at least 2,
  sorted in increasing order using `Key.lt`. -/
  | node (children : Array (Key × Trie α))
  /-- Sequence of nodes with only one child. `keys` is an `Array` of size at least 1. -/
  | path (keys : Array Key) (child : Trie α)
  /-- Leaf of the Trie. `values` is an `Array` of size at least 1. -/
  | values (vs : Array α)
goal: Mathlib.Meta.FunProp.RefinedDiscrTree.Trie α

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.Trie.path
code: /-- Discrimination tree trie. See `RefinedDiscrTree`. -/
inductive Trie (α : Type) where
  /-- Map from `Key` to `Trie`. Children is an `Array` of size at least 2,
  sorted in increasing order using `Key.lt`. -/
  | node (children : Array (Key × Trie α))
  /-- Sequence of nodes with only one child. `keys` is an `Array` of size at least 1. -/
  | path (keys : Array Key) (child : Trie α)
  /-- Leaf of the Trie. `values` is an `Array` of size at least 1. -/
  | values (vs : Array α)
goal: Mathlib.Meta.FunProp.RefinedDiscrTree.Trie α

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.Trie.values
code: /-- Discrimination tree trie. See `RefinedDiscrTree`. -/
inductive Trie (α : Type) where
  /-- Map from `Key` to `Trie`. Children is an `Array` of size at least 2,
  sorted in increasing order using `Key.lt`. -/
  | node (children : Array (Key × Trie α))
  /-- Sequence of nodes with only one child. `keys` is an `Array` of size at least 1. -/
  | path (keys : Array Key) (child : Trie α)
  /-- Leaf of the Trie. `values` is an `Array` of size at least 1. -/
  | values (vs : Array α)
goal: Mathlib.Meta.FunProp.RefinedDiscrTree.Trie α

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.instInhabitedTrie
code: instance : Inhabited (Trie α) 
goal: Inhabited (Mathlib.Meta.FunProp.RefinedDiscrTree.Trie α)

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.Trie.mkPath
code: /-- `Trie.path` constructor that only inserts the path if it is non-empty. -/
def Trie.mkPath (keys : Array Key) (child : Trie α) 
goal: Mathlib.Meta.FunProp.RefinedDiscrTree.Trie α

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.Trie.singleton
code: /-- `Trie` constructor for a single value, taking the keys starting at index `i`. -/
def Trie.singleton (keys : Array Key) (value : α) (i : Nat) : Trie α 
goal: Mathlib.Meta.FunProp.RefinedDiscrTree.Trie α

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.Trie.mkNode2
code: /-- `Trie.node` constructor for combining two `Key`, `Trie α` pairs. -/
def Trie.mkNode2 (k1 : Key) (t1 : Trie α) (k2 : Key) (t2 : Trie α) : Trie α 
goal: Mathlib.Meta.FunProp.RefinedDiscrTree.Trie α

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.Trie.values!
code: /-- Return the values from a `Trie α`, assuming that it is a leaf -/
def Trie.values! : Trie α → Array α
  
goal: Mathlib.Meta.FunProp.RefinedDiscrTree.Trie α → Array α

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.Trie.children!
code: /-- Return the children of a `Trie α`, assuming that it is not a leaf.
The result is sorted by the `Key`'s -/
def Trie.children! : Trie α → Array (Key × Trie α)
  
goal: Mathlib.Meta.FunProp.RefinedDiscrTree.Trie α →
  Array (Mathlib.Meta.FunProp.RefinedDiscrTree.Key × Mathlib.Meta.FunProp.RefinedDiscrTree.Trie α)

full_name: _private.Mathlib.Tactic.FunProp.RefinedDiscrTree.0.Mathlib.Meta.FunProp.RefinedDiscrTree.Trie.format.prepend
code: private partial def Trie.format [ToFormat α] : Trie α → Format
  
goal: Mathlib.Meta.FunProp.RefinedDiscrTree.Trie α

full_name: _private.Mathlib.Tactic.FunProp.RefinedDiscrTree.0.Mathlib.Meta.FunProp.RefinedDiscrTree.Trie.format
code: private partial def Trie.format [ToFormat α] : Trie α → Format
  
goal: Mathlib.Meta.FunProp.RefinedDiscrTree.Trie α → Lean.Format

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.instToFormatTrie
code: instance [ToFormat α] : ToFormat (Trie α) 
goal: Lean.ToFormat (Mathlib.Meta.FunProp.RefinedDiscrTree.Trie α)

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.root
code: /-- Discrimination tree. It is an index from expressions to values of type `α`. -/
structure _root_.Mathlib.Meta.FunProp.RefinedDiscrTree (α : Type) where
  /-- The underlying `PersistentHashMap` of a `RefinedDiscrTree`. -/
  root : PersistentHashMap Key (Trie α) := {}
goal: Lean.PersistentHashMap Mathlib.Meta.FunProp.RefinedDiscrTree.Key (Mathlib.Meta.FunProp.RefinedDiscrTree.Trie α)

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree
code: /-- Discrimination tree. It is an index from expressions to values of type `α`. -/
structure _root_.Mathlib.Meta.FunProp.RefinedDiscrTree (α : Type) where
  /-- The underlying `PersistentHashMap` of a `RefinedDiscrTree`. -/
  root : PersistentHashMap Key (Trie α) := {}
goal: Type

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.instInhabited
code: instance : Inhabited (RefinedDiscrTree α) 
goal: Inhabited (Mathlib.Meta.FunProp.RefinedDiscrTree α)

full_name: _private.Mathlib.Tactic.FunProp.RefinedDiscrTree.0.Mathlib.Meta.FunProp.RefinedDiscrTree.format
code: private partial def format [ToFormat α] (d : RefinedDiscrTree α) : Format 
goal: Lean.Format

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.instToFormat
code: instance [ToFormat α] : ToFormat (RefinedDiscrTree α) 
goal: Lean.ToFormat (Mathlib.Meta.FunProp.RefinedDiscrTree α)

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.DTExpr.opaque
code: /-- `DTExpr` is a simplified form of `Expr`.
It is the intermediate step for converting from `Expr` to `Array Key`. -/
inductive DTExpr where
  /-- A metavariable. It optionally stores an `MVarId`. -/
  | star : Option MVarId → DTExpr
  /-- An opaque variable or a let-expression in the case `WhnfCoreConfig.zeta := false`. -/
  | opaque : DTExpr
  /-- A constant. It stores the name and the arguments. -/
  | const : Name → Array DTExpr → DTExpr
  /-- A free variable. It stores the `FVarId` and the argumenst -/
  | fvar : FVarId → Array DTExpr → DTExpr
  /-- A bound variable. It stores the De Bruijn index and the arguments -/
  | bvar : Nat → Array DTExpr → DTExpr
  /-- A literal. -/
  | lit : Literal → DTExpr
  /-- A sort. -/
  | sort : DTExpr
  /-- A lambda function. It stores the body. -/
  | lam : DTExpr → DTExpr
  /-- A dependent arrow. It stores the domain and body. -/
  | forall : DTExpr → DTExpr → DTExpr
  /-- A projection. It stores the structure name, projection index, struct body and arguments. -/
  | proj : Name → Nat → DTExpr → Array DTExpr → DTExpr
deriving Inhabited, BEq, Repr
goal: Mathlib.Meta.FunProp.RefinedDiscrTree.DTExpr

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.DTExpr.sort
code: /-- `DTExpr` is a simplified form of `Expr`.
It is the intermediate step for converting from `Expr` to `Array Key`. -/
inductive DTExpr where
  /-- A metavariable. It optionally stores an `MVarId`. -/
  | star : Option MVarId → DTExpr
  /-- An opaque variable or a let-expression in the case `WhnfCoreConfig.zeta := false`. -/
  | opaque : DTExpr
  /-- A constant. It stores the name and the arguments. -/
  | const : Name → Array DTExpr → DTExpr
  /-- A free variable. It stores the `FVarId` and the argumenst -/
  | fvar : FVarId → Array DTExpr → DTExpr
  /-- A bound variable. It stores the De Bruijn index and the arguments -/
  | bvar : Nat → Array DTExpr → DTExpr
  /-- A literal. -/
  | lit : Literal → DTExpr
  /-- A sort. -/
  | sort : DTExpr
  /-- A lambda function. It stores the body. -/
  | lam : DTExpr → DTExpr
  /-- A dependent arrow. It stores the domain and body. -/
  | forall : DTExpr → DTExpr → DTExpr
  /-- A projection. It stores the structure name, projection index, struct body and arguments. -/
  | proj : Name → Nat → DTExpr → Array DTExpr → DTExpr
deriving Inhabited, BEq, Repr
goal: Mathlib.Meta.FunProp.RefinedDiscrTree.DTExpr

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.DTExpr.lit
code: /-- `DTExpr` is a simplified form of `Expr`.
It is the intermediate step for converting from `Expr` to `Array Key`. -/
inductive DTExpr where
  /-- A metavariable. It optionally stores an `MVarId`. -/
  | star : Option MVarId → DTExpr
  /-- An opaque variable or a let-expression in the case `WhnfCoreConfig.zeta := false`. -/
  | opaque : DTExpr
  /-- A constant. It stores the name and the arguments. -/
  | const : Name → Array DTExpr → DTExpr
  /-- A free variable. It stores the `FVarId` and the argumenst -/
  | fvar : FVarId → Array DTExpr → DTExpr
  /-- A bound variable. It stores the De Bruijn index and the arguments -/
  | bvar : Nat → Array DTExpr → DTExpr
  /-- A literal. -/
  | lit : Literal → DTExpr
  /-- A sort. -/
  | sort : DTExpr
  /-- A lambda function. It stores the body. -/
  | lam : DTExpr → DTExpr
  /-- A dependent arrow. It stores the domain and body. -/
  | forall : DTExpr → DTExpr → DTExpr
  /-- A projection. It stores the structure name, projection index, struct body and arguments. -/
  | proj : Name → Nat → DTExpr → Array DTExpr → DTExpr
deriving Inhabited, BEq, Repr
goal: Lean.Literal → Mathlib.Meta.FunProp.RefinedDiscrTree.DTExpr

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.DTExpr.const
code: /-- `DTExpr` is a simplified form of `Expr`.
It is the intermediate step for converting from `Expr` to `Array Key`. -/
inductive DTExpr where
  /-- A metavariable. It optionally stores an `MVarId`. -/
  | star : Option MVarId → DTExpr
  /-- An opaque variable or a let-expression in the case `WhnfCoreConfig.zeta := false`. -/
  | opaque : DTExpr
  /-- A constant. It stores the name and the arguments. -/
  | const : Name → Array DTExpr → DTExpr
  /-- A free variable. It stores the `FVarId` and the argumenst -/
  | fvar : FVarId → Array DTExpr → DTExpr
  /-- A bound variable. It stores the De Bruijn index and the arguments -/
  | bvar : Nat → Array DTExpr → DTExpr
  /-- A literal. -/
  | lit : Literal → DTExpr
  /-- A sort. -/
  | sort : DTExpr
  /-- A lambda function. It stores the body. -/
  | lam : DTExpr → DTExpr
  /-- A dependent arrow. It stores the domain and body. -/
  | forall : DTExpr → DTExpr → DTExpr
  /-- A projection. It stores the structure name, projection index, struct body and arguments. -/
  | proj : Name → Nat → DTExpr → Array DTExpr → DTExpr
deriving Inhabited, BEq, Repr
goal: Lean.Name → Array Mathlib.Meta.FunProp.RefinedDiscrTree.DTExpr → Mathlib.Meta.FunProp.RefinedDiscrTree.DTExpr

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.instReprDTExpr
code: /-- `DTExpr` is a simplified form of `Expr`.
It is the intermediate step for converting from `Expr` to `Array Key`. -/
inductive DTExpr where
  /-- A metavariable. It optionally stores an `MVarId`. -/
  | star : Option MVarId → DTExpr
  /-- An opaque variable or a let-expression in the case `WhnfCoreConfig.zeta := false`. -/
  | opaque : DTExpr
  /-- A constant. It stores the name and the arguments. -/
  | const : Name → Array DTExpr → DTExpr
  /-- A free variable. It stores the `FVarId` and the argumenst -/
  | fvar : FVarId → Array DTExpr → DTExpr
  /-- A bound variable. It stores the De Bruijn index and the arguments -/
  | bvar : Nat → Array DTExpr → DTExpr
  /-- A literal. -/
  | lit : Literal → DTExpr
  /-- A sort. -/
  | sort : DTExpr
  /-- A lambda function. It stores the body. -/
  | lam : DTExpr → DTExpr
  /-- A dependent arrow. It stores the domain and body. -/
  | forall : DTExpr → DTExpr → DTExpr
  /-- A projection. It stores the structure name, projection index, struct body and arguments. -/
  | proj : Name → Nat → DTExpr → Array DTExpr → DTExpr
deriving Inhabited, BEq, Repr
goal: Repr Mathlib.Meta.FunProp.RefinedDiscrTree.DTExpr

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.DTExpr.lam
code: /-- `DTExpr` is a simplified form of `Expr`.
It is the intermediate step for converting from `Expr` to `Array Key`. -/
inductive DTExpr where
  /-- A metavariable. It optionally stores an `MVarId`. -/
  | star : Option MVarId → DTExpr
  /-- An opaque variable or a let-expression in the case `WhnfCoreConfig.zeta := false`. -/
  | opaque : DTExpr
  /-- A constant. It stores the name and the arguments. -/
  | const : Name → Array DTExpr → DTExpr
  /-- A free variable. It stores the `FVarId` and the argumenst -/
  | fvar : FVarId → Array DTExpr → DTExpr
  /-- A bound variable. It stores the De Bruijn index and the arguments -/
  | bvar : Nat → Array DTExpr → DTExpr
  /-- A literal. -/
  | lit : Literal → DTExpr
  /-- A sort. -/
  | sort : DTExpr
  /-- A lambda function. It stores the body. -/
  | lam : DTExpr → DTExpr
  /-- A dependent arrow. It stores the domain and body. -/
  | forall : DTExpr → DTExpr → DTExpr
  /-- A projection. It stores the structure name, projection index, struct body and arguments. -/
  | proj : Name → Nat → DTExpr → Array DTExpr → DTExpr
deriving Inhabited, BEq, Repr
goal: Mathlib.Meta.FunProp.RefinedDiscrTree.DTExpr → Mathlib.Meta.FunProp.RefinedDiscrTree.DTExpr

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.DTExpr.bvar
code: /-- `DTExpr` is a simplified form of `Expr`.
It is the intermediate step for converting from `Expr` to `Array Key`. -/
inductive DTExpr where
  /-- A metavariable. It optionally stores an `MVarId`. -/
  | star : Option MVarId → DTExpr
  /-- An opaque variable or a let-expression in the case `WhnfCoreConfig.zeta := false`. -/
  | opaque : DTExpr
  /-- A constant. It stores the name and the arguments. -/
  | const : Name → Array DTExpr → DTExpr
  /-- A free variable. It stores the `FVarId` and the argumenst -/
  | fvar : FVarId → Array DTExpr → DTExpr
  /-- A bound variable. It stores the De Bruijn index and the arguments -/
  | bvar : Nat → Array DTExpr → DTExpr
  /-- A literal. -/
  | lit : Literal → DTExpr
  /-- A sort. -/
  | sort : DTExpr
  /-- A lambda function. It stores the body. -/
  | lam : DTExpr → DTExpr
  /-- A dependent arrow. It stores the domain and body. -/
  | forall : DTExpr → DTExpr → DTExpr
  /-- A projection. It stores the structure name, projection index, struct body and arguments. -/
  | proj : Name → Nat → DTExpr → Array DTExpr → DTExpr
deriving Inhabited, BEq, Repr
goal: ℕ → Array Mathlib.Meta.FunProp.RefinedDiscrTree.DTExpr → Mathlib.Meta.FunProp.RefinedDiscrTree.DTExpr

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.DTExpr.proj
code: /-- `DTExpr` is a simplified form of `Expr`.
It is the intermediate step for converting from `Expr` to `Array Key`. -/
inductive DTExpr where
  /-- A metavariable. It optionally stores an `MVarId`. -/
  | star : Option MVarId → DTExpr
  /-- An opaque variable or a let-expression in the case `WhnfCoreConfig.zeta := false`. -/
  | opaque : DTExpr
  /-- A constant. It stores the name and the arguments. -/
  | const : Name → Array DTExpr → DTExpr
  /-- A free variable. It stores the `FVarId` and the argumenst -/
  | fvar : FVarId → Array DTExpr → DTExpr
  /-- A bound variable. It stores the De Bruijn index and the arguments -/
  | bvar : Nat → Array DTExpr → DTExpr
  /-- A literal. -/
  | lit : Literal → DTExpr
  /-- A sort. -/
  | sort : DTExpr
  /-- A lambda function. It stores the body. -/
  | lam : DTExpr → DTExpr
  /-- A dependent arrow. It stores the domain and body. -/
  | forall : DTExpr → DTExpr → DTExpr
  /-- A projection. It stores the structure name, projection index, struct body and arguments. -/
  | proj : Name → Nat → DTExpr → Array DTExpr → DTExpr
deriving Inhabited, BEq, Repr
goal: Lean.Name →
  ℕ →
    Mathlib.Meta.FunProp.RefinedDiscrTree.DTExpr →
      Array Mathlib.Meta.FunProp.RefinedDiscrTree.DTExpr → Mathlib.Meta.FunProp.RefinedDiscrTree.DTExpr

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.instInhabitedDTExpr
code: /-- `DTExpr` is a simplified form of `Expr`.
It is the intermediate step for converting from `Expr` to `Array Key`. -/
inductive DTExpr where
  /-- A metavariable. It optionally stores an `MVarId`. -/
  | star : Option MVarId → DTExpr
  /-- An opaque variable or a let-expression in the case `WhnfCoreConfig.zeta := false`. -/
  | opaque : DTExpr
  /-- A constant. It stores the name and the arguments. -/
  | const : Name → Array DTExpr → DTExpr
  /-- A free variable. It stores the `FVarId` and the argumenst -/
  | fvar : FVarId → Array DTExpr → DTExpr
  /-- A bound variable. It stores the De Bruijn index and the arguments -/
  | bvar : Nat → Array DTExpr → DTExpr
  /-- A literal. -/
  | lit : Literal → DTExpr
  /-- A sort. -/
  | sort : DTExpr
  /-- A lambda function. It stores the body. -/
  | lam : DTExpr → DTExpr
  /-- A dependent arrow. It stores the domain and body. -/
  | forall : DTExpr → DTExpr → DTExpr
  /-- A projection. It stores the structure name, projection index, struct body and arguments. -/
  | proj : Name → Nat → DTExpr → Array DTExpr → DTExpr
deriving Inhabited, BEq, Repr
goal: Inhabited Mathlib.Meta.FunProp.RefinedDiscrTree.DTExpr

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.instBEqDTExpr
code: /-- `DTExpr` is a simplified form of `Expr`.
It is the intermediate step for converting from `Expr` to `Array Key`. -/
inductive DTExpr where
  /-- A metavariable. It optionally stores an `MVarId`. -/
  | star : Option MVarId → DTExpr
  /-- An opaque variable or a let-expression in the case `WhnfCoreConfig.zeta := false`. -/
  | opaque : DTExpr
  /-- A constant. It stores the name and the arguments. -/
  | const : Name → Array DTExpr → DTExpr
  /-- A free variable. It stores the `FVarId` and the argumenst -/
  | fvar : FVarId → Array DTExpr → DTExpr
  /-- A bound variable. It stores the De Bruijn index and the arguments -/
  | bvar : Nat → Array DTExpr → DTExpr
  /-- A literal. -/
  | lit : Literal → DTExpr
  /-- A sort. -/
  | sort : DTExpr
  /-- A lambda function. It stores the body. -/
  | lam : DTExpr → DTExpr
  /-- A dependent arrow. It stores the domain and body. -/
  | forall : DTExpr → DTExpr → DTExpr
  /-- A projection. It stores the structure name, projection index, struct body and arguments. -/
  | proj : Name → Nat → DTExpr → Array DTExpr → DTExpr
deriving Inhabited, BEq, Repr
goal: BEq Mathlib.Meta.FunProp.RefinedDiscrTree.DTExpr

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.DTExpr.star
code: /-- `DTExpr` is a simplified form of `Expr`.
It is the intermediate step for converting from `Expr` to `Array Key`. -/
inductive DTExpr where
  /-- A metavariable. It optionally stores an `MVarId`. -/
  | star : Option MVarId → DTExpr
  /-- An opaque variable or a let-expression in the case `WhnfCoreConfig.zeta := false`. -/
  | opaque : DTExpr
  /-- A constant. It stores the name and the arguments. -/
  | const : Name → Array DTExpr → DTExpr
  /-- A free variable. It stores the `FVarId` and the argumenst -/
  | fvar : FVarId → Array DTExpr → DTExpr
  /-- A bound variable. It stores the De Bruijn index and the arguments -/
  | bvar : Nat → Array DTExpr → DTExpr
  /-- A literal. -/
  | lit : Literal → DTExpr
  /-- A sort. -/
  | sort : DTExpr
  /-- A lambda function. It stores the body. -/
  | lam : DTExpr → DTExpr
  /-- A dependent arrow. It stores the domain and body. -/
  | forall : DTExpr → DTExpr → DTExpr
  /-- A projection. It stores the structure name, projection index, struct body and arguments. -/
  | proj : Name → Nat → DTExpr → Array DTExpr → DTExpr
deriving Inhabited, BEq, Repr
goal: Option Lean.MVarId → Mathlib.Meta.FunProp.RefinedDiscrTree.DTExpr

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.DTExpr.forall
code: /-- `DTExpr` is a simplified form of `Expr`.
It is the intermediate step for converting from `Expr` to `Array Key`. -/
inductive DTExpr where
  /-- A metavariable. It optionally stores an `MVarId`. -/
  | star : Option MVarId → DTExpr
  /-- An opaque variable or a let-expression in the case `WhnfCoreConfig.zeta := false`. -/
  | opaque : DTExpr
  /-- A constant. It stores the name and the arguments. -/
  | const : Name → Array DTExpr → DTExpr
  /-- A free variable. It stores the `FVarId` and the argumenst -/
  | fvar : FVarId → Array DTExpr → DTExpr
  /-- A bound variable. It stores the De Bruijn index and the arguments -/
  | bvar : Nat → Array DTExpr → DTExpr
  /-- A literal. -/
  | lit : Literal → DTExpr
  /-- A sort. -/
  | sort : DTExpr
  /-- A lambda function. It stores the body. -/
  | lam : DTExpr → DTExpr
  /-- A dependent arrow. It stores the domain and body. -/
  | forall : DTExpr → DTExpr → DTExpr
  /-- A projection. It stores the structure name, projection index, struct body and arguments. -/
  | proj : Name → Nat → DTExpr → Array DTExpr → DTExpr
deriving Inhabited, BEq, Repr
goal: Mathlib.Meta.FunProp.RefinedDiscrTree.DTExpr →
  Mathlib.Meta.FunProp.RefinedDiscrTree.DTExpr → Mathlib.Meta.FunProp.RefinedDiscrTree.DTExpr

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.DTExpr.fvar
code: /-- `DTExpr` is a simplified form of `Expr`.
It is the intermediate step for converting from `Expr` to `Array Key`. -/
inductive DTExpr where
  /-- A metavariable. It optionally stores an `MVarId`. -/
  | star : Option MVarId → DTExpr
  /-- An opaque variable or a let-expression in the case `WhnfCoreConfig.zeta := false`. -/
  | opaque : DTExpr
  /-- A constant. It stores the name and the arguments. -/
  | const : Name → Array DTExpr → DTExpr
  /-- A free variable. It stores the `FVarId` and the argumenst -/
  | fvar : FVarId → Array DTExpr → DTExpr
  /-- A bound variable. It stores the De Bruijn index and the arguments -/
  | bvar : Nat → Array DTExpr → DTExpr
  /-- A literal. -/
  | lit : Literal → DTExpr
  /-- A sort. -/
  | sort : DTExpr
  /-- A lambda function. It stores the body. -/
  | lam : DTExpr → DTExpr
  /-- A dependent arrow. It stores the domain and body. -/
  | forall : DTExpr → DTExpr → DTExpr
  /-- A projection. It stores the structure name, projection index, struct body and arguments. -/
  | proj : Name → Nat → DTExpr → Array DTExpr → DTExpr
deriving Inhabited, BEq, Repr
goal: Lean.FVarId → Array Mathlib.Meta.FunProp.RefinedDiscrTree.DTExpr → Mathlib.Meta.FunProp.RefinedDiscrTree.DTExpr

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.DTExpr
code: /-- `DTExpr` is a simplified form of `Expr`.
It is the intermediate step for converting from `Expr` to `Array Key`. -/
inductive DTExpr where
  /-- A metavariable. It optionally stores an `MVarId`. -/
  | star : Option MVarId → DTExpr
  /-- An opaque variable or a let-expression in the case `WhnfCoreConfig.zeta := false`. -/
  | opaque : DTExpr
  /-- A constant. It stores the name and the arguments. -/
  | const : Name → Array DTExpr → DTExpr
  /-- A free variable. It stores the `FVarId` and the argumenst -/
  | fvar : FVarId → Array DTExpr → DTExpr
  /-- A bound variable. It stores the De Bruijn index and the arguments -/
  | bvar : Nat → Array DTExpr → DTExpr
  /-- A literal. -/
  | lit : Literal → DTExpr
  /-- A sort. -/
  | sort : DTExpr
  /-- A lambda function. It stores the body. -/
  | lam : DTExpr → DTExpr
  /-- A dependent arrow. It stores the domain and body. -/
  | forall : DTExpr → DTExpr → DTExpr
  /-- A projection. It stores the structure name, projection index, struct body and arguments. -/
  | proj : Name → Nat → DTExpr → Array DTExpr → DTExpr
deriving Inhabited, BEq, Repr
goal: Type

full_name: _private.Mathlib.Tactic.FunProp.RefinedDiscrTree.0.Mathlib.Meta.FunProp.RefinedDiscrTree.DTExpr.format
code: private partial def DTExpr.format : DTExpr → Format
  
goal: Mathlib.Meta.FunProp.RefinedDiscrTree.DTExpr → Lean.Format

full_name: _private.Mathlib.Tactic.FunProp.RefinedDiscrTree.0.Mathlib.Meta.FunProp.RefinedDiscrTree.DTExpr.format.formatArgs
code: private partial def DTExpr.format : DTExpr → Format
  
goal: Lean.Format

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.instToFormatDTExpr
code: instance : ToFormat DTExpr 
goal: Lean.ToFormat Mathlib.Meta.FunProp.RefinedDiscrTree.DTExpr

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.DTExpr.size
code: /-- Return the size of the `DTExpr`. This is used for calculating the matching score when two
expressions are equal.
The score is not incremented at a lambda, which is so that the expressions
`∀ x, p[x]` and `∃ x, p[x]` get the same size. -/
partial def DTExpr.size : DTExpr → Nat

goal: Mathlib.Meta.FunProp.RefinedDiscrTree.DTExpr → ℕ

full_name: _private.Mathlib.Tactic.FunProp.RefinedDiscrTree.0.Mathlib.Meta.FunProp.RefinedDiscrTree.DTExpr.eqv
code: private def DTExpr.eqv (a b : DTExpr) : Bool 
goal: Bool

full_name: _private.Mathlib.Tactic.FunProp.RefinedDiscrTree.0.Mathlib.Meta.FunProp.RefinedDiscrTree.DTExpr.eqv.goArray
code: private def DTExpr.eqv (a b : DTExpr) : Bool 
goal: StateM (Lean.HashMap Lean.MVarId Lean.MVarId) Bool

full_name: _private.Mathlib.Tactic.FunProp.RefinedDiscrTree.0.Mathlib.Meta.FunProp.RefinedDiscrTree.DTExpr.eqv.go
code: private def DTExpr.eqv (a b : DTExpr) : Bool 
goal: StateM (Lean.HashMap Lean.MVarId Lean.MVarId) Bool

full_name: _private.Mathlib.Tactic.FunProp.RefinedDiscrTree.0.Mathlib.Meta.FunProp.RefinedDiscrTree.Flatten.State.stars
code: /-- This state is used to turn the indexing by `MVarId` and `FVarId` in `DTExpr` into
indexing by `Nat` in `Key`. -/
private structure Flatten.State where
  stars : Array MVarId := #[]
goal: Array Lean.MVarId

full_name: _private.Mathlib.Tactic.FunProp.RefinedDiscrTree.0.Mathlib.Meta.FunProp.RefinedDiscrTree.Flatten.State
code: /-- This state is used to turn the indexing by `MVarId` and `FVarId` in `DTExpr` into
indexing by `Nat` in `Key`. -/
private structure Flatten.State where
  stars : Array MVarId := #[]
goal: Type

full_name: _private.Mathlib.Tactic.FunProp.RefinedDiscrTree.0.Mathlib.Meta.FunProp.RefinedDiscrTree.getStar
code: private def getStar (mvarId? : Option MVarId) : StateM Flatten.State Nat 
goal: StateM Mathlib.Meta.FunProp.RefinedDiscrTree.Flatten.State ℕ

full_name: _private.Mathlib.Tactic.FunProp.RefinedDiscrTree.0.Mathlib.Meta.FunProp.RefinedDiscrTree.DTExpr.flattenAux
code: private partial def DTExpr.flattenAux (todo : Array Key) : DTExpr → StateM Flatten.State (Array Key)
  
goal: Mathlib.Meta.FunProp.RefinedDiscrTree.DTExpr →
  StateM Mathlib.Meta.FunProp.RefinedDiscrTree.Flatten.State (Array Mathlib.Meta.FunProp.RefinedDiscrTree.Key)

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.DTExpr.flatten
code: /-- Given a `DTExpr`, return the linearized encoding in terms of `Key`,
which is used for `RefinedDiscrTree` indexing. -/
def DTExpr.flatten (e : DTExpr) (initCapacity := 16) : Array Key 
goal: Array Mathlib.Meta.FunProp.RefinedDiscrTree.Key

full_name: _private.Mathlib.Tactic.FunProp.RefinedDiscrTree.0.Mathlib.Meta.FunProp.RefinedDiscrTree.isNumeral
code: /-- Return true if `e` is one of the following
- A nat literal (numeral)
- `Nat.zero`
- `Nat.succ x` where `isNumeral x`
- `OfNat.ofNat _ x _` where `isNumeral x` -/
private partial def isNumeral (e : Expr) : Bool 
goal: Bool

full_name: _private.Mathlib.Tactic.FunProp.RefinedDiscrTree.0.Mathlib.Meta.FunProp.RefinedDiscrTree.toNatLit?.loop
code: /-- Return `some n` if `e` is definitionally equal to the natural number `n`. -/
private partial def toNatLit? (e : Expr) : Option Literal 
goal: Option ℕ

full_name: _private.Mathlib.Tactic.FunProp.RefinedDiscrTree.0.Mathlib.Meta.FunProp.RefinedDiscrTree.toNatLit?
code: /-- Return `some n` if `e` is definitionally equal to the natural number `n`. -/
private partial def toNatLit? (e : Expr) : Option Literal 
goal: Option Lean.Literal

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.reduce
code: /-- Reduction procedure for the `RefinedDiscrTree` indexing. -/
partial def reduce (e : Expr) (config : WhnfCoreConfig) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.lambdaTelescopeReduce
code: /-- Repeatedly apply reduce while stripping lambda binders and introducing their variables -/
@[specialize]
partial def lambdaTelescopeReduce {m} [Monad m] [MonadLiftT MetaM m] [MonadControlT MetaM m]
    [Inhabited α] (e : Expr) (fvars : List FVarId) (config : WhnfCoreConfig)
    (k : Expr → List FVarId → m α) : m α 
goal: m α

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.isStar
code: /-- Check whether the expression is represented by `Key.star`. -/
def isStar : Expr → Bool
  
goal: Lean.Expr → Bool

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.isStarWithArg
code: /-- Check whether the expression is represented by `Key.star` and has `arg` as an argument. -/
def isStarWithArg (arg : Expr) : Expr → Bool
  
goal: Lean.Expr → Bool

full_name: _private.Mathlib.Tactic.FunProp.RefinedDiscrTree.0.Mathlib.Meta.FunProp.RefinedDiscrTree.DTExpr.hasLooseBVarsAux
code: private partial def DTExpr.hasLooseBVarsAux (i : Nat) : DTExpr → Bool
  
goal: Mathlib.Meta.FunProp.RefinedDiscrTree.DTExpr → Bool

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.DTExpr.hasLooseBVars
code: /-- Return `true` if `e` contains a loose bound variable. -/
def DTExpr.hasLooseBVars (e : DTExpr) : Bool 
goal: Bool

full_name: _private.Mathlib.Tactic.FunProp.RefinedDiscrTree.0.Mathlib.Meta.FunProp.RefinedDiscrTree.MkDTExpr.Context.config
code: private structure Context where
  /-- Variables that come from a lambda or forall binder.
  The list index gives the De Bruijn index. -/
  bvars : List FVarId := []
  /-- Variables that come from a lambda that has been removed via η-reduction. -/
  forbiddenVars : List FVarId := []
  config : WhnfCoreConfig
  fvarInContext : FVarId → Bool
goal: Lean.Meta.WhnfCoreConfig

full_name: _private.Mathlib.Tactic.FunProp.RefinedDiscrTree.0.Mathlib.Meta.FunProp.RefinedDiscrTree.MkDTExpr.Context.bvars
code: private structure Context where
  /-- Variables that come from a lambda or forall binder.
  The list index gives the De Bruijn index. -/
  bvars : List FVarId := []
  /-- Variables that come from a lambda that has been removed via η-reduction. -/
  forbiddenVars : List FVarId := []
  config : WhnfCoreConfig
  fvarInContext : FVarId → Bool
goal: List Lean.FVarId

full_name: _private.Mathlib.Tactic.FunProp.RefinedDiscrTree.0.Mathlib.Meta.FunProp.RefinedDiscrTree.MkDTExpr.Context
code: private structure Context where
  /-- Variables that come from a lambda or forall binder.
  The list index gives the De Bruijn index. -/
  bvars : List FVarId := []
  /-- Variables that come from a lambda that has been removed via η-reduction. -/
  forbiddenVars : List FVarId := []
  config : WhnfCoreConfig
  fvarInContext : FVarId → Bool
goal: Type

full_name: _private.Mathlib.Tactic.FunProp.RefinedDiscrTree.0.Mathlib.Meta.FunProp.RefinedDiscrTree.MkDTExpr.Context.fvarInContext
code: private structure Context where
  /-- Variables that come from a lambda or forall binder.
  The list index gives the De Bruijn index. -/
  bvars : List FVarId := []
  /-- Variables that come from a lambda that has been removed via η-reduction. -/
  forbiddenVars : List FVarId := []
  config : WhnfCoreConfig
  fvarInContext : FVarId → Bool
goal: Lean.FVarId → Bool

full_name: _private.Mathlib.Tactic.FunProp.RefinedDiscrTree.0.Mathlib.Meta.FunProp.RefinedDiscrTree.MkDTExpr.Context.forbiddenVars
code: private structure Context where
  /-- Variables that come from a lambda or forall binder.
  The list index gives the De Bruijn index. -/
  bvars : List FVarId := []
  /-- Variables that come from a lambda that has been removed via η-reduction. -/
  forbiddenVars : List FVarId := []
  config : WhnfCoreConfig
  fvarInContext : FVarId → Bool
goal: List Lean.FVarId

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.MkDTExpr.getIgnores.isIgnoredArg
code: /-- Return for each argument whether it should be ignored. -/
def getIgnores (fn : Expr) (args : Array Expr) : MetaM (Array Bool) 
goal: Lean.MetaM Bool

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.MkDTExpr.getIgnores
code: /-- Return for each argument whether it should be ignored. -/
def getIgnores (fn : Expr) (args : Array Expr) : MetaM (Array Bool) 
goal: Lean.MetaM (Array Bool)

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.MkDTExpr.etaExpand
code: /-- Introduce new lambdas by η-expansion. -/
@[specialize]
def etaExpand (args : Array Expr) (type : Expr) (lambdas : List FVarId) (goalArity : Nat)
    (k : Array Expr → List FVarId → MetaM α) : MetaM α  
goal: Lean.MetaM α

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.MkDTExpr.reduceHBinOpAux
code: /-- Normalize an application of a heterogenous binary operator like `HAdd.hAdd`, using:
- `f = fun x => f x` to increase the arity to 6
- `(f + g) a = f a + g a` to decrease the arity to 6
- `(fun x => f x + g x) = f + g` to get rid of any lambdas in front -/
def reduceHBinOpAux (args : Array Expr) (lambdas : List FVarId) (instH instPi : Name) :
    OptionT MetaM (Expr × Expr × Expr × List FVarId) 
goal: OptionT Lean.MetaM (Lean.Expr × Lean.Expr × Lean.Expr × List Lean.FVarId)

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.MkDTExpr.reduceHBinOpAux.distributeLambdas
code: /-- Normalize an application of a heterogenous binary operator like `HAdd.hAdd`, using:
- `f = fun x => f x` to increase the arity to 6
- `(f + g) a = f a + g a` to decrease the arity to 6
- `(fun x => f x + g x) = f + g` to get rid of any lambdas in front -/
def reduceHBinOpAux (args : Array Expr) (lambdas : List FVarId) (instH instPi : Name) :
    OptionT MetaM (Expr × Expr × Expr × List FVarId) 
goal: Lean.MetaM (Lean.Expr × Lean.Expr × Lean.Expr × List Lean.FVarId)

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.MkDTExpr.reduceHBinOp
code: /-- Normalize an application if the head is  `+`, `*`, `-` or `/`.
Optionally return the `(type, lhs, rhs, lambdas)`. -/
@[inline] def reduceHBinOp (n : Name) (args : Array Expr) (lambdas : List FVarId) :
    MetaM (Option (Expr × Expr × Expr × List FVarId)) 
goal: Lean.MetaM (Option (Lean.Expr × Lean.Expr × Lean.Expr × List Lean.FVarId))

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.MkDTExpr.reduceUnOpAux.distributeLambdas
code: /-- Normalize an application of a unary operator like `Inv.inv`, using:
- `f⁻¹ a = (f a)⁻¹` to decrease the arity to 3
- `(fun x => (f a)⁻¹) = f⁻¹` to get rid of any lambdas in front -/
def reduceUnOpAux (args : Array Expr) (lambdas : List FVarId) (instPi : Name) :
    OptionT MetaM (Expr × Expr × List FVarId) 
goal: Lean.MetaM (Lean.Expr × Lean.Expr × List Lean.FVarId)

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.MkDTExpr.reduceUnOpAux
code: /-- Normalize an application of a unary operator like `Inv.inv`, using:
- `f⁻¹ a = (f a)⁻¹` to decrease the arity to 3
- `(fun x => (f a)⁻¹) = f⁻¹` to get rid of any lambdas in front -/
def reduceUnOpAux (args : Array Expr) (lambdas : List FVarId) (instPi : Name) :
    OptionT MetaM (Expr × Expr × List FVarId) 
goal: OptionT Lean.MetaM (Lean.Expr × Lean.Expr × List Lean.FVarId)

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.MkDTExpr.reduceUnOp
code: /-- Normalize an application if the head is `⁻¹` or `-`.
Optionally return the `(type, arg, lambdas)`. -/
@[inline] def reduceUnOp (n : Name) (args : Array Expr) (lambdas : List FVarId) :
    MetaM (Option (Expr × Expr × List FVarId)) 
goal: Lean.MetaM (Option (Lean.Expr × Lean.Expr × List Lean.FVarId))

full_name: _private.Mathlib.Tactic.FunProp.RefinedDiscrTree.0.Mathlib.Meta.FunProp.RefinedDiscrTree.MkDTExpr.withLams
code: @[specialize]
private def withLams {m} [Monad m] [MonadWithReader Context m]
    (lambdas : List FVarId) (k : m DTExpr) : m DTExpr 
goal: m Mathlib.Meta.FunProp.RefinedDiscrTree.DTExpr

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.MkDTExpr.mkDTExprAux
code: /-- Return the encoding of `e` as a `DTExpr`.
If `root = false`, then `e` is a strict sub expression of the original expression. -/
partial def mkDTExprAux (e : Expr) (root : Bool) : ReaderT Context MetaM DTExpr 
goal: ReaderT Mathlib.Meta.FunProp.RefinedDiscrTree.MkDTExpr.Context Lean.MetaM Mathlib.Meta.FunProp.RefinedDiscrTree.DTExpr

full_name: _private.Mathlib.Tactic.FunProp.RefinedDiscrTree.0.Mathlib.Meta.FunProp.RefinedDiscrTree.MkDTExpr.M
code: private abbrev M 
goal: Type

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.MkDTExpr.instMonadCacheExprDTExprM
code: instance : MonadCache Expr DTExpr M 
goal: Lean.MonadCache Lean.Expr Mathlib.Meta.FunProp.RefinedDiscrTree.DTExpr Mathlib.Meta.FunProp.RefinedDiscrTree.MkDTExpr.M

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.MkDTExpr.etaPossibilities
code: /-- Return all pairs of body, bound variables that could possibly appear due to η-reduction -/
@[specialize]
def etaPossibilities (e : Expr) (lambdas : List FVarId) (k : Expr → List FVarId → M α) : M α 
goal: Mathlib.Meta.FunProp.RefinedDiscrTree.MkDTExpr.M α

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.MkDTExpr.cacheEtaPossibilities
code: /-- run `etaPossibilities`, and cache the result if there are multiple possibilities. -/
@[specialize]
def cacheEtaPossibilities (e original : Expr) (lambdas : List FVarId)
    (k : Expr → List FVarId → M DTExpr) : M DTExpr 
goal: Mathlib.Meta.FunProp.RefinedDiscrTree.MkDTExpr.M Mathlib.Meta.FunProp.RefinedDiscrTree.DTExpr

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.MkDTExpr.mkDTExprsAux
code: /-- Return all encodings of `e` as a `DTExpr`, taking possible η-reductions into account.
If `root = false`, then `e` is a strict sub expression of the original expression. -/
partial def mkDTExprsAux (original : Expr) (root : Bool) : M DTExpr 
goal: Mathlib.Meta.FunProp.RefinedDiscrTree.MkDTExpr.M Mathlib.Meta.FunProp.RefinedDiscrTree.DTExpr

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.DTExpr.isSpecific
code: /--  -/
def DTExpr.isSpecific : DTExpr → Bool
  
goal: Mathlib.Meta.FunProp.RefinedDiscrTree.DTExpr → Bool

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.mkDTExpr
code: /-- Return the encoding of `e` as a `DTExpr`.

Warning: to account for potential η-reductions of `e`, use `mkDTExprs` instead.

The argument `fvarInContext` allows you to specify which free variables in `e` will still be
in the context when the `RefinedDiscrTree` is being used for lookup.
It should return true only if the `RefinedDiscrTree` is built and used locally. -/
def mkDTExpr (e : Expr) (config : WhnfCoreConfig)
    (fvarInContext : FVarId → Bool := fun _ => false) : MetaM DTExpr 
goal: Lean.MetaM Mathlib.Meta.FunProp.RefinedDiscrTree.DTExpr

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.mkDTExprs
code: /-- Similar to `mkDTExpr`.
Return all encodings of `e` as a `DTExpr`, taking potential further η-reductions into account. -/
def mkDTExprs (e : Expr) (config : WhnfCoreConfig) (onlySpecific : Bool)
    (fvarInContext : FVarId → Bool := fun _ => false) : MetaM (List DTExpr) 
goal: Lean.MetaM (List Mathlib.Meta.FunProp.RefinedDiscrTree.DTExpr)

full_name: _private.Mathlib.Tactic.FunProp.RefinedDiscrTree.0.Mathlib.Meta.FunProp.RefinedDiscrTree.insertInArray
code: /-- If `vs` contains an element `v'` such that `v == v'`, then replace `v'` with `v`.
Otherwise, push `v`.
See issue #2155
Recall that `BEq α` may not be Lawful.
-/
private def insertInArray [BEq α] (vs : Array α) (v : α) : Array α 
goal: Array α

full_name: _private.Mathlib.Tactic.FunProp.RefinedDiscrTree.0.Mathlib.Meta.FunProp.RefinedDiscrTree.insertInArray.loop
code: /-- If `vs` contains an element `v'` such that `v == v'`, then replace `v'` with `v`.
Otherwise, push `v`.
See issue #2155
Recall that `BEq α` may not be Lawful.
-/
private def insertInArray [BEq α] (vs : Array α) (v : α) : Array α 
goal: Array α

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.insertInTrie
code: /-- Insert the value `v` at index `keys : Array Key` in a `Trie`. -/
partial def insertInTrie [BEq α] (keys : Array Key) (v : α) (i : Nat) : Trie α → Trie α
  
goal: Mathlib.Meta.FunProp.RefinedDiscrTree.Trie α → Mathlib.Meta.FunProp.RefinedDiscrTree.Trie α

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.insertInRefinedDiscrTree
code: /-- Insert the value `v` at index `keys : Array Key` in a `RefinedDiscrTree`.

Warning: to accound for η-reduction, an entry may need to be added at multiple indexes,
so it is recommended to use `RefinedDiscrTree.insert` for insertion. -/
def insertInRefinedDiscrTree [BEq α] (d : RefinedDiscrTree α) (keys : Array Key) (v : α) :
    RefinedDiscrTree α 
goal: Mathlib.Meta.FunProp.RefinedDiscrTree α

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.insertDTExpr
code: /-- Insert the value `v` at index `e : DTExpr` in a `RefinedDiscrTree`.

Warning: to accound for η-reduction, an entry may need to be added at multiple indexes,
so it is recommended to use `RefinedDiscrTree.insert` for insertion. -/
def insertDTExpr [BEq α] (d : RefinedDiscrTree α) (e : DTExpr) (v : α) : RefinedDiscrTree α 
goal: Mathlib.Meta.FunProp.RefinedDiscrTree α

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.insert
code: /-- Insert the value `v` at index `e : Expr` in a `RefinedDiscrTree`.
The argument `fvarInContext` allows you to specify which free variables in `e` will still be
in the context when the `RefinedDiscrTree` is being used for lookup.
It should return true only if the `RefinedDiscrTree` is built and used locally.

if `onlySpecific := true`, then we filter out the patterns `*` and `Eq * * *`. -/
def insert [BEq α] (d : RefinedDiscrTree α) (e : Expr) (v : α)
    (onlySpecific : Bool := true) (config : WhnfCoreConfig := {})
    (fvarInContext : FVarId → Bool := fun _ => false) : MetaM (RefinedDiscrTree α) 
goal: Lean.MetaM (Mathlib.Meta.FunProp.RefinedDiscrTree α)

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.insertEqn
code: /-- Insert the value `vLhs` at index `lhs`, and if `rhs` is indexed differently, then also
insert the value `vRhs` at index `rhs`. -/
def insertEqn [BEq α] (d : RefinedDiscrTree α) (lhs rhs : Expr) (vLhs vRhs : α)
    (onlySpecific : Bool := true) (config : WhnfCoreConfig := {})
    (fvarInContext : FVarId → Bool := fun _ => false) : MetaM (RefinedDiscrTree α) 
goal: Lean.MetaM (Mathlib.Meta.FunProp.RefinedDiscrTree α)

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.GetUnify.findKey
code: /-- If `k` is a key in `children`, return the corresponding `Trie α`. Otherwise return `none`. -/
def findKey (children : Array (Key × Trie α)) (k : Key) : Option (Trie α) 
goal: Option (Mathlib.Meta.FunProp.RefinedDiscrTree.Trie α)

full_name: _private.Mathlib.Tactic.FunProp.RefinedDiscrTree.0.Mathlib.Meta.FunProp.RefinedDiscrTree.GetUnify.Context.unify
code: private structure Context where
  unify : Bool
  config : WhnfCoreConfig
goal: Bool

full_name: _private.Mathlib.Tactic.FunProp.RefinedDiscrTree.0.Mathlib.Meta.FunProp.RefinedDiscrTree.GetUnify.Context.config
code: private structure Context where
  unify : Bool
  config : WhnfCoreConfig
goal: Lean.Meta.WhnfCoreConfig

full_name: _private.Mathlib.Tactic.FunProp.RefinedDiscrTree.0.Mathlib.Meta.FunProp.RefinedDiscrTree.GetUnify.Context
code: private structure Context where
  unify : Bool
  config : WhnfCoreConfig
goal: Type

full_name: _private.Mathlib.Tactic.FunProp.RefinedDiscrTree.0.Mathlib.Meta.FunProp.RefinedDiscrTree.GetUnify.State
code: private structure State where
  /-- Score representing how good the match is. -/
  score : Nat := 0
  /-- Metavariable assignments for the `Key.star` patterns in the `RefinedDiscrTree`. -/
  starAssignments : HashMap Nat DTExpr := {}
  /-- Metavariable assignments for the `Expr.mvar` in the expression. -/
  mvarAssignments : HashMap MVarId (Array Key) := {}
goal: Type

full_name: _private.Mathlib.Tactic.FunProp.RefinedDiscrTree.0.Mathlib.Meta.FunProp.RefinedDiscrTree.GetUnify.State.score
code: private structure State where
  /-- Score representing how good the match is. -/
  score : Nat := 0
  /-- Metavariable assignments for the `Key.star` patterns in the `RefinedDiscrTree`. -/
  starAssignments : HashMap Nat DTExpr := {}
  /-- Metavariable assignments for the `Expr.mvar` in the expression. -/
  mvarAssignments : HashMap MVarId (Array Key) := {}
goal: ℕ

full_name: _private.Mathlib.Tactic.FunProp.RefinedDiscrTree.0.Mathlib.Meta.FunProp.RefinedDiscrTree.GetUnify.State.starAssignments
code: private structure State where
  /-- Score representing how good the match is. -/
  score : Nat := 0
  /-- Metavariable assignments for the `Key.star` patterns in the `RefinedDiscrTree`. -/
  starAssignments : HashMap Nat DTExpr := {}
  /-- Metavariable assignments for the `Expr.mvar` in the expression. -/
  mvarAssignments : HashMap MVarId (Array Key) := {}
goal: Lean.HashMap ℕ Mathlib.Meta.FunProp.RefinedDiscrTree.DTExpr

full_name: _private.Mathlib.Tactic.FunProp.RefinedDiscrTree.0.Mathlib.Meta.FunProp.RefinedDiscrTree.GetUnify.State.mvarAssignments
code: private structure State where
  /-- Score representing how good the match is. -/
  score : Nat := 0
  /-- Metavariable assignments for the `Key.star` patterns in the `RefinedDiscrTree`. -/
  starAssignments : HashMap Nat DTExpr := {}
  /-- Metavariable assignments for the `Expr.mvar` in the expression. -/
  mvarAssignments : HashMap MVarId (Array Key) := {}
goal: Lean.HashMap Lean.MVarId (Array Mathlib.Meta.FunProp.RefinedDiscrTree.Key)

full_name: _private.Mathlib.Tactic.FunProp.RefinedDiscrTree.0.Mathlib.Meta.FunProp.RefinedDiscrTree.GetUnify.M
code: private abbrev M 
goal: Type

full_name: _private.Mathlib.Tactic.FunProp.RefinedDiscrTree.0.Mathlib.Meta.FunProp.RefinedDiscrTree.GetUnify.M.run
code: /-- Return all values from `x` in an array, together with their scores. -/
private def M.run (unify : Bool) (config : WhnfCoreConfig) (x : M (Trie α)) :
    Array (Array α × Nat) 
goal: Array (Array α × ℕ)

full_name: _private.Mathlib.Tactic.FunProp.RefinedDiscrTree.0.Mathlib.Meta.FunProp.RefinedDiscrTree.GetUnify.incrementScore
code: /-- Increment the score by `n`. -/
private def incrementScore (n : Nat) : M Unit 
goal: Mathlib.Meta.FunProp.RefinedDiscrTree.GetUnify.M Unit

full_name: _private.Mathlib.Tactic.FunProp.RefinedDiscrTree.0.Mathlib.Meta.FunProp.RefinedDiscrTree.GetUnify.insertStarAssignment
code: /-- Log a metavariable assignment in the `State`. -/
private def insertStarAssignment (n : Nat) (e : DTExpr) : M Unit 
goal: Mathlib.Meta.FunProp.RefinedDiscrTree.GetUnify.M Unit

full_name: _private.Mathlib.Tactic.FunProp.RefinedDiscrTree.0.Mathlib.Meta.FunProp.RefinedDiscrTree.GetUnify.assignMVar
code: /-- Log a metavariable assignment in the `State`. -/
private def assignMVar (mvarId : MVarId) (e : Array Key) : M Unit 
goal: Mathlib.Meta.FunProp.RefinedDiscrTree.GetUnify.M Unit

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.GetUnify.skipEntries
code: /-- Return the possible `Trie α` that match with `n` metavariable. -/
partial def skipEntries (t : Trie α) (skipped : Array Key) : Nat → M (Array Key × Trie α)
  
goal: ℕ →
  Mathlib.Meta.FunProp.RefinedDiscrTree.GetUnify.M
    (Array Mathlib.Meta.FunProp.RefinedDiscrTree.Key × Mathlib.Meta.FunProp.RefinedDiscrTree.Trie α)

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.GetUnify.matchTargetStar
code: /-- Return the possible `Trie α` that match with anything.
We add 1 to the matching score when the key is `.opaque`,
since this pattern is "harder" to match with. -/
def matchTargetStar (mvarId? : Option MVarId) (t : Trie α) : M (Trie α) 
goal: Mathlib.Meta.FunProp.RefinedDiscrTree.GetUnify.M (Mathlib.Meta.FunProp.RefinedDiscrTree.Trie α)

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.GetUnify.matchTreeStars
code: /-- Return the possible `Trie α` that come from a `Key.star`,
while keeping track of the `Key.star` assignments. -/
def matchTreeStars (e : DTExpr) (t : Trie α) : M (Trie α) 
goal: Mathlib.Meta.FunProp.RefinedDiscrTree.GetUnify.M (Mathlib.Meta.FunProp.RefinedDiscrTree.Trie α)

full_name: _private.Mathlib.Tactic.FunProp.RefinedDiscrTree.0.Mathlib.Meta.FunProp.RefinedDiscrTree.GetUnify.getMatchWithScoreAux
code: private partial def getMatchWithScoreAux (d : RefinedDiscrTree α) (e : DTExpr) (unify : Bool)
    (config : WhnfCoreConfig) (allowRootStar : Bool := false) : Array (Array α × Nat) 
goal: Array (Array α × ℕ)

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.getMatchWithScore
code: /--
Return the results from the `RefinedDiscrTree` that match the given expression,
together with their matching scores, in decreasing order of score.

Each entry of type `Array α × Nat` corresponds to one pattern.

If `unify := false`, then metavariables in `e` are treated as opaque variables.
This is for when you don't want to instantiate metavariables in `e`.

If `allowRootStar := false`, then we don't allow `e` or the matched key in `d`
to be a star pattern. -/
def getMatchWithScore (d : RefinedDiscrTree α) (e : Expr) (unify : Bool)
    (config : WhnfCoreConfig) (allowRootStar : Bool := false) : MetaM (Array (Array α × Nat)) 
goal: Lean.MetaM (Array (Array α × ℕ))

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.getMatchWithScoreWithExtra.go
code: /-- Similar to `getMatchWithScore`, but also returns matches with prefixes of `e`.
We store the score, followed by the number of ignored arguments. -/
partial def getMatchWithScoreWithExtra (d : RefinedDiscrTree α) (e : Expr) (unify : Bool)
    (config : WhnfCoreConfig) (allowRootStar : Bool := false) :
    MetaM (Array (Array α × Nat × Nat)) 
goal: Lean.MetaM (Array (Array α × ℕ × ℕ))

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.getMatchWithScoreWithExtra
code: /-- Similar to `getMatchWithScore`, but also returns matches with prefixes of `e`.
We store the score, followed by the number of ignored arguments. -/
partial def getMatchWithScoreWithExtra (d : RefinedDiscrTree α) (e : Expr) (unify : Bool)
    (config : WhnfCoreConfig) (allowRootStar : Bool := false) :
    MetaM (Array (Array α × Nat × Nat)) 
goal: Lean.MetaM (Array (Array α × ℕ × ℕ))

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.Trie.mapArraysM
code: /-- Apply a monadic function to the array of values at each node in a `RefinedDiscrTree`. -/
partial def Trie.mapArraysM (t : RefinedDiscrTree.Trie α) (f : Array α → m (Array β)) :
    m (Trie β) 
goal: m (Mathlib.Meta.FunProp.RefinedDiscrTree.Trie β)

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.mapArraysM
code: /-- Apply a monadic function to the array of values at each node in a `RefinedDiscrTree`. -/
def mapArraysM (d : RefinedDiscrTree α) (f : Array α → m (Array β)) : m (RefinedDiscrTree β) 
goal: m (Mathlib.Meta.FunProp.RefinedDiscrTree β)

full_name: Mathlib.Meta.FunProp.RefinedDiscrTree.mapArrays
code: /-- Apply a function to the array of values at each node in a `RefinedDiscrTree`. -/
def mapArrays (d : RefinedDiscrTree α) (f : Array α → Array β) : RefinedDiscrTree β 
goal: Mathlib.Meta.FunProp.RefinedDiscrTree β