Skip to content
Snippets Groups Projects
Commit bcebd707 authored by Ralf Jung's avatar Ralf Jung
Browse files

Merge branch 'ralf/pred_infinite_surj' into 'master'

add pred_infinite_surj

See merge request !225
parents 58c0e8cb 5728445c
No related branches found
No related tags found
1 merge request!225add pred_infinite_surj
Pipeline #41245 passed
...@@ -1044,6 +1044,18 @@ Section pred_finite_infinite. ...@@ -1044,6 +1044,18 @@ Section pred_finite_infinite.
pred_infinite P ( x, P x Q x) pred_infinite Q. pred_infinite P ( x, P x Q x) pred_infinite Q.
Proof. unfold pred_infinite. set_solver. Qed. Proof. unfold pred_infinite. set_solver. Qed.
(** If [f] is surjective onto [P], then pre-composing with [f] preserves
infinity. *)
Lemma pred_infinite_surj {A B} (P : B Prop) (f : A B) :
( x, P x y, f y = x)
pred_infinite P pred_infinite (P f).
Proof.
intros Hf HP xs. destruct (HP (f <$> xs)) as [x [HPx Hx]].
destruct (Hf _ HPx) as [y Hf']. exists y. split.
- simpl. rewrite Hf'. done.
- intros Hy. apply Hx. apply elem_of_list_fmap. eauto.
Qed.
Lemma pred_not_infinite_finite {A} (P : A Prop) : Lemma pred_not_infinite_finite {A} (P : A Prop) :
pred_infinite P pred_finite P False. pred_infinite P pred_finite P False.
Proof. intros Hinf [xs ?]. destruct (Hinf xs). set_solver. Qed. Proof. intros Hinf [xs ?]. destruct (Hinf xs). set_solver. Qed.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment