File: .lake/packages/lean4/src/lean/Lean/Elab/PreDefinition/Eqns.lean

full_name: Lean.Elab.Eqns.EqnInfoCore.value
code: structure EqnInfoCore where
  declName    : Name
  levelParams : List Name
  type        : Expr
  value       : Expr
  deriving Inhabited
goal: Lean.Expr

full_name: Lean.Elab.Eqns.EqnInfoCore.declName
code: structure EqnInfoCore where
  declName    : Name
  levelParams : List Name
  type        : Expr
  value       : Expr
  deriving Inhabited
goal: Lean.Name

full_name: Lean.Elab.Eqns.EqnInfoCore.levelParams
code: structure EqnInfoCore where
  declName    : Name
  levelParams : List Name
  type        : Expr
  value       : Expr
  deriving Inhabited
goal: List Lean.Name

full_name: Lean.Elab.Eqns.EqnInfoCore.type
code: structure EqnInfoCore where
  declName    : Name
  levelParams : List Name
  type        : Expr
  value       : Expr
  deriving Inhabited
goal: Lean.Expr

full_name: Lean.Elab.Eqns.EqnInfoCore
code: structure EqnInfoCore where
  declName    : Name
  levelParams : List Name
  type        : Expr
  value       : Expr
  deriving Inhabited
goal: Type

full_name: Lean.Elab.Eqns.instInhabitedEqnInfoCore
code: structure EqnInfoCore where
  declName    : Name
  levelParams : List Name
  type        : Expr
  value       : Expr
  deriving Inhabited
goal: Inhabited Lean.Elab.Eqns.EqnInfoCore

full_name: Lean.Elab.Eqns.expand
code: /--
Zeta reduces `let` and `let_fun` while consuming metadata.
Returns true if progress is made.
-/
partial def expand (progress : Bool) (e : Expr) : Bool × Expr 
goal: Bool × Lean.Expr

full_name: Lean.Elab.Eqns.expandRHS?
code: def expandRHS? (mvarId : MVarId) : MetaM (Option MVarId) 
goal: Lean.MetaM (Option Lean.MVarId)

full_name: Lean.Elab.Eqns.funext?
code: def funext? (mvarId : MVarId) : MetaM (Option MVarId) 
goal: Lean.MetaM (Option Lean.MVarId)

full_name: Lean.Elab.Eqns.simpMatch?
code: def simpMatch? (mvarId : MVarId) : MetaM (Option MVarId) 
goal: Lean.MetaM (Option Lean.MVarId)

full_name: Lean.Elab.Eqns.simpIf?
code: def simpIf? (mvarId : MVarId) : MetaM (Option MVarId) 
goal: Lean.MetaM (Option Lean.MVarId)

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.PreDefinition.Eqns.0.Lean.Elab.Eqns.findMatchToSplit?
code: private def findMatchToSplit? (env : Environment) (e : Expr) (declNames : Array Name) (exceptionSet : ExprSet) : Option Expr 
goal: Option Lean.Expr

full_name: Lean.Elab.Eqns.splitMatch?.go
code: partial def splitMatch? (mvarId : MVarId) (declNames : Array Name) : MetaM (Option (List MVarId)) 
goal: Lean.MetaM (Option (List Lean.MVarId))

full_name: Lean.Elab.Eqns.splitMatch?
code: partial def splitMatch? (mvarId : MVarId) (declNames : Array Name) : MetaM (Option (List MVarId)) 
goal: Lean.MetaM (Option (List Lean.MVarId))

full_name: Lean.Elab.Eqns.Context.declNames
code: structure Context where
  declNames : Array Name
goal: Array Lean.Name

full_name: Lean.Elab.Eqns.Context
code: structure Context where
  declNames : Array Name
goal: Type

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.PreDefinition.Eqns.0.Lean.Elab.Eqns.lhsDependsOn
code: private def lhsDependsOn (type : Expr) (fvarId : FVarId) : MetaM Bool 
goal: Lean.MetaM Bool

full_name: Lean.Elab.Eqns.tryURefl
code: /-- Try to close goal using `rfl` with smart unfolding turned off. -/
def tryURefl (mvarId : MVarId) : MetaM Bool 
goal: Lean.MetaM Bool

full_name: Lean.Elab.Eqns.simpEqnType
code: /--
  Eliminate `namedPatterns` from equation, and trivial hypotheses.
-/
def simpEqnType (eqnType : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Elab.Eqns.simpEqnType.collect
code: /--
  Eliminate `namedPatterns` from equation, and trivial hypotheses.
-/
def simpEqnType (eqnType : Expr) : MetaM Expr 
goal: Lean.FVarIdSet

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.PreDefinition.Eqns.0.Lean.Elab.Eqns.saveEqn
code: private partial def saveEqn (mvarId : MVarId) : StateRefT (Array Expr) MetaM Unit 
goal: StateRefT' IO.RealWorld (Array Lean.Expr) Lean.MetaM Unit

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.PreDefinition.Eqns.0.Lean.Elab.Eqns.saveEqn.pushDecl
code: private partial def saveEqn (mvarId : MVarId) : StateRefT (Array Expr) MetaM Unit 
goal: Lean.MetaM (Lean.FVarIdSet × Array Lean.FVarId)

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.PreDefinition.Eqns.0.Lean.Elab.Eqns.saveEqn.isIrrelevant
code: private partial def saveEqn (mvarId : MVarId) : StateRefT (Array Expr) MetaM Unit 
goal: Lean.MetaM Bool

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.PreDefinition.Eqns.0.Lean.Elab.Eqns.saveEqn.collectDeps
code: private partial def saveEqn (mvarId : MVarId) : StateRefT (Array Expr) MetaM Unit 
goal: Lean.MetaM (Lean.FVarIdSet × Array Lean.FVarId)

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.PreDefinition.Eqns.0.Lean.Elab.Eqns.shouldUseSimpMatch
code: /--
  Quick filter for deciding whether to use `simpMatch?` at `mkEqnTypes`.
  If the result is `false`, then it is not worth trying `simpMatch`.
-/
private def shouldUseSimpMatch (e : Expr) : MetaM Bool 
goal: Lean.MetaM Bool

full_name: Lean.Elab.Eqns.mkEqnTypes
code: partial def mkEqnTypes (tryRefl : Bool) (declNames : Array Name) (mvarId : MVarId) : MetaM (Array Expr) 
goal: Lean.MetaM (Array Lean.Expr)

full_name: Lean.Elab.Eqns.mkEqnTypes.go
code: partial def mkEqnTypes (tryRefl : Bool) (declNames : Array Name) (mvarId : MVarId) : MetaM (Array Expr) 
goal: ReaderT Lean.Elab.Eqns.Context (StateRefT' IO.RealWorld (Array Lean.Expr) Lean.MetaM) Unit

full_name: Lean.Elab.Eqns.removeUnusedEqnHypotheses.go
code: /--
  Some of the hypotheses added by `mkEqnTypes` may not be used by the actual proof (i.e., `value` argument).
  This method eliminates them.

  Alternative solution: improve `saveEqn` and make sure it never includes unnecessary hypotheses.
  These hypotheses are leftovers from tactics such as `splitMatch?` used in `mkEqnTypes`.
-/
def removeUnusedEqnHypotheses (declType declValue : Expr) : CoreM (Expr × Expr) 
goal: Lean.CoreM (Lean.Expr × Lean.Expr)

full_name: Lean.Elab.Eqns.removeUnusedEqnHypotheses
code: /--
  Some of the hypotheses added by `mkEqnTypes` may not be used by the actual proof (i.e., `value` argument).
  This method eliminates them.

  Alternative solution: improve `saveEqn` and make sure it never includes unnecessary hypotheses.
  These hypotheses are leftovers from tactics such as `splitMatch?` used in `mkEqnTypes`.
-/
def removeUnusedEqnHypotheses (declType declValue : Expr) : CoreM (Expr × Expr) 
goal: Lean.CoreM (Lean.Expr × Lean.Expr)

full_name: Lean.Elab.Eqns.deltaLHS
code: /-- Delta reduce the equation left-hand-side -/
def deltaLHS (mvarId : MVarId) : MetaM MVarId 
goal: Lean.MetaM Lean.MVarId

full_name: Lean.Elab.Eqns.deltaRHS?
code: def deltaRHS? (mvarId : MVarId) (declName : Name) : MetaM (Option MVarId) 
goal: Lean.MetaM (Option Lean.MVarId)

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.PreDefinition.Eqns.0.Lean.Elab.Eqns.whnfAux
code: private partial def whnfAux (e : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Elab.Eqns.whnfReducibleLHS?
code: /-- Apply `whnfR` to lhs, return `none` if `lhs` was not modified -/
def whnfReducibleLHS? (mvarId : MVarId) : MetaM (Option MVarId) 
goal: Lean.MetaM (Option Lean.MVarId)

full_name: Lean.Elab.Eqns.tryContradiction
code: def tryContradiction (mvarId : MVarId) : MetaM Bool 
goal: Lean.MetaM Bool

full_name: Lean.Elab.Eqns.mkUnfoldProof
code: /--
  Auxiliary method for `mkUnfoldEq`. The structure is based on `mkEqnTypes`.
  `mvarId` is the goal to be proved. It is a goal of the form
  ```
  declName x_1 ... x_n = body[x_1, ..., x_n]
  ```
  The proof is constructed using the automatically generated equational theorems.
  We basically keep splitting the `match` and `if-then-else` expressions in the right hand side
  until one of the equational theorems is applicable.
-/
partial def mkUnfoldProof (declName : Name) (mvarId : MVarId) : MetaM Unit 
goal: Lean.MetaM Unit

full_name: Lean.Elab.Eqns.mkUnfoldProof.go
code: /--
  Auxiliary method for `mkUnfoldEq`. The structure is based on `mkEqnTypes`.
  `mvarId` is the goal to be proved. It is a goal of the form
  ```
  declName x_1 ... x_n = body[x_1, ..., x_n]
  ```
  The proof is constructed using the automatically generated equational theorems.
  We basically keep splitting the `match` and `if-then-else` expressions in the right hand side
  until one of the equational theorems is applicable.
-/
partial def mkUnfoldProof (declName : Name) (mvarId : MVarId) : MetaM Unit 
goal: Lean.MetaM Unit

full_name: Lean.Elab.Eqns.mkUnfoldEq
code: /-- Generate the "unfold" lemma for `declName`. -/
def mkUnfoldEq (declName : Name) (info : EqnInfoCore) : MetaM Name 
goal: Lean.MetaM Lean.Name

full_name: Lean.Elab.Eqns.getUnfoldFor?
code: def getUnfoldFor? (declName : Name) (getInfo? : Unit → Option EqnInfoCore) : MetaM (Option Name) 
goal: Lean.MetaM (Option Lean.Name)

full_name: Lean.Elab.Eqns.initFn._@..lake.packages.lean4.src.lean.Lean.Elab.PreDefinition.Eqns._hyg.6512
code: builtin_initialize
  registerTraceClass `Elab.definition.unfoldEqn
  registerTraceClass `Elab.definition.eqns
goal: IO Unit