Skip to content

Commit e1bf9e7

Browse files
fix: more consistent terminology for inductive types (#504)
Closes #443
1 parent 5424941 commit e1bf9e7

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

Manual/Language/InductiveTypes/LogicalModel.lean

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ tag := "recursor-types"
3838
The recursor takes the following parameters:
3939
: The inductive type's {tech}[parameters]
4040

41-
Because parameters are consistent, they can be abstracted over the entire recursor
41+
Because parameters are consistent, they can be abstracted over the entire recursor.
4242

4343
: The {deftech}_motive_
4444

@@ -48,23 +48,23 @@ The recursor takes the following parameters:
4848

4949
For each constructor, the recursor expects a function that satisfies the motive for an arbitrary application of the constructor.
5050
Each minor premise abstracts over all of the constructor's parameters.
51-
If the constructor's parameter's type is the inductive type itself, then the case additionally takes a parameter whose type is the motive applied to that parameter's value—this will receive the result of recursively processing the recursive parameter.
51+
If the constructor's parameter's type is the inductive type itself, then the minor premise additionally takes a parameter whose type is the motive applied to that parameter's value—this will receive the result of recursively processing the recursive parameter.
5252

5353
: The {deftech}_major premise_, or target
5454

5555
Finally, the recursor takes an instance of the type as an argument, along with any index values.
5656

57-
The result type of the recursor is the motive applied to these indices and the target.
57+
The result type of the recursor is the motive applied to these indices and the major premise.
5858
:::
5959

6060
:::example "The recursor for {lean}`Bool`"
6161
{lean}`Bool`'s recursor {name}`Bool.rec` has the following parameters:
6262

6363
* The motive computes a type in any universe, given a {lean}`Bool`.
64-
* There are cases for both constructors, in which the motive is satisfied for both {lean}`false` and {lean}`true`.
65-
* The target is some {lean}`Bool`.
64+
* There are minor premises for both constructors, in which the motive is satisfied for both {lean}`false` and {lean}`true`.
65+
* The major premise is some {lean}`Bool`.
6666

67-
The return type is the motive applied to the target.
67+
The return type is the motive applied to the major premise.
6868

6969
```signature
7070
Bool.rec.{u} {motive : Bool → Sort u}
@@ -82,15 +82,15 @@ Bool.rec.{u} {motive : Bool → Sort u}
8282
axiom α.{u} : Type u
8383
```
8484

85-
* The parameter {lean}`α` comes first, because the parameter and the cases need to refer to it
85+
* The parameter {lean}`α` comes first, because the motive, minor premises, and major premise need to refer to it.
8686
* The motive computes a type in any universe, given a {lean}`List α`. There is no connection between the universe levels `u` and `v`.
87-
* There are cases for both constructors:
87+
* There are minor premises for both constructors:
8888
- The motive is satisfied for {name}`List.nil`
8989
- The motive should be satisfiable for any application of {name}`List.cons`, given that it is satisfiable for the tail. The extra parameter `motive tail` is because `tail`'s type is a recursive occurrence of {name}`List`.
90-
* The target is some {lean}`List α`.
90+
* The major premise is some {lean}`List α`.
9191
:::
9292

93-
Once again, the return type is the motive applied to the target.
93+
Once again, the return type is the motive applied to the major premise.
9494

9595
```signature
9696
List.rec.{u, v} {α : Type v} {motive : List α → Sort u}
@@ -114,9 +114,9 @@ inductive EvenOddList (α : Type u) : Bool → Type u where
114114
The recursor {name}`EvenOddList.rec` is very similar to that for `List`.
115115
The difference comes from the presence of the index:
116116
* The motive now abstracts over any arbitrary choice of index.
117-
* The case for {name EvenOddList.nil}`nil` applies the motive to {name EvenOddList.nil}`nil`'s index value `true`.
118-
* The case for {name EvenOddList.cons}`cons` abstracts over the index value used in its recursive occurrence, and instantiates the motive with its negation.
119-
* The target additionally abstracts over an arbitrary choice of index.
117+
* The minor premise for {name EvenOddList.nil}`nil` applies the motive to {name EvenOddList.nil}`nil`'s index value `true`.
118+
* The minor premise {name EvenOddList.cons}`cons` abstracts over the index value used in its recursive occurrence, and instantiates the motive with its negation.
119+
* The major premise additionally abstracts over an arbitrary choice of index.
120120

121121
```signature
122122
EvenOddList.rec.{u, v} {α : Type v}
@@ -132,7 +132,7 @@ EvenOddList.rec.{u, v} {α : Type v}
132132
:::::
133133

134134
When using a predicate (that is, a function that returns a {lean}`Prop`) for the motive, recursors express induction.
135-
The cases for non-recursive constructors are the base cases, and the additional arguments supplied to constructors with recursive arguments are the induction hypotheses.
135+
The minor premises for non-recursive constructors are the base cases, and the additional arguments supplied to minor premises for constructors with recursive arguments are the induction hypotheses.
136136

137137
### Subsingleton Elimination
138138
%%%
@@ -218,11 +218,11 @@ tag := "iota-reduction"
218218

219219

220220
In addition to adding new constants to the logic, inductive type declarations also add new reduction rules.
221-
These rules govern the interaction between recursors and constructors; specifically recursors that have constructors as their targets.
221+
These rules govern the interaction between recursors and constructors; specifically recursors that have constructors as their major premise.
222222
This form of reduction is called {deftech}_ι-reduction_ (iota reduction){index}[ι-reduction]{index (subterm:="ι (iota)")}[reduction].
223223

224-
When the recursor's target is a constructor with no recursive parameters, the recursor application reduces to an application of the constructor's case to the constructor's arguments.
225-
If there are recursive parameters, then these arguments to the case are found by applying the recursor to the recursive occurrence.
224+
When the recursor's major premise is a constructor with no recursive parameters, the recursor application reduces to an application of the constructor's minor premise to the constructor's arguments.
225+
If there are recursive parameters, then these arguments to the minor premise are found by applying the recursor to the recursive occurrence.
226226

227227
# Well-Formedness Requirements
228228
%%%
@@ -367,9 +367,9 @@ tag := "recursor-elaboration-helpers"
367367

368368
In addition to the type constructor, constructors, and recursors that Lean's core type theory prescribes for inductive types, Lean constructs a number of useful helpers.
369369
First, the equation compiler (which translates recursive functions with pattern matching in to applications of recursors) makes use of these additional constructs:
370-
* `recOn` is a version of the recursor in which the target is prior to the cases for each constructor.
371-
* `casesOn` is a version of the recursor in which the target is prior to the cases for each constructor, and recursive arguments do not yield induction hypotheses. It expresses case analysis rather than primitive recursion.
372-
* `below` computes a type that, for some motive, expresses that _all_ inhabitants of the inductive type that are subtrees of the target satisfy the motive. It transforms a motive for induction or primitive recursion into a motive for strong recursion or strong induction.
370+
* `recOn` is a version of the recursor in which the major premise is prior to the minor premise for each constructor.
371+
* `casesOn` is a version of the recursor in which the major premise is prior to the minor premise for each constructor, and recursive arguments do not yield induction hypotheses. It expresses case analysis rather than primitive recursion.
372+
* `below` computes a type that, for some motive, expresses that _all_ inhabitants of the inductive type that are subtrees of the major premise satisfy the motive. It transforms a motive for induction or primitive recursion into a motive for strong recursion or strong induction.
373373
* `brecOn` is a version of the recursor in which `below` is used to provide access to all subtrees, rather than just immediate recursive parameters. It represents strong induction.
374374
* `noConfusion` is a general statement from which injectivity and disjointness of constructors can be derived.
375375
* `noConfusionType` is the motive used for `noConfusion` that determines what the consequences of two constructors being equal would be. For separate constructors, this is {lean}`False`; if both constructors are the same, then the consequence is the equality of their respective parameters.

0 commit comments

Comments
 (0)