aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEnrico Tassi2019-11-22 10:05:19 +0100
committerEnrico Tassi2019-11-22 10:05:19 +0100
commit27e4f306d54f2cc04b40d740584a7b3eda2d490a (patch)
tree2333ae2a36f05edda2928e912ac37c360df06a83
parent83ab871c90c862ebb08bcc549701beec0afc6cce (diff)
parent9832c2a4714fc594f159e277f65b0d388ff643d7 (diff)
Merge PR #11136: Adding `inj_compr` lemma in ssrfun.
Ack-by: Zimmi48 Reviewed-by: gares
-rw-r--r--doc/changelog/06-ssreflect/11136-inj_compr.rst2
-rw-r--r--plugins/ssr/ssrfun.v3
2 files changed, 5 insertions, 0 deletions
diff --git a/doc/changelog/06-ssreflect/11136-inj_compr.rst b/doc/changelog/06-ssreflect/11136-inj_compr.rst
new file mode 100644
index 0000000000..b546fcde6b
--- /dev/null
+++ b/doc/changelog/06-ssreflect/11136-inj_compr.rst
@@ -0,0 +1,2 @@
+- Added lemma :g:`inj_compr` to :g:`ssr.ssrfun`
+ (`#11136 <https://github.com/coq/coq/pull/11136>`_, by Cyril Cohen).
diff --git a/plugins/ssr/ssrfun.v b/plugins/ssr/ssrfun.v
index b8affba541..dd847169b9 100644
--- a/plugins/ssr/ssrfun.v
+++ b/plugins/ssr/ssrfun.v
@@ -675,6 +675,9 @@ Proof. by move=> fK injf' x; apply: injf'. Qed.
Lemma inj_comp : injective f -> injective h -> injective (f \o h).
Proof. by move=> injf injh x y /injf; apply: injh. Qed.
+Lemma inj_compr : injective (f \o h) -> injective h.
+Proof. by move=> injfh x y /(congr1 f) /injfh. Qed.
+
Lemma can_comp f' h' : cancel f f' -> cancel h h' -> cancel (f \o h) (h' \o f').
Proof. by move=> fK hK x; rewrite /= fK hK. Qed.