3

It seems to be impossible to extract the second element of Sigma on the Calculus of Constructions. Moreover, it seems like there is no known, simple way to extend the Calculus of Constructions with dependent eliminations without losing consistency. How can one, thus, exploit a simple but inconsistent axiom (such as Type : Type or unrestricted recursion such as μ) to extract the second element of Sigma?

That is, given the following Sigma constructor:

Sigma =
  λ A : *
  λ B : A -> *
  λ a : A
  λ b : B
  λ Data : *
  λ Sigma :
    ∀ fst : A
    ∀ snd : B fst
    Data
  Sigma a b

In a language equivalent to the Calculus of Constructions, except with Type : Type or some other simple inconsistent axiom, is it possible to implement a function that, given a term such as Sigma Nat (\x -> Nat) 3 6, extracts the second value, 6?

MaiaVictor
  • 51,090
  • 44
  • 144
  • 286
  • 1
    IMHO you need to make your question more precise, in particular what are the conditions for you "extraction". Obviously, if my calculus is inconsistent I can extract whatever I want by means of bottom-elimination. – ejgallego Dec 15 '17 at 19:04
  • @ejgallego may be obvious to you, but it isn't to me! I've made the question more precise as requested. – MaiaVictor Dec 15 '17 at 20:15
  • Indeed the question is now more precise as you want extraction to recover the original term modulo the reduction rules. I didn't mean the question was obvious, but indeed that adding inconsistent axioms usually implies that you can define a trivial extraction function so one has to be careful with the exact definition. – ejgallego Dec 15 '17 at 20:50

1 Answers1

5

In the context of a type theory such as Martin-Löf type theory or the Calculus of Constructions, by "inconsistency" we usually mean logical inconsistency: being able to derive a term contra of type forall T : Type, T. In this case, any other type T becomes inhabited: it suffices to apply contra to it.

Unfortunately, in most type theories, being inhabited tells us nothing about convertibility, or definitional equality, because there is no type expresses that two terms x and y are convertible. This means that there is no way of deriving terms

fst : Sigma A B -> A
snd : forall s : Sigma A B, B (fst s)

such that fst (Sigma _ _ x y) simplifies to x and snd (Sigma _ _ x y) simplifies to y by appealing to a logical contradiction. (I have abused notation a bit and used Sigma for both the constructor and the type.) You can, however, use contra to postulate the existence of fst and snd and assert that the corresponding equations hold propositionally.

In plain CoC, we say that two terms x1 and x2 are propositionally equal if there is a term of type

forall T, T x1 -> T x2

(This is sometimes known as Leibniz equality: two terms are equal if every predicate that holds of the first one holds of the second one.) Stating a similar for snd is somewhat more complicated, because snd (Sigma _ _ x y) and y do not have the same types (the former is of type B (fst (Sigma _ _ x y)), while the latter is of type B x). We can remedy this by asserting simplification lemmas for fst and snd simultaneously:

forall (T : forall x : A, B x -> Type),
  T (fst (Sigma _ _ x y)) (snd (Sigma _ _ x y)) -> 
  T x y

Edit

Concerning your comment: since convertibility usually cannot be expressed with a type, we need to modify its definition in the type theory to have a true sigma type with first and second projections -- a more delicate operation than simply positing that certain axioms hold. There are some systems that allow this, such as Dedukti, a proof checker developed at Inria.

Arthur Azevedo De Amorim
  • 23,012
  • 3
  • 33
  • 39