aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorThéo Zimmermann2019-10-30 16:01:02 +0100
committerThéo Zimmermann2019-10-30 16:01:02 +0100
commitd7bacbba67e9242faa24bc6ff34dede1dbe30ed3 (patch)
tree7c1f26f54291047452fbcce3586ed94d4ed9714d /doc
parentdbcdc4e53758339d2a7eb96d19fbcffeb143154d (diff)
[refman] Give an example of contradiction when positivity checking is disabled.
Diffstat (limited to 'doc')
-rw-r--r--doc/sphinx/language/cic.rst32
1 files changed, 32 insertions, 0 deletions
diff --git a/doc/sphinx/language/cic.rst b/doc/sphinx/language/cic.rst
index c08a9ed0e6..b8c1c523b7 100644
--- a/doc/sphinx/language/cic.rst
+++ b/doc/sphinx/language/cic.rst
@@ -1046,6 +1046,38 @@ between universes for inductive types in the Type hierarchy.
exT_intro : forall X:Type, P X -> exType P.
+.. example:: Negative occurrence
+
+ The following inductive definition is rejected because it does not
+ satisfy the positivity condition:
+
+ .. coqtop:: all
+
+ Fail Inductive I : Prop := not_I_I (not_I : I -> False) : I.
+
+ If we were to accept such definition, we could derive a
+ contradiction from it (we can test this by disabling the
+ :flag:`Positivity Checking` flag):
+
+ .. coqtop:: none
+
+ Unset Positivity Checking.
+ Inductive I : Prop := not_I_I (not_I : I -> False) : I.
+ Set Positivity Checking.
+
+ .. coqtop:: all
+
+ Definition I_not_I '(not_I_I not_I : I) : ~ I := not_I.
+
+ .. coqtop:: in
+
+ Lemma contradiction : False.
+ Proof.
+ enough (I /\ ~ I) as [] by contradiction.
+ split.
+ apply not_I_I; intro; now apply I_not_I.
+ intro; now apply I_not_I.
+ Qed.
.. _Template-polymorphism: