Consider this toy Coq problem (CollaCoq):
Require Import ssreflect ssrfun ssrbool.
Require Import Unicode.Utf8.
Definition optfun (n: nat) : option nat :=
match n with
| 0 => Some 0
| _ => None
end.
Definition boolfun (n: nat) : bool :=
match n with
| 0 => true
| _ => false
end.
Lemma lem : ∀ n, isSome (optfun n) = boolfun n.
Proof.
intro. unfold optfun, boolfun. destruct n.
My goal here was to have boolfun be true whenever optfun returns a Some, and to prove that in the lemma.
However, after the proof steps given, the current subgoal is Some 0 = true.
I thought a proposition like that should not even type check because I'd expect Some 0 to be of type option nat and true to be of type bool. Why does this happen? Is there something wrong with my optfun, boolfun or lem?