How can I get Coq to let me prove syntactic type inequality?
Negating univalence
I've read the answer to this question, which suggests that if you assume univalence, then the only way to prove type inequality is through cardinality arguments.
My understanding is - if Coq's logic is consistent with univalence, it should also be consistent with the negation of univalence. While I get that the negation of univalence would really be that some isomorphic types are non-equal, I believe it should be possible to express that no isomorphic types (that aren't identical) are equal.
Inequality for type constructors
In effect, I would like Coq to treat types and type constructors as inductive definitions, and do a typical inversion
-style argument to say that my two very clearly different types are not equal.
Can it be done? This would need to be:
- Useable for concrete types i.e. no type variables, and so
- Not necessarily decidable
That strikes me as being weak enough to be consistent.
Context
I have a polymorphic judgement (effectively an inductive type with parameters forall X : Type, x -> Prop
) for which the choice of X
is decided by the constructors of the judgement.
I want to prove that, for all judgements for a certain choice of X
(say X = nat
) some property holds, but if I try to use inversion
, some constructors give me hypotheses like nat = string
(for example). These type equality hypotheses appear even for types with the same cardinality, so I can't (and don't want to) make cardinality arguments to produce a contradiction.
The unthinkable...
Should I produce an Inductive
closed-world encoding of the types I care about, and let that be the polymorphic variable of the above judgement?