Equations
- Lean.instInhabitedProjectionFunctionInfo = { default := { ctorName := default, numParams := default, i := default, fromClass := default } }
Equations
- Lean.mkProjectionInfoEx ctorName numParams i fromClass = { ctorName := ctorName, numParams := numParams, i := i, fromClass := fromClass }
Equations
- Lean.ProjectionFunctionInfo.fromClassEx info = info.fromClass
def
Lean.addProjectionFnInfo
(env : Lean.Environment)
(projName : Lean.Name)
(ctorName : Lean.Name)
(numParams : Nat)
(i : Nat)
(fromClass : Bool)
:
Equations
- Lean.addProjectionFnInfo env projName ctorName numParams i fromClass = Lean.MapDeclarationExtension.insert Lean.projectionFnInfoExt env projName { ctorName := ctorName, numParams := numParams, i := i, fromClass := fromClass }
Equations
- Lean.Environment.getProjectionFnInfo? env projName = Lean.MapDeclarationExtension.find? Lean.projectionFnInfoExt env projName
Equations
- Lean.Environment.isProjectionFn env declName = Lean.MapDeclarationExtension.contains Lean.projectionFnInfoExt env declName
Equations
- Lean.Environment.getProjectionStructureName? env projName = match Lean.Environment.getProjectionFnInfo? env projName with | none => none | some projInfo => match Lean.Environment.find? env projInfo.ctorName with | some (Lean.ConstantInfo.ctorInfo val) => some val.induct | x => none
def
Lean.isProjectionFn
{m : Type → Type}
[inst : Lean.MonadEnv m]
[inst : Monad m]
(declName : Lean.Name)
:
m Bool
Equations
- Lean.isProjectionFn declName = do let a ← Lean.getEnv pure (Lean.Environment.isProjectionFn a declName)
def
Lean.getProjectionFnInfo?
{m : Type → Type}
[inst : Lean.MonadEnv m]
[inst : Monad m]
(declName : Lean.Name)
:
Equations
- Lean.getProjectionFnInfo? declName = do let a ← Lean.getEnv pure (Lean.Environment.getProjectionFnInfo? a declName)