Coq: Prop versus Set in Type(n)

后端 未结 2 1422
南方客
南方客 2021-02-14 04:56

I want to consider the following three (related?) Coq definitions.

Inductive nat1: Prop :=
  | z1 : nat1
  | s1 : nat1 -> nat1.

Inductive nat2 : Set := 
  |          


        
2条回答
  •  鱼传尺愫
    2021-02-14 05:27

    Type : Type is inconsistent.

    Impredicative Set with excluded middle implies proof irrelevance, so impredicative Set with proof relevance, e.g. true <> false, refutes excluded middle, which intuitionism isn't supposed to do.

    Therefore we leave impredicativity in Prop and the rest of the type hierarchy gives us predicativity.

    By the way,

    forall P : nat1 -> Prop, P z1 -> (forall n : nat1, P n -> P (s1 n)) -> forall n : nat1, P n
    

    is provable. Don't ask me what's the benefit of Coq only automatically proving that other weaker induction principle...

    Also, have you read this chapter of CPDT?

提交回复
热议问题