Category "type-theory"

Proof by contradiction in Coq

I am trying to understand the apparent paradox of the logical framework of theorem provers like Coq not including LEM yet also being able to construct proofs by

What exactly is a Set in Coq

I'm still puzzled what the sort Set means in Coq. When do I use Set and when do I use Type? In Hott a Set is defined as a type, where identity proofs are unique