diff --git a/DocGen4/Output.lean b/DocGen4/Output.lean index a698145..9d79088 100644 --- a/DocGen4/Output.lean +++ b/DocGen4/Output.lean @@ -13,6 +13,7 @@ import DocGen4.Output.NotFound import DocGen4.Output.Find import DocGen4.Output.SourceLinker import DocGen4.Output.ToJson +import DocGen4.Output.FoundationalTypes import DocGen4.LeanInk.Process import Lean.Data.HashMap @@ -32,6 +33,7 @@ def htmlOutputSetup (config : SiteBaseContext) : IO Unit := do -- All the doc-gen static stuff let indexHtml := ReaderT.run index config |>.toString let notFoundHtml := ReaderT.run notFound config |>.toString + let foundationalTypesHtml := ReaderT.run foundationalTypes config |>.toString let navbarHtml := ReaderT.run navbar config |>.toString let docGenStatic := #[ ("style.css", styleCss), @@ -43,6 +45,7 @@ def htmlOutputSetup (config : SiteBaseContext) : IO Unit := do ("instances.js", instancesJs), ("importedBy.js", importedByJs), ("index.html", indexHtml), + ("foundational_types.html", foundationalTypesHtml), ("404.html", notFoundHtml), ("navbar.html", navbarHtml) ] diff --git a/DocGen4/Output/FoundationalTypes.lean b/DocGen4/Output/FoundationalTypes.lean new file mode 100644 index 0000000..6112832 --- /dev/null +++ b/DocGen4/Output/FoundationalTypes.lean @@ -0,0 +1,50 @@ +import DocGen4.Output.Template +import DocGen4.Output.Inductive + +namespace DocGen4.Output + +open scoped DocGen4.Jsx + +def foundationalTypes : BaseHtmlM Html := templateLiftExtends (baseHtml "Foundational Type") do + pure <| +
Some of Lean's types are not defined in any Lean source files (even the prelude
) since they come from its foundational type theory. This page provides basic documentation for these types.
For a more in-depth explanation of Lean's type theory, refer to + TPiL.
+ + +Sort u
Sort u
is the type of types in Lean, and Sort u : Sort (u + 1)
.
Type u
Type u
is notation for Sort (u + 1)
.
Prop
Prop
is notation for Sort 0
.
{"Π a : α, β a"}
The type of dependent functions is known as a pi type. + Non-dependent functions and implications are a special case.
+Note that these can also be written with the alternative notations:
+∀ a : α, β a
, conventionally used where β a : Prop
.α → γ
, possible only if β a = γ
for all a
.Lean also permits ASCII-only spellings of the three variants:
+Pi a : A, B a
for {"Π a : α, β a"}
forall a : A, B a
for {"∀ a : α, β a"}
A -> B
, for α → β
Note that despite not itself being a function, (→)
is available as infix notation for
+ {"λ α β, α → β"}
.