Skip to content
Snippets Groups Projects
Commit 57c98ce1 authored by Alix Trieu's avatar Alix Trieu
Browse files

Apply Robbert's suggestions

parent 57a1a207
No related branches found
No related tags found
No related merge requests found
...@@ -224,11 +224,12 @@ Section surjective_finite. ...@@ -224,11 +224,12 @@ Section surjective_finite.
Context `{Finite A, EqDecision B} (f : A B). Context `{Finite A, EqDecision B} (f : A B).
Context `{!Surj (=) f}. Context `{!Surj (=) f}.
Program Instance surjective_finite: Finite B := {| enum := remove_dups (f <$> enum A) |}. Program Instance surjective_finite: Finite B :=
{| enum := remove_dups (f <$> enum A) |}.
Next Obligation. apply NoDup_remove_dups. Qed. Next Obligation. apply NoDup_remove_dups. Qed.
Next Obligation. Next Obligation.
intros y. rewrite elem_of_remove_dups, elem_of_list_fmap. intros y. rewrite elem_of_remove_dups, elem_of_list_fmap.
destruct (Surj0 y). eauto using elem_of_enum. destruct (surj f y). eauto using elem_of_enum.
Qed. Qed.
End surjective_finite. End surjective_finite.
...@@ -236,9 +237,9 @@ Section bijective_finite. ...@@ -236,9 +237,9 @@ Section bijective_finite.
Context `{Finite A, EqDecision B} (f : A B) (g : B A). Context `{Finite A, EqDecision B} (f : A B) (g : B A).
Context `{!Inj (=) (=) f, !Cancel (=) f g}. Context `{!Inj (=) (=) f, !Cancel (=) f g}.
Program Instance bijective_finite: Finite B := _. Global Instance bijective_finite: Finite B :=
Next Obligation. eapply surjective_finite. eapply cancel_surj. let _ := cancel_surj (f:=f) (g:=g) in
Unshelve. all: eapply _. Qed. surjective_finite f.
End bijective_finite. End bijective_finite.
Program Instance option_finite `{Finite A} : Finite (option A) := Program Instance option_finite `{Finite A} : Finite (option A) :=
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment