File: Mathlib/Util/CompileInductive.lean

full_name: _private.Mathlib.Util.CompileInductive.0.Mathlib.Util.replaceConst
code: private def replaceConst (repl : AssocList Name Name) (e : Expr) : Expr 
goal: Lean.Expr

full_name: Mathlib.Util.mkRecNames
code: /-- Returns the names of the recursors for a nested or mutual inductive,
using the `all` and `numMotives` arguments from `RecursorVal`. -/
def mkRecNames (all : List Name) (numMotives : Nat) : List Name 
goal: List Lean.Name

full_name: _private.Mathlib.Util.CompileInductive.0.Mathlib.Util.addAndCompile'
code: private def addAndCompile' (decl : Declaration) : CoreM Unit 
goal: Lean.CoreM Unit

full_name: Mathlib.Util.compileDefn
code: /--
Compile the definition `dv` by adding a second definition `dv✝` with the same body,
and registering a `csimp`-lemma `dv = dv✝`.
-/
def compileDefn (dv : DefinitionVal) : MetaM Unit 
goal: Lean.MetaM Unit

full_name: Mathlib.Util.isCompiled
code: /-- Returns true if the given declaration has already been compiled, either directly or via a
`@[csimp]` lemma. -/
def isCompiled (env : Environment) (n : Name) : Bool 
goal: Bool

full_name: Mathlib.Util.«commandCompile_def%_»
code: /--
`compile_def% Foo.foo` adds compiled code for the definition `Foo.foo`.
This can be used for type class projections or definitions like `List._sizeOf_1`,
for which Lean does not generate compiled code by default
(since it is not used 99% of the time).
-/
elab tk:"compile_def% " i:ident : command => Command.liftTermElabM do
  let n ← realizeGlobalConstNoOverloadWithInfo i
  if isCompiled (← getEnv) n then
    logWarningAt tk m!"already compiled {n}"
    return
  let dv ← withRef i <| getConstInfoDefn n
  withRef tk <| compileDefn dv
goal: Lean.ParserDescr

full_name: Mathlib.Util.«_aux_Mathlib_Util_CompileInductive___elabRules_Mathlib_Util_commandCompile_def%__1»
code: /--
`compile_def% Foo.foo` adds compiled code for the definition `Foo.foo`.
This can be used for type class projections or definitions like `List._sizeOf_1`,
for which Lean does not generate compiled code by default
(since it is not used 99% of the time).
-/
elab tk:"compile_def% " i:ident : command => Command.liftTermElabM do
  let n ← realizeGlobalConstNoOverloadWithInfo i
  if isCompiled (← getEnv) n then
    logWarningAt tk m!"already compiled {n}"
    return
  let dv ← withRef i <| getConstInfoDefn n
  withRef tk <| compileDefn dv
goal: Lean.Elab.Command.CommandElab

full_name: _private.Mathlib.Util.CompileInductive.0.Mathlib.Util.compileStructOnly.go
code: private def compileStructOnly (iv : InductiveVal) (rv : RecursorVal) : MetaM Unit 
goal: Lean.MetaM Unit

full_name: _private.Mathlib.Util.CompileInductive.0.Mathlib.Util.compileStructOnly
code: private def compileStructOnly (iv : InductiveVal) (rv : RecursorVal) : MetaM Unit 
goal: Lean.MetaM Unit

full_name: Mathlib.Util.compileInductiveOnly
code: /--
Generate compiled code for the recursor for `iv`, excluding the `sizeOf` function.
-/
def compileInductiveOnly (iv : InductiveVal) (warn := true) : MetaM Unit 
goal: Lean.MetaM Unit

full_name: Mathlib.Util.«_aux_Mathlib_Util_CompileInductive___elabRules_Mathlib_Util_commandCompile_inductive%__1»
code: /--
`compile_inductive% Foo` creates compiled code for the recursor `Foo.rec`,
so that `Foo.rec` can be used in a definition
without having to mark the definition as `noncomputable`.
-/
elab tk:"compile_inductive% " i:ident : command => Command.liftTermElabM do
  let n ← realizeGlobalConstNoOverloadWithInfo i
  let iv ← withRef i <| getConstInfoInduct n
  withRef tk <| compileInductive iv
goal: Lean.Elab.Command.CommandElab

full_name: Mathlib.Util.«commandCompile_inductive%_»
code: /--
`compile_inductive% Foo` creates compiled code for the recursor `Foo.rec`,
so that `Foo.rec` can be used in a definition
without having to mark the definition as `noncomputable`.
-/
elab tk:"compile_inductive% " i:ident : command => Command.liftTermElabM do
  let n ← realizeGlobalConstNoOverloadWithInfo i
  let iv ← withRef i <| getConstInfoInduct n
  withRef tk <| compileInductive iv
goal: Lean.ParserDescr

full_name: _private.Mathlib.Util.CompileInductive.0.Float.valUnsafe
code: private unsafe def Float.valUnsafe : Float → floatSpec.float 
goal: Float → floatSpec.float

full_name: _private.Mathlib.Util.CompileInductive.0.Float.mkUnsafe
code: private unsafe def Float.mkUnsafe : floatSpec.float → Float 
goal: floatSpec.float → Float

full_name: _private.Mathlib.Util.CompileInductive.0.Float.valImpl
code: @[implemented_by Float.valUnsafe] private def Float.valImpl (x : Float) : floatSpec.float 
goal: floatSpec.float

full_name: _private.Mathlib.Util.CompileInductive.0.Float.mkImpl
code: @[implemented_by Float.mkUnsafe] private def Float.mkImpl (x : floatSpec.float) : Float 
goal: Float

full_name: _private.Mathlib.Util.CompileInductive.0.Float.val_eq
code: @[csimp] private theorem Float.val_eq : @Float.val = Float.valImpl 
goal: Float.val = Float.valImpl

full_name: _private.Mathlib.Util.CompileInductive.0.Float.mk_eq
code: @[csimp] private theorem Float.mk_eq : @Float.mk = Float.mkImpl 
goal: Float.mk = Float.mkImpl