Given this:
Inductive color := Black | White.
Inductive point_state :=
| Occupied of color
| Empty
.
this works:
Fact ps_case (ps: point_state):
ps = Occupied White ∨ ps = Occupied Black ∨ ps = Empty.
Proof.
case: ps => [c|].
- by case: c; auto.
- by auto.
Qed.
but this doesn't (it complains "no applicable tactic"):
Fact ps_case (ps: point_state):
ps = Occupied White ∨ ps = Occupied Black ∨ ps = Empty.
Proof.
case: ps => [c|]; first [case: c; auto].
Why? By my (clearly flawed) reading of the manual, the two should be completely equivalent. In fact I didn't expect to need the "auto" there either, but we can leave that for the next question.
Update: the following works, and is definitely an improvement. But I still want to understand why the "first" way fails.
Fact ps_case ps:
ps = Empty ∨ ps = Occupied White ∨ ps = Occupied Black.
Proof.
by case: ps => [c|]; [case: c; auto|auto].
Qed.