Contact/support | Changelog

Burali-Forti paradox

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
{-# OPTIONS --type-in-type --without-K #-}
module burali where

Prop' = Set

power : Set  Set
power X = X  Prop'

 : (A : Set)  (A  Prop')  Prop'
 A B = {X : Prop'}  ((a : A)  B a  X)  X

_,_ : {A : Set}{B : A  Prop'}
     (a : A)  B a   A B
_,_ a b {X} f = f a b
infixr 4 _,_

__ : {A : Set}  A  A  Prop'
__ {A} x y = (P : A  Prop')  P x  P y

refl : {A : Set}{x : A}  x  x
refl P u = u

¬_ : Prop'  Prop'
¬ A = {X : Prop'}  A  X

__ : Prop'  Prop'  Prop'
A  B =  A (λ _  B)

image : {A B : Set}  (A  B)  power A  power B
image {A}{B} f V b =  A λ a  (V a)  (f a  b)

U : Set
U = (X : Set)  (power X  X)  power X

τ : power U  U
τ V X r = image (λ k  r (k X r)) V

σ : U  power U
σ k = k U τ

_<_ : U  U  Set
x < y = σ y x

ind : power U  Prop'
ind V = (x : U)  ((y : U)  y < x  V y)  V x

dec : U  Prop'
dec x = {V : power U}  ind V  V x

Ω : U
Ω = τ dec

absurd : (A : Prop')  A
absurd = Ω-dec Z-ind (Ω , λ {X} f  f Ω-dec refl)
  where
    pre-ind : {X : power U}  ind X
             ind (λ x  X (τ (σ x)))
    pre-ind {X} i x h = i (τ (σ x)) λ y p
       p λ z l-eq
       l-eq λ l eq
       eq X (h z l)

    Ω-dec : dec Ω
    Ω-dec {X} i = i Ω λ x p
       p λ w d-eq
       d-eq λ d eq
       eq X (d (pre-ind i))

    Z : power U
    Z y = ¬ (τ (σ y) < y)

    Z-ind : ind Z
    Z-ind x h n = h (τ (σ x)) n
      (τ (σ x) , λ {X} f  f n refl)