proposition: Lemma surjectivity_is_epic `(f : X → Y) : Surjective f ↔ @Epic Sets _ _ f.
proof: Proof. unfold Epic, Surjective. split; intros; simpl in *. - extensionality y. specialize (H y). destruct H. rewrite <- H. apply (equal_f H0). - specialize H with (Z := Prop). specialize H with (g1 := fun y0 => ∃ x0, f x0 = y0). specialize H with (g2 := fun y => True). eapply equal_f in H. erewrite H. constructor. extensionality x. apply propositional_extensionality. exists x. reflexivity. Qed.
imports: Hask.Prelude Hask.Crush Coq.Unicode.Utf8 FunctionalExtensionality