-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBug.lean
More file actions
25 lines (22 loc) · 794 Bytes
/
Bug.lean
File metadata and controls
25 lines (22 loc) · 794 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
inductive Ordinal
| zero : Ordinal
| succ : Ordinal → Ordinal
| limit : (Nat → Ordinal) → Ordinal
variable
{motive : Ordinal → Sort u}
(zero : motive .zero)
(succ : (o : Ordinal) → motive o → motive (.succ o))
(limit : (f : Nat → Ordinal) → ((n : Nat) → motive (f n)) → motive (.limit f))
in
def Ordinal.rec' : (o : Ordinal) → motive o
| .zero => zero
| .succ o => succ o (rec' o)
| .limit f => limit f λ n => rec' (f n)
@[csimp]
def Ordinal.rec_eq_rec' : @rec = @rec' := by
funext motive zero succ limit o
induction o with
| zero => rfl
| succ o ho => exact congrArg _ ho
| limit f hf => exact congrArg _ (funext hf)
#eval @Ordinal.rec (λ _ => Option Nat) (some .zero) (λ _ => Option.map .succ) (λ _ _ => none) (.succ <| .succ .zero)