| 1 |
Set Primitive Projections. |
| 2 |
Set Implicit Arguments. |
| 3 |
Set Nonrecursive Elimination Schemes. |
| 4 |
Record prod A B := pair { fst : A ; snd : B }. |
| 5 |
Definition f : Set -> Type := fun x => x. |
| 6 |
|
| 7 |
Goal (fst (pair (fun x => x + 1) nat) 0) = 0. |
| 8 |
compute. |
| 9 |
Undo. |
| 10 |
cbv. |
| 11 |
Undo. |
| 12 |
Opaque fst. |
| 13 |
cbn. |
| 14 |
Transparent fst. |
| 15 |
cbn. |
| 16 |
Undo. |
| 17 |
simpl. |
| 18 |
Undo. |
| 19 |
Abort. |
| 20 |
|
| 21 |
Goal f (fst (pair nat nat)) = nat. |
| 22 |
compute. |
| 23 |
match goal with |
| 24 |
| [ |- fst ?x = nat ] => fail 1 "compute failed" |
| 25 |
| [ |- nat = nat ] => idtac |
| 26 |
end. |
| 27 |
reflexivity. |
| 28 |
Defined. |
| 29 |
|
| 30 |
Goal fst (pair nat nat) = nat. |
| 31 |
unfold fst. |
| 32 |
match goal with |
| 33 |
| [ |- fst ?x = nat ] => fail 1 "compute failed" |
| 34 |
| [ |- nat = nat ] => idtac |
| 35 |
end. |
| 36 |
reflexivity. |
| 37 |
Defined. |
| 38 |
|
| 39 |
Lemma eta A B : forall x : prod A B, x = pair (fst x) (snd x). reflexivity. Qed. |