1

Is it possible to implement the Bool type, including its constructors and dependent eliminator:

Bool      : Set
true      : Bool
false     : Bool
bool-elim : ∀ (P : Bool -> Set) -> P true -> P false -> (b : Bool) -> P b

Using only Sigma and dependent functions? I.e., without using native datatypes?

MaiaVictor
  • 51,090
  • 44
  • 144
  • 286
  • Adding a reference because the previous answer didn't have any: "even though induction principles are not provable in CoC, their computational content is already definable in F_omega." (Pfenning, Paulin-Mohring - Inductively Defined Types in the Calculus of Constructions) – gallais Sep 14 '18 at 14:19
  • 1
    @gallais I don't understand how my last question would be equivalent to this one. The first asks whether there is a proof of `(p : CN -> Type) -> (z : p CZ) -> (s : (n : CN) -> p n -> p (CS n)) -> (n : CN) -> p n` for `CN = (t : Type) -> t -> (t -> t) -> t`. This one asks if there is a proof of `∀ (P : Bool -> Set) -> P true -> P false -> (b : Bool) -> P b` for **any** encoding of Bool, true and false. It seems like this one is much weaker because it 1. doesn't involve recursion, 2. doesn't force a specific encoding. If those questions are the same I'd appreciate an explanation of why! – MaiaVictor Sep 14 '18 at 15:16
  • @gallais also, from the "Cosmology of Datatypes" paper, it seems like Sigma + Pi + Enums is sufficient to encode arbitrary inductive types, so, do you confirm that indeed the addition of Enums is what makes it possible? – MaiaVictor Sep 14 '18 at 15:19
  • 1
    No Enums are not enough. In the cosmology of datatypes you can take least fixed point of strictly positive functors and you have an eliminator for such fixed points. This is what gives you the power. – gallais Sep 14 '18 at 15:25
  • 1
    I mean. If you want just Bool then Enums + their eliminator are enough but that's a bit of Lapalissade... – gallais Sep 14 '18 at 15:31
  • @gallais ah, that makes a lot of sense. I'm still early on the paper but I see that's what seems to be done around page 76. So, in short: 1. Sigma alone isn't sufficient to encode any datatype (not even Bool). 2. Sigma + Enum is sufficient to encode any non-recursive datatype (not only enumerations, as that'd be a lapalissade of course!). 3. Sigma + Enum + ability to take the least fixed point of strictly positive functors and you get the equivalent of Agda inductive types. Could you confirm if that is correct? – MaiaVictor Sep 14 '18 at 15:44
  • 1
    Throw in equality and I think we are there. – gallais Sep 14 '18 at 15:55

0 Answers0