<p>One first reason to reject axioms is that they might be inconsistent. Even for the axioms that are proved consistent, some of them have a computational interpretation (we know how to extend definitional equality with a reduction principle for them) and some do not -- those break canonicity. This is "bad" for different reasons:</p>

<ul>
<li><p>In theory, canonicity lets you prove things about the values of your language, without having to go to a specific model. This is a very satisfying property to have thinking about your system; in particular, it supports claims about the real world -- we can think of the <code>nat</code> type as formalized in the system as really "natural numbers" because we can prove that its closed normal inhabitants really are natural numbers. Otherwise it's easy to <em>think</em> that you modelled something correctly in your system, but actually be working with different objects.</p></li>
<li><p>In practice, reduction is a major asset of dependent type theories, because it makes proof easy. Proving a propositional equality can be arbitrarily difficult, while proving a definitional equality is (less often possible) but much easier, as the proof term is trivial. More generally, computation is a core aspect of the user experience of a proof assistant, and it is common to define things just so they reduce correctly as you expect. (You don't need axioms to make computation difficult; for example, using the conversion principle on propositional equalities can already block reductions). The entire business of <a href="http://poleiro.info/posts/2015-04-13-writing-reflective-tactics.html">proof by reflection</a> is based on the use of computation to help proofs. This is a major difference in power and convenience with respect to other logics-based proof assistant (eg. HOL-light, which only supports equality reasoning; or see <a href="http://www.seas.upenn.edu/~sweirich/papers/congruence-extended.pdf">Zombie</a> for a different approach), and using unchecked axioms, or other programming styles, can get you out of this comfort zone.</p></li>
</ul>

CC BY-SA 3.0
2015-12-30T09:02:08.783Z
+1 Thanks for your answer! Could you give me some examples of axioms that have a computational interpretation (or maybe any reference for the subject)?
StudentType
CC BY-SA 3.0
2016-01-02T19:19:06.910Z
One example of axiom that has a computational interpretation is Prop-Irrelevance: claiming that all inhabitants of some family of types (in this precise case, those of the kind `Prop` in the Coq proof assistants, that correspond to purely logical statements; Prop-Irrelevance corresponds to ignoring the internal structure of the proofs of those statements) are equal can be done mostly by not caring about them anymore, it need not affect computation -- but it needs to be done carefully to not make the system inconsistent either.
gasche
CC BY-SA 3.0
2016-01-02T19:25:26.640Z
Another family of computational intepretation comes from correspondences between classical reasoning and control effect. The better-known part of this is that the excluded middle can be given a computational semantics by continuation capture, but there are restricted forms of control (exceptions at positive types) that give finer-grained logical principles (eg. [Markov's Principle](https://en.wikipedia.org/wiki/Markov's_principle)). See Hugo Herbelin's [An intuitionistic logic that proves Markov's principle](http://pauillac.inria.fr/~herbelin/articles/lics-Her10-markov+errata.pdf), 2010.
gasche
CC BY-SA 3.0
2015-12-19T15:31:48.597Z
2015-12-19T15:31:48.597Z
gasche
<p>To understand why extending a theorem prover with some axioms can cause problems, it is also interesting to see when it is benign to do so. Two cases come to mind and they both have to do with the fact that we do not care about the computational behaviour of the postulates.</p>

<ul>
<li><p>In Observational Type Theory, it is possible to postulate a proof of any consistent <code>Prop</code> without losing canonicity. Indeed, all the proofs are considered equal and the system enforces this by completely refusing to look at the terms. As a consequence, the fact that a proof was built by hand or simply postulated bears no consequence. A typical example would be the proof of "cohesion": if we have a proof <code>eq</code> that <code>A = B : Type</code> then for any <code>t</code> of type <code>A</code>, <code>t == coerce A B eq t</code> where <code>coerce</code> simply transports a term along an equality proof.</p></li>
<li><p>In MLTT, one can postulate any <a href="http://www.cs.bham.ac.uk/~mhe/papers/negative-axioms.pdf" rel="nofollow">Negative consistent axiom without loss of canonicity</a>. The intuition behind this is that negative axioms (axioms of the form <code>A -&gt; False</code>) are only ever used to dismiss irrelevant branches. If the axiom is consistent, then it can only be used in branches which are indeed irrelevant and will therefore never be taken when evaluating the terms.</p></li>
</ul>

CC BY-SA 3.0
2015-12-19T16:34:37.663Z
2015-12-19T16:34:37.663Z
gallais
<p>A practical example of an axiom behaving badly you ask, what about this?</p>

<pre><code> 0 = 1
</code></pre>

<p>The Coquand paper referred to might be [ 1 ], where he shows that dependent ITT (Martin-L&ouml;f's intuitionistic type theory) extended with pattern matching allows you to prove UIP (axiom of <a href="https://ncatlab.org/nlab/show/axiom+UIP" rel="nofollow">uniqueness of identity proofs</a>).  Later Streicher and Hoffmann [ 2 ] present a model of in  ITT that falsifies UIP.  Hence pattern matching is not a conservative extension of ITT.</p>

<hr>

<p><sub></p>

<ol>
<li><p>T. Coquand, <a href="http://www.cse.chalmers.se/~coquand/pattern.ps" rel="nofollow">Pattern matching with dependent types</a>.</p></li>
<li><p>M. Hofmann, T. Streicher, <a href="http://www.mathematik.tu-darmstadt.de/~streicher/venedig.ps.gz" rel="nofollow">The groupoid interpretation of type theory</a>.</p></li>
</ol>

<p></sub></p>

CC BY-SA 3.0
2015-12-19T15:47:49.550Z
2015-12-19T16:54:03.923Z
2015-12-19T16:54:03.923Z
Martin Berger
<p>Is it true that adding axioms to the CIC might have negative influences in the computational content of definitions and theorems? I understand that, in the theory's normal behavior, any closed term will reduce to its canonical normal form, e.g. if $n : \mathbb{N}$ is true, then $n$ must reduce to a term of the form $(succ ... (succ (0)))$. But when postulating an axiom - say the function extensionality axiom <code>funext</code> - we just add a new constant to the system</p>

<p>$$ funext : \Pi_{x : A} f (x) = g (x) \to f = g$$</p>

<p>that will just "magically" produces a proof of $f = g$ from any proof of $\Pi_{x : A} f (x) = g (x)$, without any computational meaning at all (<em>in the sense that we cannot extract any code from them?</em>)</p>

<p>But why is this "bad"?</p>

<p>For <code>funext</code>, I read in this <a href="https://coq.inria.fr/cocorico/extensional_equality" rel="nofollow noreferrer">coq entry</a> and this <a href="https://mathoverflow.net/questions/156238/function-extensionality-does-it-make-a-difference-why-would-one-keep-it-out-of">mathoverflow question</a> that it will cause the system to either loose canonicity or decidable checking. The coq entry seems to present a good example, but I still would like some more references on that - and somehow I can't find any.</p>

<p>How is that adding extra axioms could cause CIC to have a worse behavior? Any practical examples would be great. (For example, the Univalence Axiom?)
I am afraid in this question is too soft, but if anyone could shed some light on those issues or give me some references would be great!</p>

<hr>

<p>PS: The coq entry mentions that "Thierry Coquand already observed that pattern matching over intensional families is inconsistent with extensionality in the mid 90ies." Does anyone know in which paper or something?</p>

<type-theory><lambda-calculus><dependent-type><homotopy-type-theory>
What are the negative consequences of extending CIC with axioms?
StudentType
# What are the negative consequences of extending CIC with axioms?

(Asked by: username_0 on 2015-12-19)

Is it true that adding axioms to the CIC might have negative influences in the computational content of definitions and theorems? I understand that, in the theory's normal behavior, any closed term will reduce to its canonical normal form, e.g. if $n : \mathbb{N}$ is true, then $n$ must reduce to a term of the form $(succ ... (succ (0)))$. But when postulating an axiom - say the function extensionality axiom `funext` - we just add a new constant to the system

$$ funext : \Pi\_{x : A} f (x) = g (x) \to f = g$$

that will just "magically" produces a proof of $f = g$ from any proof of $\Pi\_{x : A} f (x) = g (x)$, without any computational meaning at all (*in the sense that we cannot extract any code from them?*)

But why is this "bad"?

For `funext`, I read in this [coq entry](https://coq.inria.fr/cocorico/extensional_equality) and this [mathoverflow question](https://mathoverflow.net/questions/156238/function-extensionality-does-it-make-a-difference-why-would-one-keep-it-out-of) that it will cause the system to either loose canonicity or decidable checking. The coq entry seems to present a good example, but I still would like some more references on that - and somehow I can't find any.

How is that adding extra axioms could cause CIC to have a worse behavior? Any practical examples would be great. (For example, the Univalence Axiom?)
I am afraid in this question is too soft, but if anyone could shed some light on those issues or give me some references would be great!

---

PS: The coq entry mentions that "Thierry Coquand already observed that pattern matching over intensional families is inconsistent with extensionality in the mid 90ies." Does anyone know in which paper or something?

**Tags:** type-theory, lambda-calculus, dependent-type, homotopy-type-theory


---

## 3 answers

### Answer by username_1 on 2015-12-19. Score: 7

One first reason to reject axioms is that they might be inconsistent. Even for the axioms that are proved consistent, some of them have a computational interpretation (we know how to extend definitional equality with a reduction principle for them) and some do not -- those break canonicity. This is "bad" for different reasons:

* In theory, canonicity lets you prove things about the values of your language, without having to go to a specific model. This is a very satisfying property to have thinking about your system; in particular, it supports claims about the real world -- we can think of the `nat` type as formalized in the system as really "natural numbers" because we can prove that its closed normal inhabitants really are natural numbers. Otherwise it's easy to *think* that you modelled something correctly in your system, but actually be working with different objects.
* In practice, reduction is a major asset of dependent type theories, because it makes proof easy. Proving a propositional equality can be arbitrarily difficult, while proving a definitional equality is (less often possible) but much easier, as the proof term is trivial. More generally, computation is a core aspect of the user experience of a proof assistant, and it is common to define things just so they reduce correctly as you expect. (You don't need axioms to make computation difficult; for example, using the conversion principle on propositional equalities can already block reductions). The entire business of [proof by reflection](http://poleiro.info/posts/2015-04-13-writing-reflective-tactics.html) is based on the use of computation to help proofs. This is a major difference in power and convenience with respect to other logics-based proof assistant (eg. HOL-light, which only supports equality reasoning; or see [Zombie](http://www.seas.upenn.edu/~sweirich/papers/congruence-extended.pdf) for a different approach), and using unchecked axioms, or other programming styles, can get you out of this comfort zone.

> **Comments:**
> **username_0**: +1 Thanks for your answer! Could you give me some examples of axioms that have a computational interpretation (or maybe any reference for the subject)?  
> **username_1**: One example of axiom that has a computational interpretation is Prop-Irrelevance: claiming that all inhabitants of some family of types (in this precise case, those of the kind `Prop` in the Coq proof assistants, that correspond to purely logical statements; Prop-Irrelevance corresponds to ignoring the internal structure of the proofs of those statements) are equal can be done mostly by not caring about them anymore, it need not affect computation -- but it needs to be done carefully to not make the system inconsistent either.  
> **username_1**: Another family of computational intepretation comes from correspondences between classical reasoning and control effect. The better-known part of this is that the excluded middle can be given a computational semantics by continuation capture, but there are restricted forms of control (exceptions at positive types) that give finer-grained logical principles (eg. [Markov's Principle](https://en.wikipedia.org/wiki/Markov's_principle)). See Hugo Herbelin's [An intuitionistic logic that proves Markov's principle](http://pauillac.inria.fr/~herbelin/articles/lics-Her10-markov+errata.pdf), 2010.  

---

### Answer by username_2 on 2015-12-19. Score: 5

To understand why extending a theorem prover with some axioms can cause problems, it is also interesting to see when it is benign to do so. Two cases come to mind and they both have to do with the fact that we do not care about the computational behaviour of the postulates.

* In Observational Type Theory, it is possible to postulate a proof of any consistent `Prop` without losing canonicity. Indeed, all the proofs are considered equal and the system enforces this by completely refusing to look at the terms. As a consequence, the fact that a proof was built by hand or simply postulated bears no consequence. A typical example would be the proof of "cohesion": if we have a proof `eq` that `A = B : Type` then for any `t` of type `A`, `t == coerce A B eq t` where `coerce` simply transports a term along an equality proof.
* In MLTT, one can postulate any [Negative consistent axiom without loss of canonicity](http://www.cs.bham.ac.uk/~mhe/papers/negative-axioms.pdf). The intuition behind this is that negative axioms (axioms of the form `A -> False`) are only ever used to dismiss irrelevant branches. If the axiom is consistent, then it can only be used in branches which are indeed irrelevant and will therefore never be taken when evaluating the terms.


---

### Answer by username_3 on 2015-12-19. Score: 4

A practical example of an axiom behaving badly you ask, what about this?
 0 = 1

The Coquand paper referred to might be [ 1 ], where he shows that dependent ITT (Martin-Löf's intuitionistic type theory) extended with pattern matching allows you to prove UIP (axiom of uniqueness of identity proofs).  Later Streicher and Hoffmann [ 2 ] present a model of in  ITT that falsifies UIP.  Hence pattern matching is not a conservative extension of ITT.



T. Coquand, Pattern matching with dependent types.
M. Hofmann, T. Streicher, The groupoid interpretation of type theory.


---

