Skip to content

Instantly share code, notes, and snippets.

@siraben
Last active December 17, 2021 23:20
Show Gist options
  • Save siraben/e727bac7ea1ba15678bca990f1b73f77 to your computer and use it in GitHub Desktop.
Save siraben/e727bac7ea1ba15678bca990f1b73f77 to your computer and use it in GitHub Desktop.
Constructive proof that there are no surjections from {1} to {1,2}
(* There are no surjections from {1} to {1,2} *)
Definition surjective {A B} (f : A -> B) := forall (b : B), exists (a : A), b = f a.
Definition One := unit.
Definition Two := bool.
Theorem no_surject_one_two : ~ exists (f : One -> Two), surjective f.
Proof.
intros [f Hf].
unfold surjective in Hf.
destruct (f tt) eqn:E.
- pose proof (Hf false). destruct H as [[] Hf']. congruence.
- pose proof (Hf true). destruct H as [[] Hf']. congruence.
Qed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment