book/TPiL/DependentTypeTheory.lean
Explanation legend Lean4 Domain Explanation Language (L4DEL)
L4DEL explanations are a separate layer. They do not change the Lean source. Intuition is explanatory prose; numbered items are a reading path; sources link the wording back to evidence.
- L4DEL
- Lean4 Domain Explanation Language
Credit: The upstream authors and contributors retain credit for the project and mathematics. lean4-explainer only renders their pinned source and adds the separately disclosed explanation layer.
Project sources: Pinned Theorem Proving in Lean documentation, Pinned Theorem Proving in Lean 4 book index
85 declarations, 0 contain sorry, 1 declared as axioms
Imports (2)
VersoManualTPiL.Examples
- def
mline 40 source - def
nline 41 source - def
b1line 42 source - def
b2line 43 source - example
(example at line 148)line 148 source - def
αline 203 source - def
βline 204 source - def
Fline 205 source - def
Gline 206 source - def
αline 220 source - def
βline 221 source - def
αline 235 source - def
Fline 346 source - def
Fline 355 source - def
fline 416 sourceDistinct definitions of this name: book/TPiL/AxiomsComputation.lean:340 (different declaration text), book/TPiL/InductionAndRecursion.lean:833 (different declaration text), book/TPiL/InteractingWithLean.lean:468 (different declaration text), book/TPiL/Tactics.lean:1457 (different declaration text). Qualify references as f@path.
- def
gline 417 sourceDistinct definitions of this name: book/TPiL/AxiomsComputation.lean:341 (different declaration text), book/TPiL/Tactics.lean:1781 (different declaration text). Qualify references as g@path.
- axiom
whateverAvoid warnings line 457 sourceSource comment
Avoid warningsaxiom whatever : α
Mentions: α
- def
bline 458 source - example
(example at line 464)line 464 source - def
fline 488 sourceDistinct definitions of this name: book/TPiL/AxiomsComputation.lean:340 (different declaration text), book/TPiL/InductionAndRecursion.lean:833 (different declaration text), book/TPiL/InteractingWithLean.lean:468 (different declaration text), book/TPiL/Tactics.lean:1457 (different declaration text). Qualify references as f@path.
- def
gline 489 sourceDistinct definitions of this name: book/TPiL/AxiomsComputation.lean:341 (different declaration text), book/TPiL/Tactics.lean:1781 (different declaration text). Qualify references as g@path.
- opaque
toline 526 sourceDistinct definitions of this name: book/TPiL/Tactics.lean:875 (different declaration text). Qualify references as to@path.
- def
doubleline 547 sourceDistinct definitions of this name: book/TPiL/InteractingWithLean.lean:150 (different declaration text). Qualify references as double@path.
- def
doubleline 558 sourceDistinct definitions of this name: book/TPiL/InteractingWithLean.lean:150 (different declaration text). Qualify references as double@path.
- def
doubleline 568 sourceDistinct definitions of this name: book/TPiL/InteractingWithLean.lean:150 (different declaration text). Qualify references as double@path.
- def
doubleline 578 sourceDistinct definitions of this name: book/TPiL/InteractingWithLean.lean:150 (same statement text; different proof or body). Qualify references as double@path.
- def
piline 593 source - def
addline 600 sourceDistinct definitions of this name: book/TPiL/InductionAndRecursion.lean:505 (different declaration text), book/TPiL/InteractingWithLean.lean:231 (different declaration text). Qualify references as add@path.
- def
doubleline 609 sourceDistinct definitions of this name: book/TPiL/InteractingWithLean.lean:150 (different declaration text). Qualify references as double@path.
- def
addline 612 sourceSource comment
---Distinct definitions of this name: book/TPiL/InductionAndRecursion.lean:505 (different declaration text), book/TPiL/InteractingWithLean.lean:231 (different declaration text). Qualify references as add@path.
def add (x : Nat) (y : Nat) := …
Mentions: x
- def
greaterline 624 source - def
doubleline 636 sourceDistinct definitions of this name: book/TPiL/InteractingWithLean.lean:150 (different declaration text). Qualify references as double@path.
- def
doTwiceline 639 sourceSource comment
---def doTwice (f : Nat → Nat) (x : Nat) : Nat := …
Mentions: x
- def
composeline 649 source - def
composeline 672 source - def
doubleline 674 sourceDistinct definitions of this name: book/TPiL/InteractingWithLean.lean:150 (different declaration text). Qualify references as double@path.
- def
squareline 677 sourceSource comment
---def square (x : Nat) : Nat := …
Mentions: x
- def
Naturalline 687 source - def
Naturalline 691 source - def
fiveExample that fails: a numeral at a type that merely unfolds to Nat line 693 sourceSource comment
----L4DEL explanation
def Natural := Nat makes Natural a new name, but numeral literals still need an OfNat Natural 5 instance that does not exist.
- The book defines Natural as an alternative name for Nat with def Natural := Nat.
- This code block is marked as an expected error: def five : Natural := 5 does not elaborate.
- The recorded message says Lean failed to synthesize an instance of OfNat Natural 5, because numerals are polymorphic and the expected type is Natural.
- The point is that Lean treats a defined name as equal to its unfolding, but not every name is unfolded in every context, such as instance lookup.
Sources and attribution: Pinned Lean source (4e28129fdd58)
def five : Natural := 5 …
Mentions: Natural
- def
twice_doubleline 727 source - def
twice_doubleline 735 source - def
tline 754 source - def
fooline 779 sourceDistinct definitions of this name: book/TPiL/InductionAndRecursion.lean:115 (different declaration text), book/TPiL/InteractingWithLean.lean:784 (different declaration text). Qualify references as foo@path.
- def
composeline 795 source - def
doTwiceline 798 source - def
doThriceline 801 source - def
composeline 811 source - def
doTwiceline 814 source - def
doThriceline 817 source - def
composeline 826 source - def
doTwiceline 827 source - def
doThriceline 828 source - def
consline 1020 source - def
consline 1046 source - example
(example at line 1076)line 1076 source - def
fline 1112 sourceDistinct definitions of this name: book/TPiL/AxiomsComputation.lean:340 (different declaration text), book/TPiL/InductionAndRecursion.lean:833 (different declaration text), book/TPiL/InteractingWithLean.lean:468 (different declaration text), book/TPiL/Tactics.lean:1457 (different declaration text). Qualify references as f@path.
- def
gline 1115 sourceDistinct definitions of this name: book/TPiL/AxiomsComputation.lean:341 (different declaration text), book/TPiL/Tactics.lean:1781 (different declaration text). Qualify references as g@path.
- def
h1line 1118 source - def
h2line 1123 source - def
Lstline 1140 source - def
Lst.consline 1141 source - def
Lst.nilline 1142 source - def
Lst.appendline 1143 source - def
Lstline 1155 source - def
Lst.consline 1156 source - def
Lst.nilline 1157 source - def
Lst.appendline 1158 source - def
asline 1162 source - def
bsline 1163 source - def
Lstline 1169 source - def
Lstline 1190 source - def
Lst.consline 1191 source - def
Lst.nilline 1192 source - def
Lst.appendline 1193 source - def
asline 1201 source - def
bsline 1202 source - def
Lstline 1215 source - def
Lst.consline 1217 source - def
Lst.nilline 1218 source - def
Lst.appendline 1219 source - def
asline 1223 source - def
bsline 1224 source - def
identline 1235 source - def
identline 1241 source