File: .lake/packages/lean4/src/lean/Lean/Elab/Structure.lean

full_name: Lean.Elab.Command.StructCtorView.name
code: structure StructCtorView where
  ref       : Syntax
  modifiers : Modifiers
  name      : Name
  declName  : Name
goal: Lean.Name

full_name: Lean.Elab.Command.StructCtorView.ref
code: structure StructCtorView where
  ref       : Syntax
  modifiers : Modifiers
  name      : Name
  declName  : Name
goal: Lean.Syntax

full_name: Lean.Elab.Command.StructCtorView.declName
code: structure StructCtorView where
  ref       : Syntax
  modifiers : Modifiers
  name      : Name
  declName  : Name
goal: Lean.Name

full_name: Lean.Elab.Command.StructCtorView
code: structure StructCtorView where
  ref       : Syntax
  modifiers : Modifiers
  name      : Name
  declName  : Name
goal: Type

full_name: Lean.Elab.Command.StructCtorView.modifiers
code: structure StructCtorView where
  ref       : Syntax
  modifiers : Modifiers
  name      : Name
  declName  : Name
goal: Lean.Elab.Modifiers

full_name: Lean.Elab.Command.StructFieldView
code: structure StructFieldView where
  ref        : Syntax
  modifiers  : Modifiers
  binderInfo : BinderInfo
  declName   : Name
  name       : Name -- The field name as it is going to be registered in the kernel. It does not include macroscopes.
  rawName    : Name -- Same as `name` but including macroscopes.
  binders    : Syntax
  type?      : Option Syntax
  value?     : Option Syntax
goal: Type

full_name: Lean.Elab.Command.StructFieldView.type?
code: structure StructFieldView where
  ref        : Syntax
  modifiers  : Modifiers
  binderInfo : BinderInfo
  declName   : Name
  name       : Name -- The field name as it is going to be registered in the kernel. It does not include macroscopes.
  rawName    : Name -- Same as `name` but including macroscopes.
  binders    : Syntax
  type?      : Option Syntax
  value?     : Option Syntax
goal: Option Lean.Syntax

full_name: Lean.Elab.Command.StructFieldView.binderInfo
code: structure StructFieldView where
  ref        : Syntax
  modifiers  : Modifiers
  binderInfo : BinderInfo
  declName   : Name
  name       : Name -- The field name as it is going to be registered in the kernel. It does not include macroscopes.
  rawName    : Name -- Same as `name` but including macroscopes.
  binders    : Syntax
  type?      : Option Syntax
  value?     : Option Syntax
goal: Lean.BinderInfo

full_name: Lean.Elab.Command.StructFieldView.declName
code: structure StructFieldView where
  ref        : Syntax
  modifiers  : Modifiers
  binderInfo : BinderInfo
  declName   : Name
  name       : Name -- The field name as it is going to be registered in the kernel. It does not include macroscopes.
  rawName    : Name -- Same as `name` but including macroscopes.
  binders    : Syntax
  type?      : Option Syntax
  value?     : Option Syntax
goal: Lean.Name

full_name: Lean.Elab.Command.StructFieldView.rawName
code: structure StructFieldView where
  ref        : Syntax
  modifiers  : Modifiers
  binderInfo : BinderInfo
  declName   : Name
  name       : Name -- The field name as it is going to be registered in the kernel. It does not include macroscopes.
  rawName    : Name -- Same as `name` but including macroscopes.
  binders    : Syntax
  type?      : Option Syntax
  value?     : Option Syntax
goal: Lean.Name

full_name: Lean.Elab.Command.StructFieldView.binders
code: structure StructFieldView where
  ref        : Syntax
  modifiers  : Modifiers
  binderInfo : BinderInfo
  declName   : Name
  name       : Name -- The field name as it is going to be registered in the kernel. It does not include macroscopes.
  rawName    : Name -- Same as `name` but including macroscopes.
  binders    : Syntax
  type?      : Option Syntax
  value?     : Option Syntax
goal: Lean.Syntax

full_name: Lean.Elab.Command.StructFieldView.value?
code: structure StructFieldView where
  ref        : Syntax
  modifiers  : Modifiers
  binderInfo : BinderInfo
  declName   : Name
  name       : Name -- The field name as it is going to be registered in the kernel. It does not include macroscopes.
  rawName    : Name -- Same as `name` but including macroscopes.
  binders    : Syntax
  type?      : Option Syntax
  value?     : Option Syntax
goal: Option Lean.Syntax

full_name: Lean.Elab.Command.StructFieldView.name
code: structure StructFieldView where
  ref        : Syntax
  modifiers  : Modifiers
  binderInfo : BinderInfo
  declName   : Name
  name       : Name -- The field name as it is going to be registered in the kernel. It does not include macroscopes.
  rawName    : Name -- Same as `name` but including macroscopes.
  binders    : Syntax
  type?      : Option Syntax
  value?     : Option Syntax
goal: Lean.Name

full_name: Lean.Elab.Command.StructFieldView.modifiers
code: structure StructFieldView where
  ref        : Syntax
  modifiers  : Modifiers
  binderInfo : BinderInfo
  declName   : Name
  name       : Name -- The field name as it is going to be registered in the kernel. It does not include macroscopes.
  rawName    : Name -- Same as `name` but including macroscopes.
  binders    : Syntax
  type?      : Option Syntax
  value?     : Option Syntax
goal: Lean.Elab.Modifiers

full_name: Lean.Elab.Command.StructFieldView.ref
code: structure StructFieldView where
  ref        : Syntax
  modifiers  : Modifiers
  binderInfo : BinderInfo
  declName   : Name
  name       : Name -- The field name as it is going to be registered in the kernel. It does not include macroscopes.
  rawName    : Name -- Same as `name` but including macroscopes.
  binders    : Syntax
  type?      : Option Syntax
  value?     : Option Syntax
goal: Lean.Syntax

full_name: Lean.Elab.Command.StructView.parents
code: structure StructView where
  ref               : Syntax
  modifiers         : Modifiers
  scopeLevelNames   : List Name  -- All `universe` declarations in the current scope
  allUserLevelNames : List Name  -- `scopeLevelNames` ++ explicit universe parameters provided in the `structure` command
  isClass           : Bool
  declName          : Name
  scopeVars         : Array Expr -- All `variable` declaration in the current scope
  params            : Array Expr -- Explicit parameters provided in the `structure` command
  parents           : Array Syntax
  type              : Syntax
  ctor              : StructCtorView
  fields            : Array StructFieldView
goal: Array Lean.Syntax

full_name: Lean.Elab.Command.StructView.fields
code: structure StructView where
  ref               : Syntax
  modifiers         : Modifiers
  scopeLevelNames   : List Name  -- All `universe` declarations in the current scope
  allUserLevelNames : List Name  -- `scopeLevelNames` ++ explicit universe parameters provided in the `structure` command
  isClass           : Bool
  declName          : Name
  scopeVars         : Array Expr -- All `variable` declaration in the current scope
  params            : Array Expr -- Explicit parameters provided in the `structure` command
  parents           : Array Syntax
  type              : Syntax
  ctor              : StructCtorView
  fields            : Array StructFieldView
goal: Array Lean.Elab.Command.StructFieldView

full_name: Lean.Elab.Command.StructView.params
code: structure StructView where
  ref               : Syntax
  modifiers         : Modifiers
  scopeLevelNames   : List Name  -- All `universe` declarations in the current scope
  allUserLevelNames : List Name  -- `scopeLevelNames` ++ explicit universe parameters provided in the `structure` command
  isClass           : Bool
  declName          : Name
  scopeVars         : Array Expr -- All `variable` declaration in the current scope
  params            : Array Expr -- Explicit parameters provided in the `structure` command
  parents           : Array Syntax
  type              : Syntax
  ctor              : StructCtorView
  fields            : Array StructFieldView
goal: Array Lean.Expr

full_name: Lean.Elab.Command.StructView.ctor
code: structure StructView where
  ref               : Syntax
  modifiers         : Modifiers
  scopeLevelNames   : List Name  -- All `universe` declarations in the current scope
  allUserLevelNames : List Name  -- `scopeLevelNames` ++ explicit universe parameters provided in the `structure` command
  isClass           : Bool
  declName          : Name
  scopeVars         : Array Expr -- All `variable` declaration in the current scope
  params            : Array Expr -- Explicit parameters provided in the `structure` command
  parents           : Array Syntax
  type              : Syntax
  ctor              : StructCtorView
  fields            : Array StructFieldView
goal: Lean.Elab.Command.StructCtorView

full_name: Lean.Elab.Command.StructView.ref
code: structure StructView where
  ref               : Syntax
  modifiers         : Modifiers
  scopeLevelNames   : List Name  -- All `universe` declarations in the current scope
  allUserLevelNames : List Name  -- `scopeLevelNames` ++ explicit universe parameters provided in the `structure` command
  isClass           : Bool
  declName          : Name
  scopeVars         : Array Expr -- All `variable` declaration in the current scope
  params            : Array Expr -- Explicit parameters provided in the `structure` command
  parents           : Array Syntax
  type              : Syntax
  ctor              : StructCtorView
  fields            : Array StructFieldView
goal: Lean.Syntax

full_name: Lean.Elab.Command.StructView.scopeLevelNames
code: structure StructView where
  ref               : Syntax
  modifiers         : Modifiers
  scopeLevelNames   : List Name  -- All `universe` declarations in the current scope
  allUserLevelNames : List Name  -- `scopeLevelNames` ++ explicit universe parameters provided in the `structure` command
  isClass           : Bool
  declName          : Name
  scopeVars         : Array Expr -- All `variable` declaration in the current scope
  params            : Array Expr -- Explicit parameters provided in the `structure` command
  parents           : Array Syntax
  type              : Syntax
  ctor              : StructCtorView
  fields            : Array StructFieldView
goal: List Lean.Name

full_name: Lean.Elab.Command.StructView.isClass
code: structure StructView where
  ref               : Syntax
  modifiers         : Modifiers
  scopeLevelNames   : List Name  -- All `universe` declarations in the current scope
  allUserLevelNames : List Name  -- `scopeLevelNames` ++ explicit universe parameters provided in the `structure` command
  isClass           : Bool
  declName          : Name
  scopeVars         : Array Expr -- All `variable` declaration in the current scope
  params            : Array Expr -- Explicit parameters provided in the `structure` command
  parents           : Array Syntax
  type              : Syntax
  ctor              : StructCtorView
  fields            : Array StructFieldView
goal: Bool

full_name: Lean.Elab.Command.StructView.modifiers
code: structure StructView where
  ref               : Syntax
  modifiers         : Modifiers
  scopeLevelNames   : List Name  -- All `universe` declarations in the current scope
  allUserLevelNames : List Name  -- `scopeLevelNames` ++ explicit universe parameters provided in the `structure` command
  isClass           : Bool
  declName          : Name
  scopeVars         : Array Expr -- All `variable` declaration in the current scope
  params            : Array Expr -- Explicit parameters provided in the `structure` command
  parents           : Array Syntax
  type              : Syntax
  ctor              : StructCtorView
  fields            : Array StructFieldView
goal: Lean.Elab.Modifiers

full_name: Lean.Elab.Command.StructView.scopeVars
code: structure StructView where
  ref               : Syntax
  modifiers         : Modifiers
  scopeLevelNames   : List Name  -- All `universe` declarations in the current scope
  allUserLevelNames : List Name  -- `scopeLevelNames` ++ explicit universe parameters provided in the `structure` command
  isClass           : Bool
  declName          : Name
  scopeVars         : Array Expr -- All `variable` declaration in the current scope
  params            : Array Expr -- Explicit parameters provided in the `structure` command
  parents           : Array Syntax
  type              : Syntax
  ctor              : StructCtorView
  fields            : Array StructFieldView
goal: Array Lean.Expr

full_name: Lean.Elab.Command.StructView.allUserLevelNames
code: structure StructView where
  ref               : Syntax
  modifiers         : Modifiers
  scopeLevelNames   : List Name  -- All `universe` declarations in the current scope
  allUserLevelNames : List Name  -- `scopeLevelNames` ++ explicit universe parameters provided in the `structure` command
  isClass           : Bool
  declName          : Name
  scopeVars         : Array Expr -- All `variable` declaration in the current scope
  params            : Array Expr -- Explicit parameters provided in the `structure` command
  parents           : Array Syntax
  type              : Syntax
  ctor              : StructCtorView
  fields            : Array StructFieldView
goal: List Lean.Name

full_name: Lean.Elab.Command.StructView.type
code: structure StructView where
  ref               : Syntax
  modifiers         : Modifiers
  scopeLevelNames   : List Name  -- All `universe` declarations in the current scope
  allUserLevelNames : List Name  -- `scopeLevelNames` ++ explicit universe parameters provided in the `structure` command
  isClass           : Bool
  declName          : Name
  scopeVars         : Array Expr -- All `variable` declaration in the current scope
  params            : Array Expr -- Explicit parameters provided in the `structure` command
  parents           : Array Syntax
  type              : Syntax
  ctor              : StructCtorView
  fields            : Array StructFieldView
goal: Lean.Syntax

full_name: Lean.Elab.Command.StructView.declName
code: structure StructView where
  ref               : Syntax
  modifiers         : Modifiers
  scopeLevelNames   : List Name  -- All `universe` declarations in the current scope
  allUserLevelNames : List Name  -- `scopeLevelNames` ++ explicit universe parameters provided in the `structure` command
  isClass           : Bool
  declName          : Name
  scopeVars         : Array Expr -- All `variable` declaration in the current scope
  params            : Array Expr -- Explicit parameters provided in the `structure` command
  parents           : Array Syntax
  type              : Syntax
  ctor              : StructCtorView
  fields            : Array StructFieldView
goal: Lean.Name

full_name: Lean.Elab.Command.StructView
code: structure StructView where
  ref               : Syntax
  modifiers         : Modifiers
  scopeLevelNames   : List Name  -- All `universe` declarations in the current scope
  allUserLevelNames : List Name  -- `scopeLevelNames` ++ explicit universe parameters provided in the `structure` command
  isClass           : Bool
  declName          : Name
  scopeVars         : Array Expr -- All `variable` declaration in the current scope
  params            : Array Expr -- Explicit parameters provided in the `structure` command
  parents           : Array Syntax
  type              : Syntax
  ctor              : StructCtorView
  fields            : Array StructFieldView
goal: Type

full_name: Lean.Elab.Command.StructFieldKind.newField
code: inductive StructFieldKind where
  | newField | copiedField | fromParent | subobject
  deriving Inhabited, DecidableEq, Repr
goal: Lean.Elab.Command.StructFieldKind

full_name: Lean.Elab.Command.StructFieldKind
code: inductive StructFieldKind where
  | newField | copiedField | fromParent | subobject
  deriving Inhabited, DecidableEq, Repr
goal: Type

full_name: Lean.Elab.Command.StructFieldKind.fromParent
code: inductive StructFieldKind where
  | newField | copiedField | fromParent | subobject
  deriving Inhabited, DecidableEq, Repr
goal: Lean.Elab.Command.StructFieldKind

full_name: Lean.Elab.Command.instReprStructFieldKind
code: inductive StructFieldKind where
  | newField | copiedField | fromParent | subobject
  deriving Inhabited, DecidableEq, Repr
goal: Repr Lean.Elab.Command.StructFieldKind

full_name: Lean.Elab.Command.instDecidableEqStructFieldKind
code: inductive StructFieldKind where
  | newField | copiedField | fromParent | subobject
  deriving Inhabited, DecidableEq, Repr
goal: DecidableEq Lean.Elab.Command.StructFieldKind

full_name: Lean.Elab.Command.StructFieldKind.subobject
code: inductive StructFieldKind where
  | newField | copiedField | fromParent | subobject
  deriving Inhabited, DecidableEq, Repr
goal: Lean.Elab.Command.StructFieldKind

full_name: Lean.Elab.Command.instInhabitedStructFieldKind
code: inductive StructFieldKind where
  | newField | copiedField | fromParent | subobject
  deriving Inhabited, DecidableEq, Repr
goal: Inhabited Lean.Elab.Command.StructFieldKind

full_name: Lean.Elab.Command.StructFieldKind.copiedField
code: inductive StructFieldKind where
  | newField | copiedField | fromParent | subobject
  deriving Inhabited, DecidableEq, Repr
goal: Lean.Elab.Command.StructFieldKind

full_name: Lean.Elab.Command.StructFieldInfo.fvar
code: structure StructFieldInfo where
  name     : Name
  declName : Name -- Remark: for `fromParent` fields, `declName` is only relevant in the generation of auxiliary "default value" functions.
  fvar     : Expr
  kind     : StructFieldKind
  value?   : Option Expr := none
  deriving Inhabited, Repr
goal: Lean.Expr

full_name: Lean.Elab.Command.instInhabitedStructFieldInfo
code: structure StructFieldInfo where
  name     : Name
  declName : Name -- Remark: for `fromParent` fields, `declName` is only relevant in the generation of auxiliary "default value" functions.
  fvar     : Expr
  kind     : StructFieldKind
  value?   : Option Expr := none
  deriving Inhabited, Repr
goal: Inhabited Lean.Elab.Command.StructFieldInfo

full_name: Lean.Elab.Command.StructFieldInfo
code: structure StructFieldInfo where
  name     : Name
  declName : Name -- Remark: for `fromParent` fields, `declName` is only relevant in the generation of auxiliary "default value" functions.
  fvar     : Expr
  kind     : StructFieldKind
  value?   : Option Expr := none
  deriving Inhabited, Repr
goal: Type

full_name: Lean.Elab.Command.StructFieldInfo.name
code: structure StructFieldInfo where
  name     : Name
  declName : Name -- Remark: for `fromParent` fields, `declName` is only relevant in the generation of auxiliary "default value" functions.
  fvar     : Expr
  kind     : StructFieldKind
  value?   : Option Expr := none
  deriving Inhabited, Repr
goal: Lean.Name

full_name: Lean.Elab.Command.instReprStructFieldInfo
code: structure StructFieldInfo where
  name     : Name
  declName : Name -- Remark: for `fromParent` fields, `declName` is only relevant in the generation of auxiliary "default value" functions.
  fvar     : Expr
  kind     : StructFieldKind
  value?   : Option Expr := none
  deriving Inhabited, Repr
goal: Repr Lean.Elab.Command.StructFieldInfo

full_name: Lean.Elab.Command.StructFieldInfo.declName
code: structure StructFieldInfo where
  name     : Name
  declName : Name -- Remark: for `fromParent` fields, `declName` is only relevant in the generation of auxiliary "default value" functions.
  fvar     : Expr
  kind     : StructFieldKind
  value?   : Option Expr := none
  deriving Inhabited, Repr
goal: Lean.Name

full_name: Lean.Elab.Command.StructFieldInfo.kind
code: structure StructFieldInfo where
  name     : Name
  declName : Name -- Remark: for `fromParent` fields, `declName` is only relevant in the generation of auxiliary "default value" functions.
  fvar     : Expr
  kind     : StructFieldKind
  value?   : Option Expr := none
  deriving Inhabited, Repr
goal: Lean.Elab.Command.StructFieldKind

full_name: Lean.Elab.Command.StructFieldInfo.value?
code: structure StructFieldInfo where
  name     : Name
  declName : Name -- Remark: for `fromParent` fields, `declName` is only relevant in the generation of auxiliary "default value" functions.
  fvar     : Expr
  kind     : StructFieldKind
  value?   : Option Expr := none
  deriving Inhabited, Repr
goal: Option Lean.Expr

full_name: Lean.Elab.Command.StructFieldInfo.isFromParent
code: def StructFieldInfo.isFromParent (info : StructFieldInfo) : Bool 
goal: Bool

full_name: Lean.Elab.Command.StructFieldInfo.isSubobject
code: def StructFieldInfo.isSubobject (info : StructFieldInfo) : Bool 
goal: Bool

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Structure.0.Lean.Elab.Command.defaultCtorName
code: private def defaultCtorName 
goal: Lean.Name

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Structure.0.Lean.Elab.Command.expandCtor
code: private def expandCtor (structStx : Syntax) (structModifiers : Modifiers) (structDeclName : Name) : TermElabM StructCtorView 
goal: Lean.Elab.TermElabM Lean.Elab.Command.StructCtorView

full_name: Lean.Elab.Command.checkValidFieldModifier
code: def checkValidFieldModifier (modifiers : Modifiers) : TermElabM Unit 
goal: Lean.Elab.TermElabM Unit

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Structure.0.Lean.Elab.Command.expandFields
code: private def expandFields (structStx : Syntax) (structModifiers : Modifiers) (structDeclName : Name) : TermElabM (Array StructFieldView) 
goal: Lean.Elab.TermElabM (Array Lean.Elab.Command.StructFieldView)

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Structure.0.Lean.Elab.Command.validStructType
code: private def validStructType (type : Expr) : Bool 
goal: Bool

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Structure.0.Lean.Elab.Command.findFieldInfo?
code: private def findFieldInfo? (infos : Array StructFieldInfo) (fieldName : Name) : Option StructFieldInfo 
goal: Option Lean.Elab.Command.StructFieldInfo

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Structure.0.Lean.Elab.Command.containsFieldName
code: private def containsFieldName (infos : Array StructFieldInfo) (fieldName : Name) : Bool 
goal: Bool

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Structure.0.Lean.Elab.Command.updateFieldInfoVal
code: private def updateFieldInfoVal (infos : Array StructFieldInfo) (fieldName : Name) (value : Expr) : Array StructFieldInfo 
goal: Array Lean.Elab.Command.StructFieldInfo

full_name: Lean.Elab.Command.initFn._@..lake.packages.lean4.src.lean.Lean.Elab.Structure._hyg.3491
code: register_builtin_option structureDiamondWarning : Bool := {
  defValue := false
  descr    := "enable/disable warning messages for structure diamonds"
}
goal: IO (Lean.Option Bool)

full_name: Lean.Elab.Command.structureDiamondWarning
code: register_builtin_option structureDiamondWarning : Bool := {
  defValue := false
  descr    := "enable/disable warning messages for structure diamonds"
}
goal: Lean.Option Bool

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Structure.0.Lean.Elab.Command.findExistingField?
code: /-- Return `some fieldName` if field `fieldName` of the parent structure `parentStructName` is already in `infos` -/
private def findExistingField? (infos : Array StructFieldInfo) (parentStructName : Name) : CoreM (Option Name) 
goal: Lean.CoreM (Option Lean.Name)

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Structure.0.Lean.Elab.Command.processSubfields.go
code: private partial def processSubfields (structDeclName : Name) (parentFVar : Expr) (parentStructName : Name) (subfieldNames : Array Name)
    (infos : Array StructFieldInfo) (k : Array StructFieldInfo → TermElabM α) : TermElabM α 
goal: Lean.Elab.TermElabM α

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Structure.0.Lean.Elab.Command.processSubfields
code: private partial def processSubfields (structDeclName : Name) (parentFVar : Expr) (parentStructName : Name) (subfieldNames : Array Name)
    (infos : Array StructFieldInfo) (k : Array StructFieldInfo → TermElabM α) : TermElabM α 
goal: Lean.Elab.TermElabM α

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Structure.0.Lean.Elab.Command.getNestedProjectionArg
code: /-- Given `obj.foo.bar.baz`, return `obj`. -/
private partial def getNestedProjectionArg (e : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Structure.0.Lean.Elab.Command.getFieldType
code: /--
  Get field type of `fieldName` in `parentType`, but replace references
  to other fields of that structure by existing field fvars.
  Auxiliary method for `copyNewFieldsFrom`.

-/
private def getFieldType (infos : Array StructFieldInfo) (parentType : Expr) (fieldName : Name) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Structure.0.Lean.Elab.Command.toVisibility
code: private def toVisibility (fieldInfo : StructureFieldInfo) : CoreM Visibility 
goal: Lean.CoreM Lean.Elab.Visibility

full_name: Lean.Elab.Command.FieldMap
code: abbrev FieldMap 
goal: Type

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Structure.0.Lean.Elab.Command.reduceProjs
code: /-- Reduce projections of the structures in `structNames` -/
private def reduceProjs (e : Expr) (structNames : NameSet) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Structure.0.Lean.Elab.Command.copyDefaultValue?.failed
code: /--
  Copy the default value for field `fieldName` set at structure `structName`.
  The arguments for the `_default` auxiliary function are provided by `fieldMap`.
  Recall some of the entries in `fieldMap` are constructor applications, and they needed
  to be reduced using `reduceProjs`. Otherwise, the produced default value may be "cyclic".
  That is, we reduce projections of the structures in `expandedStructNames`. Here is
  an example that shows why the reduction is needed.
  ```
  structure A where
    a : Nat

  structure B where
    a : Nat
    b : Nat
    c : Nat

  structure C extends B where
    d : Nat
    c := b + d

  structure D extends A, C

  #print D.c._default
  ```
  Without the reduction, it produces
  ```
  def D.c._default : A → Nat → Nat → Nat → Nat :=
  fun toA b c d => id ({ a := toA.a, b := b, c := c : B }.b + d)
  ```
-/
private partial def copyDefaultValue? (fieldMap : FieldMap) (expandedStructNames : NameSet) (structName : Name) (fieldName : Name) : TermElabM (Option Expr) 
goal: Lean.Elab.TermElabM (Option Lean.Expr)

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Structure.0.Lean.Elab.Command.copyDefaultValue?.go?
code: /--
  Copy the default value for field `fieldName` set at structure `structName`.
  The arguments for the `_default` auxiliary function are provided by `fieldMap`.
  Recall some of the entries in `fieldMap` are constructor applications, and they needed
  to be reduced using `reduceProjs`. Otherwise, the produced default value may be "cyclic".
  That is, we reduce projections of the structures in `expandedStructNames`. Here is
  an example that shows why the reduction is needed.
  ```
  structure A where
    a : Nat

  structure B where
    a : Nat
    b : Nat
    c : Nat

  structure C extends B where
    d : Nat
    c := b + d

  structure D extends A, C

  #print D.c._default
  ```
  Without the reduction, it produces
  ```
  def D.c._default : A → Nat → Nat → Nat → Nat :=
  fun toA b c d => id ({ a := toA.a, b := b, c := c : B }.b + d)
  ```
-/
private partial def copyDefaultValue? (fieldMap : FieldMap) (expandedStructNames : NameSet) (structName : Name) (fieldName : Name) : TermElabM (Option Expr) 
goal: Lean.Elab.TermElabM (Option Lean.Expr)

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Structure.0.Lean.Elab.Command.copyDefaultValue?
code: /--
  Copy the default value for field `fieldName` set at structure `structName`.
  The arguments for the `_default` auxiliary function are provided by `fieldMap`.
  Recall some of the entries in `fieldMap` are constructor applications, and they needed
  to be reduced using `reduceProjs`. Otherwise, the produced default value may be "cyclic".
  That is, we reduce projections of the structures in `expandedStructNames`. Here is
  an example that shows why the reduction is needed.
  ```
  structure A where
    a : Nat

  structure B where
    a : Nat
    b : Nat
    c : Nat

  structure C extends B where
    d : Nat
    c := b + d

  structure D extends A, C

  #print D.c._default
  ```
  Without the reduction, it produces
  ```
  def D.c._default : A → Nat → Nat → Nat → Nat :=
  fun toA b c d => id ({ a := toA.a, b := b, c := c : B }.b + d)
  ```
-/
private partial def copyDefaultValue? (fieldMap : FieldMap) (expandedStructNames : NameSet) (structName : Name) (fieldName : Name) : TermElabM (Option Expr) 
goal: Lean.Elab.TermElabM (Option Lean.Expr)

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Structure.0.Lean.Elab.Command.copyNewFieldsFrom.processOveriddenDefaultValues
code: private partial def copyNewFieldsFrom (structDeclName : Name) (infos : Array StructFieldInfo) (parentType : Expr) (k : Array StructFieldInfo → TermElabM α) : TermElabM α 
goal: Lean.Elab.TermElabM (Array Lean.Elab.Command.StructFieldInfo)

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Structure.0.Lean.Elab.Command.copyNewFieldsFrom.mkCompositeField
code: private partial def copyNewFieldsFrom (structDeclName : Name) (infos : Array StructFieldInfo) (parentType : Expr) (k : Array StructFieldInfo → TermElabM α) : TermElabM α 
goal: Lean.Elab.TermElabM Lean.Expr

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Structure.0.Lean.Elab.Command.copyNewFieldsFrom.copyFields.copy
code: private partial def copyNewFieldsFrom (structDeclName : Name) (infos : Array StructFieldInfo) (parentType : Expr) (k : Array StructFieldInfo → TermElabM α) : TermElabM α 
goal: Lean.Elab.TermElabM α

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Structure.0.Lean.Elab.Command.copyNewFieldsFrom
code: private partial def copyNewFieldsFrom (structDeclName : Name) (infos : Array StructFieldInfo) (parentType : Expr) (k : Array StructFieldInfo → TermElabM α) : TermElabM α 
goal: Lean.Elab.TermElabM α

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Structure.0.Lean.Elab.Command.copyNewFieldsFrom.copyFields
code: private partial def copyNewFieldsFrom (structDeclName : Name) (infos : Array StructFieldInfo) (parentType : Expr) (k : Array StructFieldInfo → TermElabM α) : TermElabM α 
goal: Lean.Elab.TermElabM α

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Structure.0.Lean.Elab.Command.mkToParentName.go
code: private partial def mkToParentName (parentStructName : Name) (p : Name → Bool) : Name 
goal: Lean.Name

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Structure.0.Lean.Elab.Command.mkToParentName
code: private partial def mkToParentName (parentStructName : Name) (p : Name → Bool) : Name 
goal: Lean.Name

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Structure.0.Lean.Elab.Command.withParents.go
code: private partial def withParents (view : StructView) (k : Array StructFieldInfo → Array Expr → TermElabM α) : TermElabM α 
goal: Lean.Elab.TermElabM α

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Structure.0.Lean.Elab.Command.withParents
code: private partial def withParents (view : StructView) (k : Array StructFieldInfo → Array Expr → TermElabM α) : TermElabM α 
goal: Lean.Elab.TermElabM α

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Structure.0.Lean.Elab.Command.elabFieldTypeValue
code: private def elabFieldTypeValue (view : StructFieldView) : TermElabM (Option Expr × Option Expr) 
goal: Lean.Elab.TermElabM (Option Lean.Expr × Option Lean.Expr)

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Structure.0.Lean.Elab.Command.withFields
code: private partial def withFields (views : Array StructFieldView) (infos : Array StructFieldInfo) (k : Array StructFieldInfo → TermElabM α) : TermElabM α 
goal: Lean.Elab.TermElabM α

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Structure.0.Lean.Elab.Command.withFields.go
code: private partial def withFields (views : Array StructFieldView) (infos : Array StructFieldInfo) (k : Array StructFieldInfo → TermElabM α) : TermElabM α 
goal: Lean.Elab.TermElabM α

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Structure.0.Lean.Elab.Command.getResultUniverse
code: private def getResultUniverse (type : Expr) : TermElabM Level 
goal: Lean.Elab.TermElabM Lean.Level

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Structure.0.Lean.Elab.Command.collectUsed
code: private def collectUsed (params : Array Expr) (fieldInfos : Array StructFieldInfo) : StateRefT CollectFVars.State MetaM Unit 
goal: StateRefT' IO.RealWorld Lean.CollectFVars.State Lean.MetaM Unit

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Structure.0.Lean.Elab.Command.removeUnused
code: private def removeUnused (scopeVars : Array Expr) (params : Array Expr) (fieldInfos : Array StructFieldInfo)
    : TermElabM (LocalContext × LocalInstances × Array Expr) 
goal: Lean.Elab.TermElabM (Lean.LocalContext × Lean.LocalInstances × Array Lean.Expr)

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Structure.0.Lean.Elab.Command.withUsed
code: private def withUsed {α} (scopeVars : Array Expr) (params : Array Expr) (fieldInfos : Array StructFieldInfo) (k : Array Expr → TermElabM α)
    : TermElabM α 
goal: Lean.Elab.TermElabM α

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Structure.0.Lean.Elab.Command.levelMVarToParam.levelMVarToParam'
code: private def levelMVarToParam (scopeVars : Array Expr) (params : Array Expr) (fieldInfos : Array StructFieldInfo) (univToInfer? : Option LMVarId) : TermElabM (Array StructFieldInfo) 
goal: Lean.Elab.TermElabM Lean.Expr

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Structure.0.Lean.Elab.Command.levelMVarToParam.levelMVarToParamFVars
code: private def levelMVarToParam (scopeVars : Array Expr) (params : Array Expr) (fieldInfos : Array StructFieldInfo) (univToInfer? : Option LMVarId) : TermElabM (Array StructFieldInfo) 
goal: Lean.Elab.TermElabM Unit

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Structure.0.Lean.Elab.Command.levelMVarToParam.levelMVarToParamFVar
code: private def levelMVarToParam (scopeVars : Array Expr) (params : Array Expr) (fieldInfos : Array StructFieldInfo) (univToInfer? : Option LMVarId) : TermElabM (Array StructFieldInfo) 
goal: Lean.Elab.TermElabM Unit

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Structure.0.Lean.Elab.Command.levelMVarToParam
code: private def levelMVarToParam (scopeVars : Array Expr) (params : Array Expr) (fieldInfos : Array StructFieldInfo) (univToInfer? : Option LMVarId) : TermElabM (Array StructFieldInfo) 
goal: Lean.Elab.TermElabM (Array Lean.Elab.Command.StructFieldInfo)

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Structure.0.Lean.Elab.Command.collectUniversesFromFields
code: private partial def collectUniversesFromFields (r : Level) (rOffset : Nat) (fieldInfos : Array StructFieldInfo) : TermElabM (Array Level) 
goal: Lean.Elab.TermElabM (Array Lean.Level)

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Structure.0.Lean.Elab.Command.collectUniversesFromFields.go
code: private partial def collectUniversesFromFields (r : Level) (rOffset : Nat) (fieldInfos : Array StructFieldInfo) : TermElabM (Array Level) 
goal: StateRefT' IO.RealWorld (Array Lean.Level) Lean.Elab.TermElabM Unit

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Structure.0.Lean.Elab.Command.updateResultingUniverse
code: private def updateResultingUniverse (fieldInfos : Array StructFieldInfo) (type : Expr) : TermElabM Expr 
goal: Lean.Elab.TermElabM Lean.Expr

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Structure.0.Lean.Elab.Command.collectLevelParamsInFVar
code: private def collectLevelParamsInFVar (s : CollectLevelParams.State) (fvar : Expr) : TermElabM CollectLevelParams.State 
goal: Lean.Elab.TermElabM Lean.CollectLevelParams.State

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Structure.0.Lean.Elab.Command.collectLevelParamsInFVars
code: private def collectLevelParamsInFVars (fvars : Array Expr) (s : CollectLevelParams.State) : TermElabM CollectLevelParams.State 
goal: Lean.Elab.TermElabM Lean.CollectLevelParams.State

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Structure.0.Lean.Elab.Command.collectLevelParamsInStructure
code: private def collectLevelParamsInStructure (structType : Expr) (scopeVars : Array Expr) (params : Array Expr) (fieldInfos : Array StructFieldInfo)
    : TermElabM (Array Name) 
goal: Lean.Elab.TermElabM (Array Lean.Name)

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Structure.0.Lean.Elab.Command.addCtorFields
code: private def addCtorFields (fieldInfos : Array StructFieldInfo) : Nat → Expr → TermElabM Expr
  
goal: Nat → Lean.Expr → Lean.Elab.TermElabM Lean.Expr

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Structure.0.Lean.Elab.Command.mkCtor
code: private def mkCtor (view : StructView) (levelParams : List Name) (params : Array Expr) (fieldInfos : Array StructFieldInfo) : TermElabM Constructor 
goal: Lean.Elab.TermElabM Lean.Constructor

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Structure.0.Lean.Elab.Command.mkProjections
code: @[extern "lean_mk_projections"]
private opaque mkProjections (env : Environment) (structName : Name) (projs : List Name) (isClass : Bool) : Except KernelException Environment
goal: Except Lean.KernelException Lean.Environment

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Structure.0.Lean.Elab.Command.addProjections
code: private def addProjections (structName : Name) (projs : List Name) (isClass : Bool) : TermElabM Unit 
goal: Lean.Elab.TermElabM Unit

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Structure.0.Lean.Elab.Command.registerStructure
code: private def registerStructure (structName : Name) (infos : Array StructFieldInfo) : TermElabM Unit 
goal: Lean.Elab.TermElabM Unit

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Structure.0.Lean.Elab.Command.mkAuxConstructions
code: private def mkAuxConstructions (declName : Name) : TermElabM Unit 
goal: Lean.Elab.TermElabM Unit

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Structure.0.Lean.Elab.Command.addDefaults
code: private def addDefaults (lctx : LocalContext) (defaultAuxDecls : Array (Name × Expr × Expr)) : TermElabM Unit 
goal: Lean.Elab.TermElabM Unit

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Structure.0.Lean.Elab.Command.setSourceInstImplicit
code: /--
Given `type` of the form `forall ... (source : A), B`, return `forall ... [source : A], B`.
-/
private def setSourceInstImplicit (type : Expr) : Expr 
goal: Lean.Expr

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Structure.0.Lean.Elab.Command.mkCoercionToCopiedParent
code: private partial def mkCoercionToCopiedParent (levelParams : List Name) (params : Array Expr) (view : StructView) (parentType : Expr) : MetaM Unit 
goal: Lean.MetaM Unit

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Structure.0.Lean.Elab.Command.mkCoercionToCopiedParent.copyFields
code: private partial def mkCoercionToCopiedParent (levelParams : List Name) (params : Array Expr) (view : StructView) (parentType : Expr) : MetaM Unit 
goal: Lean.MetaM Lean.Expr

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Structure.0.Lean.Elab.Command.elabStructureView
code: private def elabStructureView (view : StructView) : TermElabM Unit 
goal: Lean.Elab.TermElabM Unit

full_name: Lean.Elab.Command.elabStructure
code: def elabStructure (modifiers : Modifiers) (stx : Syntax) : CommandElabM Unit 
goal: Lean.Elab.Command.CommandElabM Unit

full_name: Lean.Elab.Command.initFn._@..lake.packages.lean4.src.lean.Lean.Elab.Structure._hyg.13419
code: builtin_initialize registerTraceClass `Elab.structure
goal: IO Unit