Negation

module foundation.negation where
Imports
open import foundation-core.negation public

open import foundation-core.dependent-pair-types
open import foundation-core.empty-types
open import foundation-core.equivalences
open import foundation-core.logical-equivalences
open import foundation-core.propositions
open import foundation-core.universe-levels

Idea

The Curry-Howard interpretation of negation in type theory is the interpretation of the proposition P ⇒ ⊥ using propositions as types. Thus, the negation of a type A is the type A → empty.

Properties

The negation of a type is a proposition

is-prop-neg : {l : Level} {A : UU l}  is-prop (¬ A)
is-prop-neg {A = A} = is-prop-function-type is-prop-empty

neg-Prop' : {l1 : Level}  UU l1  Prop l1
pr1 (neg-Prop' A) = ¬ A
pr2 (neg-Prop' A) = is-prop-neg

neg-Prop : {l1 : Level}  Prop l1  Prop l1
neg-Prop P = neg-Prop' (type-Prop P)

Reductio ad absurdum

reductio-ad-absurdum : {l1 l2 : Level} {P : UU l1} {Q : UU l2}  P  ¬ P  Q
reductio-ad-absurdum p np = ex-falso (np p)

Equivalent types have equivalent negations

equiv-neg :
  {l1 l2 : Level} {X : UU l1} {Y : UU l2} 
  (X  Y)  (¬ X  ¬ Y)
equiv-neg {l1} {l2} {X} {Y} e =
  equiv-iff'
    ( neg-Prop' X)
    ( neg-Prop' Y)
    ( pair (map-neg (map-inv-equiv e)) (map-neg (map-equiv e)))

Negation has no fixed points

no-fixed-points-neg :
  {l : Level} (A : UU l)  ¬ (A  (¬ A))
no-fixed-points-neg A (pair f g) =
  ( λ (h : ¬ A)  h (g h))  (a : A)  f a a)
abstract
  no-fixed-points-neg-Prop :
    {l1 : Level} (P : Prop l1)  ¬ (P  neg-Prop P)
  no-fixed-points-neg-Prop P = no-fixed-points-neg (type-Prop P)