File: .lake/packages/lean4/src/lean/Lean/Elab/Tactic/Simp.lean

full_name: Lean.Elab.Tactic.elabSimpConfigCore
code: declare_config_elab elabSimpConfigCore    Meta.Simp.Config
goal: Lean.Syntax → Lean.Elab.TermElabM Lean.Meta.Simp.Config

full_name: Lean.Elab.Tactic.eval._@..lake.packages.lean4.src.lean.Lean.Elab.Tactic.Simp._hyg.6
code: declare_config_elab elabSimpConfigCore    Meta.Simp.Config
goal: Lean.Expr → Lean.Elab.TermElabM Lean.Meta.Simp.Config

full_name: Lean.Elab.Tactic.evalUnsafe._@..lake.packages.lean4.src.lean.Lean.Elab.Tactic.Simp._hyg.6
code: declare_config_elab elabSimpConfigCore    Meta.Simp.Config
goal: Lean.Expr → Lean.Elab.TermElabM Lean.Meta.Simp.Config

full_name: Lean.Elab.Tactic.evalUnsafe._@..lake.packages.lean4.src.lean.Lean.Elab.Tactic.Simp._hyg.194
code: declare_config_elab elabSimpConfigCtxCore Meta.Simp.ConfigCtx
goal: Lean.Expr → Lean.Elab.TermElabM Lean.Meta.Simp.ConfigCtx

full_name: Lean.Elab.Tactic.eval._@..lake.packages.lean4.src.lean.Lean.Elab.Tactic.Simp._hyg.194
code: declare_config_elab elabSimpConfigCtxCore Meta.Simp.ConfigCtx
goal: Lean.Expr → Lean.Elab.TermElabM Lean.Meta.Simp.ConfigCtx

full_name: Lean.Elab.Tactic.elabSimpConfigCtxCore
code: declare_config_elab elabSimpConfigCtxCore Meta.Simp.ConfigCtx
goal: Lean.Syntax → Lean.Elab.TermElabM Lean.Meta.Simp.ConfigCtx

full_name: Lean.Elab.Tactic.elabDSimpConfigCore
code: declare_config_elab elabDSimpConfigCore   Meta.DSimp.Config
goal: Lean.Syntax → Lean.Elab.TermElabM Lean.Meta.DSimp.Config

full_name: Lean.Elab.Tactic.eval._@..lake.packages.lean4.src.lean.Lean.Elab.Tactic.Simp._hyg.382
code: declare_config_elab elabDSimpConfigCore   Meta.DSimp.Config
goal: Lean.Expr → Lean.Elab.TermElabM Lean.Meta.DSimp.Config

full_name: Lean.Elab.Tactic.evalUnsafe._@..lake.packages.lean4.src.lean.Lean.Elab.Tactic.Simp._hyg.382
code: declare_config_elab elabDSimpConfigCore   Meta.DSimp.Config
goal: Lean.Expr → Lean.Elab.TermElabM Lean.Meta.DSimp.Config

full_name: Lean.Elab.Tactic.instInhabitedSimpKind
code: inductive SimpKind where
  | simp
  | simpAll
  | dsimp
  deriving Inhabited, BEq
goal: Inhabited Lean.Elab.Tactic.SimpKind

full_name: Lean.Elab.Tactic.SimpKind.simp
code: inductive SimpKind where
  | simp
  | simpAll
  | dsimp
  deriving Inhabited, BEq
goal: Lean.Elab.Tactic.SimpKind

full_name: Lean.Elab.Tactic.SimpKind
code: inductive SimpKind where
  | simp
  | simpAll
  | dsimp
  deriving Inhabited, BEq
goal: Type

full_name: Lean.Elab.Tactic.SimpKind.dsimp
code: inductive SimpKind where
  | simp
  | simpAll
  | dsimp
  deriving Inhabited, BEq
goal: Lean.Elab.Tactic.SimpKind

full_name: Lean.Elab.Tactic.SimpKind.simpAll
code: inductive SimpKind where
  | simp
  | simpAll
  | dsimp
  deriving Inhabited, BEq
goal: Lean.Elab.Tactic.SimpKind

full_name: Lean.Elab.Tactic.instBEqSimpKind
code: BEq
goal: BEq Lean.Elab.Tactic.SimpKind

full_name: Lean.Elab.Tactic.tacticToDischarge
code: /--
  Implement a `simp` discharge function using the given tactic syntax code.
  Recall that `simp` dischargers are in `SimpM` which does not have access to `Term.State`.
  We need access to `Term.State` to store messages and update the info tree.
  Thus, we create an `IO.ref` to track these changes at `Term.State` when we execute `tacticCode`.
  We must set this reference with the current `Term.State` before we execute `simp` using the
  generated `Simp.Discharge`. -/
def tacticToDischarge (tacticCode : Syntax) : TacticM (IO.Ref Term.State × Simp.Discharge) 
goal: Lean.Elab.Tactic.TacticM (IO.Ref Lean.Elab.Term.State × Lean.Meta.Simp.Discharge)

full_name: Lean.Elab.Tactic.Simp.DischargeWrapper.default
code: inductive Simp.DischargeWrapper where
  | default
  | custom (ref : IO.Ref Term.State) (discharge : Simp.Discharge)
goal: Lean.Elab.Tactic.Simp.DischargeWrapper

full_name: Lean.Elab.Tactic.Simp.DischargeWrapper.custom
code: inductive Simp.DischargeWrapper where
  | default
  | custom (ref : IO.Ref Term.State) (discharge : Simp.Discharge)
goal: Lean.Elab.Tactic.Simp.DischargeWrapper

full_name: Lean.Elab.Tactic.Simp.DischargeWrapper
code: inductive Simp.DischargeWrapper where
  | default
  | custom (ref : IO.Ref Term.State) (discharge : Simp.Discharge)
goal: Type

full_name: Lean.Elab.Tactic.Simp.DischargeWrapper.with
code: def Simp.DischargeWrapper.with (w : Simp.DischargeWrapper) (x : Option Simp.Discharge → TacticM α) : TacticM α 
goal: Lean.Elab.Tactic.TacticM α

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Tactic.Simp.0.Lean.Elab.Tactic.mkDischargeWrapper
code: /-- Construct a `Simp.DischargeWrapper` from the `Syntax` for a `simp` discharger. -/
private def mkDischargeWrapper (optDischargeSyntax : Syntax) : TacticM Simp.DischargeWrapper 
goal: Lean.Elab.Tactic.TacticM Lean.Elab.Tactic.Simp.DischargeWrapper

full_name: Lean.Elab.Tactic.elabSimpConfig
code: def elabSimpConfig (optConfig : Syntax) (kind : SimpKind) : TermElabM Meta.Simp.Config 
goal: Lean.Elab.TermElabM Lean.Meta.Simp.Config

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Tactic.Simp.0.Lean.Elab.Tactic.addDeclToUnfoldOrTheorem
code: private def addDeclToUnfoldOrTheorem (thms : SimpTheorems) (id : Origin) (e : Expr) (post : Bool) (inv : Bool) (kind : SimpKind) : MetaM SimpTheorems 
goal: Lean.MetaM Lean.Meta.SimpTheorems

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Tactic.Simp.0.Lean.Elab.Tactic.addSimpTheorem
code: private def addSimpTheorem (thms : SimpTheorems) (id : Origin) (stx : Syntax) (post : Bool) (inv : Bool) : TermElabM SimpTheorems 
goal: Lean.Elab.TermElabM Lean.Meta.SimpTheorems

full_name: Lean.Elab.Tactic.ElabSimpArgsResult.starArg
code: structure ElabSimpArgsResult where
  ctx      : Simp.Context
  simprocs : Simp.SimprocsArray
  starArg  : Bool := false
goal: Bool

full_name: Lean.Elab.Tactic.ElabSimpArgsResult.simprocs
code: structure ElabSimpArgsResult where
  ctx      : Simp.Context
  simprocs : Simp.SimprocsArray
  starArg  : Bool := false
goal: Lean.Meta.Simp.SimprocsArray

full_name: Lean.Elab.Tactic.ElabSimpArgsResult
code: structure ElabSimpArgsResult where
  ctx      : Simp.Context
  simprocs : Simp.SimprocsArray
  starArg  : Bool := false
goal: Type

full_name: Lean.Elab.Tactic.ElabSimpArgsResult.ctx
code: structure ElabSimpArgsResult where
  ctx      : Simp.Context
  simprocs : Simp.SimprocsArray
  starArg  : Bool := false
goal: Lean.Meta.Simp.Context

full_name: Lean.Elab.Tactic.ResolveSimpIdResult.expr
code: inductive ResolveSimpIdResult where
  | none
  | expr (e : Expr)
  | simproc (declName : Name)
  /--
  Recall that when we declare a `simp` attribute using `register_simp_attr`, we automatically
  create a `simproc` attribute. However, if the user creates `simp` and `simproc` attributes
  programmatically, then one of them may be missing. Moreover, when we write `simp [seval]`,
  we want to retrieve both the simp and simproc sets. We want to hide from users that
  `simp` and `simproc` sets are stored in different data-structures.
  -/
  | ext  (ext₁? : Option SimpExtension) (ext₂? : Option Simp.SimprocExtension) (h : ext₁?.isSome || ext₂?.isSome)
goal: Lean.Elab.Tactic.ResolveSimpIdResult

full_name: Lean.Elab.Tactic.ResolveSimpIdResult.ext
code: inductive ResolveSimpIdResult where
  | none
  | expr (e : Expr)
  | simproc (declName : Name)
  /--
  Recall that when we declare a `simp` attribute using `register_simp_attr`, we automatically
  create a `simproc` attribute. However, if the user creates `simp` and `simproc` attributes
  programmatically, then one of them may be missing. Moreover, when we write `simp [seval]`,
  we want to retrieve both the simp and simproc sets. We want to hide from users that
  `simp` and `simproc` sets are stored in different data-structures.
  -/
  | ext  (ext₁? : Option SimpExtension) (ext₂? : Option Simp.SimprocExtension) (h : ext₁?.isSome || ext₂?.isSome)
goal: Lean.Elab.Tactic.ResolveSimpIdResult

full_name: Lean.Elab.Tactic.ResolveSimpIdResult
code: inductive ResolveSimpIdResult where
  | none
  | expr (e : Expr)
  | simproc (declName : Name)
  /--
  Recall that when we declare a `simp` attribute using `register_simp_attr`, we automatically
  create a `simproc` attribute. However, if the user creates `simp` and `simproc` attributes
  programmatically, then one of them may be missing. Moreover, when we write `simp [seval]`,
  we want to retrieve both the simp and simproc sets. We want to hide from users that
  `simp` and `simproc` sets are stored in different data-structures.
  -/
  | ext  (ext₁? : Option SimpExtension) (ext₂? : Option Simp.SimprocExtension) (h : ext₁?.isSome || ext₂?.isSome)
goal: Type

full_name: Lean.Elab.Tactic.ResolveSimpIdResult.simproc
code: inductive ResolveSimpIdResult where
  | none
  | expr (e : Expr)
  | simproc (declName : Name)
  /--
  Recall that when we declare a `simp` attribute using `register_simp_attr`, we automatically
  create a `simproc` attribute. However, if the user creates `simp` and `simproc` attributes
  programmatically, then one of them may be missing. Moreover, when we write `simp [seval]`,
  we want to retrieve both the simp and simproc sets. We want to hide from users that
  `simp` and `simproc` sets are stored in different data-structures.
  -/
  | ext  (ext₁? : Option SimpExtension) (ext₂? : Option Simp.SimprocExtension) (h : ext₁?.isSome || ext₂?.isSome)
goal: Lean.Elab.Tactic.ResolveSimpIdResult

full_name: Lean.Elab.Tactic.ResolveSimpIdResult.none
code: inductive ResolveSimpIdResult where
  | none
  | expr (e : Expr)
  | simproc (declName : Name)
  /--
  Recall that when we declare a `simp` attribute using `register_simp_attr`, we automatically
  create a `simproc` attribute. However, if the user creates `simp` and `simproc` attributes
  programmatically, then one of them may be missing. Moreover, when we write `simp [seval]`,
  we want to retrieve both the simp and simproc sets. We want to hide from users that
  `simp` and `simproc` sets are stored in different data-structures.
  -/
  | ext  (ext₁? : Option SimpExtension) (ext₂? : Option Simp.SimprocExtension) (h : ext₁?.isSome || ext₂?.isSome)
goal: Lean.Elab.Tactic.ResolveSimpIdResult

full_name: Lean.Elab.Tactic.elabSimpArgs.resolveSimpIdTheorem?
code: /--
  Elaborate extra simp theorems provided to `simp`. `stx` is of the form `"[" simpTheorem,* "]"`
  If `eraseLocal == true`, then we consider local declarations when resolving names for erased theorems (`- id`),
  this option only makes sense for `simp_all` or `*` is used.
  When `recover := true`, try to recover from errors as much as possible so that users keep seeing
  the current goal.
-/
def elabSimpArgs (stx : Syntax) (ctx : Simp.Context) (simprocs : Simp.SimprocsArray) (eraseLocal : Bool) (kind : SimpKind) : TacticM ElabSimpArgsResult 
goal: Lean.Elab.Tactic.TacticM Lean.Elab.Tactic.ResolveSimpIdResult

full_name: Lean.Elab.Tactic.elabSimpArgs
code: /--
  Elaborate extra simp theorems provided to `simp`. `stx` is of the form `"[" simpTheorem,* "]"`
  If `eraseLocal == true`, then we consider local declarations when resolving names for erased theorems (`- id`),
  this option only makes sense for `simp_all` or `*` is used.
  When `recover := true`, try to recover from errors as much as possible so that users keep seeing
  the current goal.
-/
def elabSimpArgs (stx : Syntax) (ctx : Simp.Context) (simprocs : Simp.SimprocsArray) (eraseLocal : Bool) (kind : SimpKind) : TacticM ElabSimpArgsResult 
goal: Lean.Elab.Tactic.TacticM Lean.Elab.Tactic.ElabSimpArgsResult

full_name: Lean.Elab.Tactic.elabSimpArgs.isSimproc?
code: /--
  Elaborate extra simp theorems provided to `simp`. `stx` is of the form `"[" simpTheorem,* "]"`
  If `eraseLocal == true`, then we consider local declarations when resolving names for erased theorems (`- id`),
  this option only makes sense for `simp_all` or `*` is used.
  When `recover := true`, try to recover from errors as much as possible so that users keep seeing
  the current goal.
-/
def elabSimpArgs (stx : Syntax) (ctx : Simp.Context) (simprocs : Simp.SimprocsArray) (eraseLocal : Bool) (kind : SimpKind) : TacticM ElabSimpArgsResult 
goal: Lean.MetaM (Option Lean.Name)

full_name: Lean.Elab.Tactic.simpOnlyBuiltins
code: @[inline] def simpOnlyBuiltins : List Name 
goal: List Lean.Name

full_name: Lean.Elab.Tactic.MkSimpContextResult
code: structure MkSimpContextResult where
  ctx              : Simp.Context
  simprocs         : Simp.SimprocsArray
  dischargeWrapper : Simp.DischargeWrapper
goal: Type

full_name: Lean.Elab.Tactic.MkSimpContextResult.ctx
code: structure MkSimpContextResult where
  ctx              : Simp.Context
  simprocs         : Simp.SimprocsArray
  dischargeWrapper : Simp.DischargeWrapper
goal: Lean.Meta.Simp.Context

full_name: Lean.Elab.Tactic.MkSimpContextResult.simprocs
code: structure MkSimpContextResult where
  ctx              : Simp.Context
  simprocs         : Simp.SimprocsArray
  dischargeWrapper : Simp.DischargeWrapper
goal: Lean.Meta.Simp.SimprocsArray

full_name: Lean.Elab.Tactic.MkSimpContextResult.dischargeWrapper
code: structure MkSimpContextResult where
  ctx              : Simp.Context
  simprocs         : Simp.SimprocsArray
  dischargeWrapper : Simp.DischargeWrapper
goal: Lean.Elab.Tactic.Simp.DischargeWrapper

full_name: Lean.Elab.Tactic.mkSimpContext
code: /--
   Create the `Simp.Context` for the `simp`, `dsimp`, and `simp_all` tactics.
   If `kind != SimpKind.simp`, the `discharge` option must be `none`

   TODO: generate error message if non `rfl` theorems are provided as arguments to `dsimp`.

   The argument `simpTheorems` defaults to `getSimpTheorems`,
   but allows overriding with an arbitrary mechanism to choose
   the simp theorems besides those specified in the syntax.
   Note that if the syntax includes `simp only`, the `simpTheorems` argument is ignored.
-/
def mkSimpContext (stx : Syntax) (eraseLocal : Bool) (kind := SimpKind.simp)
    (ignoreStarArg : Bool := false) (simpTheorems : CoreM SimpTheorems := getSimpTheorems) :
    TacticM MkSimpContextResult 
goal: Lean.Elab.Tactic.TacticM Lean.Elab.Tactic.MkSimpContextResult

full_name: Lean.Elab.Tactic.initFn._@..lake.packages.lean4.src.lean.Lean.Elab.Tactic.Simp._hyg.4935
code: register_builtin_option tactic.simp.trace : Bool := {
  defValue := false
  descr    := "When tracing is enabled, calls to `simp` or `dsimp` will print an equivalent `simp only` call."
}
goal: IO (Lean.Option Bool)

full_name: Lean.Elab.Tactic.tactic.simp.trace
code: register_builtin_option tactic.simp.trace : Bool := {
  defValue := false
  descr    := "When tracing is enabled, calls to `simp` or `dsimp` will print an equivalent `simp only` call."
}
goal: Lean.Option Bool

full_name: Lean.Elab.Tactic.mkSimpOnly
code: /--
If `stx` is the syntax of a `simp`, `simp_all` or `dsimp` tactic invocation, and
`usedSimps` is the set of simp lemmas used by this invocation, then `mkSimpOnly`
creates the syntax of an equivalent `simp only`, `simp_all only` or `dsimp only`
invocation.
-/
def mkSimpOnly (stx : Syntax) (usedSimps : Simp.UsedSimps) : MetaM Syntax 
goal: Lean.MetaM Lean.Syntax

full_name: Lean.Elab.Tactic.traceSimpCall
code: def traceSimpCall (stx : Syntax) (usedSimps : Simp.UsedSimps) : MetaM Unit 
goal: Lean.MetaM Unit

full_name: Lean.Elab.Tactic.simpLocation
code: /--
`simpLocation ctx discharge? varIdToLemmaId loc`
runs the simplifier at locations specified by `loc`,
using the simp theorems collected in `ctx`
optionally running a discharger specified in `discharge?` on generated subgoals.

Its primary use is as the implementation of the
`simp [...] at ...` and `simp only [...] at ...` syntaxes,
but can also be used by other tactics when a `Syntax` is not available.

For many tactics other than the simplifier,
one should use the `withLocation` tactic combinator
when working with a `location`.
-/
def simpLocation (ctx : Simp.Context) (simprocs : Simp.SimprocsArray) (discharge? : Option Simp.Discharge := none) (loc : Location) : TacticM Simp.Stats 
goal: Lean.Elab.Tactic.TacticM Lean.Meta.Simp.Stats

full_name: Lean.Elab.Tactic.simpLocation.go
code: /--
`simpLocation ctx discharge? varIdToLemmaId loc`
runs the simplifier at locations specified by `loc`,
using the simp theorems collected in `ctx`
optionally running a discharger specified in `discharge?` on generated subgoals.

Its primary use is as the implementation of the
`simp [...] at ...` and `simp only [...] at ...` syntaxes,
but can also be used by other tactics when a `Syntax` is not available.

For many tactics other than the simplifier,
one should use the `withLocation` tactic combinator
when working with a `location`.
-/
def simpLocation (ctx : Simp.Context) (simprocs : Simp.SimprocsArray) (discharge? : Option Simp.Discharge := none) (loc : Location) : TacticM Simp.Stats 
goal: Lean.Elab.Tactic.TacticM Lean.Meta.Simp.Stats

full_name: Lean.Elab.Tactic.withSimpDiagnostics
code: def withSimpDiagnostics (x : TacticM Simp.Diagnostics) : TacticM Unit 
goal: Lean.Elab.Tactic.TacticM Unit

full_name: Lean.Elab.Tactic.evalSimp
code: @[builtin_tactic Lean.Parser.Tactic.simp] def evalSimp : Tactic 
goal: Lean.Elab.Tactic.Tactic

full_name: Lean.Elab.Tactic.evalSimpAll
code: @[builtin_tactic Lean.Parser.Tactic.simpAll] def evalSimpAll : Tactic 
goal: Lean.Elab.Tactic.Tactic

full_name: Lean.Elab.Tactic.dsimpLocation.go
code: def dsimpLocation (ctx : Simp.Context) (simprocs : Simp.SimprocsArray) (loc : Location) : TacticM Unit 
goal: Lean.Elab.Tactic.TacticM Unit

full_name: Lean.Elab.Tactic.dsimpLocation
code: def dsimpLocation (ctx : Simp.Context) (simprocs : Simp.SimprocsArray) (loc : Location) : TacticM Unit 
goal: Lean.Elab.Tactic.TacticM Unit

full_name: Lean.Elab.Tactic.evalDSimp
code: @[builtin_tactic Lean.Parser.Tactic.dsimp] def evalDSimp : Tactic 
goal: Lean.Elab.Tactic.Tactic

full_name: Lean.Parser.Tactic.getSimpArgs?
code: /-- Extract the arguments from a `simpArgs` syntax as an array of syntaxes -/
def getSimpArgs? : Syntax → Option (Array Syntax)
  
goal: Lean.Syntax → Option (Array Lean.Syntax)

full_name: Lean.Parser.Tactic.getDSimpArgs?
code: /-- Extract the arguments from a `dsimpArgs` syntax as an array of syntaxes -/
def getDSimpArgs? : Syntax → Option (Array Syntax)
  
goal: Lean.Syntax → Option (Array Lean.Syntax)