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

full_name: Lean.StructureFieldInfo.subobject?
code: structure StructureFieldInfo where
  fieldName  : Name
  projFn     : Name
  /-- It is `some parentStructName` if it is a subobject, and `parentStructName` is the name of the parent structure -/
  subobject? : Option Name
  binderInfo : BinderInfo
  autoParam? : Option Expr := none
  deriving Inhabited, Repr
goal: Option Lean.Name

full_name: Lean.StructureFieldInfo
code: structure StructureFieldInfo where
  fieldName  : Name
  projFn     : Name
  /-- It is `some parentStructName` if it is a subobject, and `parentStructName` is the name of the parent structure -/
  subobject? : Option Name
  binderInfo : BinderInfo
  autoParam? : Option Expr := none
  deriving Inhabited, Repr
goal: Type

full_name: Lean.StructureFieldInfo.binderInfo
code: structure StructureFieldInfo where
  fieldName  : Name
  projFn     : Name
  /-- It is `some parentStructName` if it is a subobject, and `parentStructName` is the name of the parent structure -/
  subobject? : Option Name
  binderInfo : BinderInfo
  autoParam? : Option Expr := none
  deriving Inhabited, Repr
goal: Lean.BinderInfo

full_name: Lean.StructureFieldInfo.projFn
code: structure StructureFieldInfo where
  fieldName  : Name
  projFn     : Name
  /-- It is `some parentStructName` if it is a subobject, and `parentStructName` is the name of the parent structure -/
  subobject? : Option Name
  binderInfo : BinderInfo
  autoParam? : Option Expr := none
  deriving Inhabited, Repr
goal: Lean.Name

full_name: Lean.StructureFieldInfo.autoParam?
code: structure StructureFieldInfo where
  fieldName  : Name
  projFn     : Name
  /-- It is `some parentStructName` if it is a subobject, and `parentStructName` is the name of the parent structure -/
  subobject? : Option Name
  binderInfo : BinderInfo
  autoParam? : Option Expr := none
  deriving Inhabited, Repr
goal: Option Lean.Expr

full_name: Lean.instReprStructureFieldInfo
code: structure StructureFieldInfo where
  fieldName  : Name
  projFn     : Name
  /-- It is `some parentStructName` if it is a subobject, and `parentStructName` is the name of the parent structure -/
  subobject? : Option Name
  binderInfo : BinderInfo
  autoParam? : Option Expr := none
  deriving Inhabited, Repr
goal: Repr Lean.StructureFieldInfo

full_name: Lean.instInhabitedStructureFieldInfo
code: structure StructureFieldInfo where
  fieldName  : Name
  projFn     : Name
  /-- It is `some parentStructName` if it is a subobject, and `parentStructName` is the name of the parent structure -/
  subobject? : Option Name
  binderInfo : BinderInfo
  autoParam? : Option Expr := none
  deriving Inhabited, Repr
goal: Inhabited Lean.StructureFieldInfo

full_name: Lean.StructureFieldInfo.fieldName
code: structure StructureFieldInfo where
  fieldName  : Name
  projFn     : Name
  /-- It is `some parentStructName` if it is a subobject, and `parentStructName` is the name of the parent structure -/
  subobject? : Option Name
  binderInfo : BinderInfo
  autoParam? : Option Expr := none
  deriving Inhabited, Repr
goal: Lean.Name

full_name: Lean.StructureFieldInfo.lt
code: def StructureFieldInfo.lt (i₁ i₂ : StructureFieldInfo) : Bool 
goal: Bool

full_name: Lean.instInhabitedStructureInfo
code: structure StructureInfo where
  structName : Name
  fieldNames : Array Name := #[] -- sorted by field position in the structure
  fieldInfo  : Array StructureFieldInfo := #[] -- sorted by `fieldName`
  deriving Inhabited
goal: Inhabited Lean.StructureInfo

full_name: Lean.StructureInfo
code: structure StructureInfo where
  structName : Name
  fieldNames : Array Name := #[] -- sorted by field position in the structure
  fieldInfo  : Array StructureFieldInfo := #[] -- sorted by `fieldName`
  deriving Inhabited
goal: Type

full_name: Lean.StructureInfo.structName
code: structure StructureInfo where
  structName : Name
  fieldNames : Array Name := #[] -- sorted by field position in the structure
  fieldInfo  : Array StructureFieldInfo := #[] -- sorted by `fieldName`
  deriving Inhabited
goal: Lean.Name

full_name: Lean.StructureInfo.fieldInfo
code: structure StructureInfo where
  structName : Name
  fieldNames : Array Name := #[] -- sorted by field position in the structure
  fieldInfo  : Array StructureFieldInfo := #[] -- sorted by `fieldName`
  deriving Inhabited
goal: Array Lean.StructureFieldInfo

full_name: Lean.StructureInfo.fieldNames
code: structure StructureInfo where
  structName : Name
  fieldNames : Array Name := #[] -- sorted by field position in the structure
  fieldInfo  : Array StructureFieldInfo := #[] -- sorted by `fieldName`
  deriving Inhabited
goal: Array Lean.Name

full_name: Lean.StructureInfo.lt
code: def StructureInfo.lt (i₁ i₂ : StructureInfo) : Bool 
goal: Bool

full_name: Lean.StructureInfo.getProjFn?
code: def StructureInfo.getProjFn? (info : StructureInfo) (i : Nat) : Option Name 
goal: Option Lean.Name

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Structure.0.Lean.StructureState.map
code: /-- Auxiliary state for structures defined in the current module. -/
private structure StructureState where
  map : PersistentHashMap Name StructureInfo := {}
  deriving Inhabited
goal: Lean.PersistentHashMap Lean.Name Lean.StructureInfo

full_name: Lean.instInhabitedStructureState
code: /-- Auxiliary state for structures defined in the current module. -/
private structure StructureState where
  map : PersistentHashMap Name StructureInfo := {}
  deriving Inhabited
goal: Inhabited Lean.StructureState

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Structure.0.Lean.StructureState
code: /-- Auxiliary state for structures defined in the current module. -/
private structure StructureState where
  map : PersistentHashMap Name StructureInfo := {}
  deriving Inhabited
goal: Type

full_name: Lean.initFn._@..lake.packages.lean4.src.lean.Lean.Structure._hyg.353
code: builtin_initialize structureExt : SimplePersistentEnvExtension StructureInfo StructureState ← registerSimplePersistentEnvExtension {
  addImportedFn := fun _ => {}
  addEntryFn    := fun s e => { s with map := s.map.insert e.structName e }
  toArrayFn     := fun es => es.toArray.qsort StructureInfo.lt
}
goal: IO (Lean.SimplePersistentEnvExtension Lean.StructureInfo Lean.StructureState)

full_name: Lean.structureExt
code: builtin_initialize structureExt : SimplePersistentEnvExtension StructureInfo StructureState ← registerSimplePersistentEnvExtension {
  addImportedFn := fun _ => {}
  addEntryFn    := fun s e => { s with map := s.map.insert e.structName e }
  toArrayFn     := fun es => es.toArray.qsort StructureInfo.lt
}
goal: Lean.SimplePersistentEnvExtension Lean.StructureInfo Lean.StructureState

full_name: Lean.StructureDescr
code: structure StructureDescr where
  structName : Name
  fields     : Array StructureFieldInfo -- Should use the order the field appear in the constructor.
  deriving Inhabited
goal: Type

full_name: Lean.instInhabitedStructureDescr
code: structure StructureDescr where
  structName : Name
  fields     : Array StructureFieldInfo -- Should use the order the field appear in the constructor.
  deriving Inhabited
goal: Inhabited Lean.StructureDescr

full_name: Lean.StructureDescr.fields
code: structure StructureDescr where
  structName : Name
  fields     : Array StructureFieldInfo -- Should use the order the field appear in the constructor.
  deriving Inhabited
goal: Array Lean.StructureFieldInfo

full_name: Lean.StructureDescr.structName
code: structure StructureDescr where
  structName : Name
  fields     : Array StructureFieldInfo -- Should use the order the field appear in the constructor.
  deriving Inhabited
goal: Lean.Name

full_name: Lean.registerStructure
code: def registerStructure (env : Environment) (e : StructureDescr) : Environment 
goal: Lean.Environment

full_name: Lean.getStructureInfo?
code: def getStructureInfo? (env : Environment) (structName : Name) : Option StructureInfo 
goal: Option Lean.StructureInfo

full_name: Lean.getStructureCtor
code: def getStructureCtor (env : Environment) (constName : Name) : ConstructorVal 
goal: Lean.ConstructorVal

full_name: Lean.getStructureFields
code: /-- Get direct field names for the given structure. -/
def getStructureFields (env : Environment) (structName : Name) : Array Name 
goal: Array Lean.Name

full_name: Lean.getFieldInfo?
code: def getFieldInfo? (env : Environment) (structName : Name) (fieldName : Name) : Option StructureFieldInfo 
goal: Option Lean.StructureFieldInfo

full_name: Lean.isSubobjectField?
code: /-- If `fieldName` represents the relation to a parent structure `S`, return `S` -/
def isSubobjectField? (env : Environment) (structName : Name) (fieldName : Name) : Option Name 
goal: Option Lean.Name

full_name: Lean.getParentStructures
code: /-- Return immediate parent structures -/
def getParentStructures (env : Environment) (structName : Name) : Array Name 
goal: Array Lean.Name

full_name: Lean.getAllParentStructures.visit
code: /-- Return all parent structures -/
partial def getAllParentStructures (env : Environment) (structName : Name) : Array Name 
goal: StateT (Array Lean.Name) Id Unit

full_name: Lean.getAllParentStructures
code: /-- Return all parent structures -/
partial def getAllParentStructures (env : Environment) (structName : Name) : Array Name 
goal: Array Lean.Name

full_name: Lean.findField?
code: /-- `findField? env S fname`. If `fname` is defined in a parent `S'` of `S`, return `S'` -/
partial def findField? (env : Environment) (structName : Name) (fieldName : Name) : Option Name 
goal: Option Lean.Name

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Structure.0.Lean.getStructureFieldsFlattenedAux
code: private partial def getStructureFieldsFlattenedAux (env : Environment) (structName : Name) (fullNames : Array Name) (includeSubobjectFields : Bool) : Array Name 
goal: Array Lean.Name

full_name: Lean.getStructureFieldsFlattened
code: /-- Return field names for the given structure, including "flattened" fields from parent
structures. To omit `toParent` projections, set `includeSubobjectFields := false`.

For example, given `Bar` such that
```lean
structure Foo where a : Nat
structure Bar extends Foo where b : Nat
```
return `#[toFoo,a,b]` or `#[a,b]` with subobject fields omitted. -/
def getStructureFieldsFlattened (env : Environment) (structName : Name) (includeSubobjectFields := true) : Array Name 
goal: Array Lean.Name

full_name: Lean.isStructure
code: /--
  Return true if `constName` is the name of an inductive datatype
  created using the `structure` or `class` commands.

  We perform the check by testing whether auxiliary projection functions
  have been created. -/
def isStructure (env : Environment) (constName : Name) : Bool 
goal: Bool

full_name: Lean.getProjFnForField?
code: def getProjFnForField? (env : Environment) (structName : Name) (fieldName : Name) : Option Name 
goal: Option Lean.Name

full_name: Lean.getProjFnInfoForField?
code: def getProjFnInfoForField? (env : Environment) (structName : Name) (fieldName : Name) : Option (Name × ProjectionFunctionInfo) 
goal: Option (Lean.Name × Lean.ProjectionFunctionInfo)

full_name: Lean.mkDefaultFnOfProjFn
code: def mkDefaultFnOfProjFn (projFn : Name) : Name 
goal: Lean.Name

full_name: Lean.getDefaultFnForField?
code: def getDefaultFnForField? (env : Environment) (structName : Name) (fieldName : Name) : Option Name 
goal: Option Lean.Name

full_name: Lean.getPathToBaseStructureAux
code: partial def getPathToBaseStructureAux (env : Environment) (baseStructName : Name) (structName : Name) (path : List Name) : Option (List Name) 
goal: Option (List Lean.Name)

full_name: Lean.getPathToBaseStructure?
code: /--
If `baseStructName` is an ancestor structure for `structName`, then return a sequence of projection functions
to go from `structName` to `baseStructName`.
-/
def getPathToBaseStructure? (env : Environment) (baseStructName : Name) (structName : Name) : Option (List Name) 
goal: Option (List Lean.Name)

full_name: Lean.isStructureLike
code: /-- Return true iff `constName` is the a non-recursive inductive datatype that has only one constructor. -/
def isStructureLike (env : Environment) (constName : Name) : Bool 
goal: Bool

full_name: Lean.getStructureLikeNumFields
code: /-- Return number of fields for a structure-like type -/
def getStructureLikeNumFields (env : Environment) (constName : Name) : Nat 
goal: Nat