1
(* Check that Burali-Forti paradox does not go through *)
3
(* Source: contrib/Rocq/PARADOX/{Logics,BuraliForti},v *)
5
(* Some properties about relations on objects in Type *)
7
Inductive ACC (A : Type) (R : A -> A -> Prop) : A -> Prop :=
9
forall x : A, (forall y : A, R y x -> ACC A R y) -> ACC A R x.
11
Lemma ACC_nonreflexive :
12
forall (A : Type) (R : A -> A -> Prop) (x : A),
13
ACC A R x -> R x x -> False.
14
simple induction 1; intros.
18
Definition WF (A : Type) (R : A -> A -> Prop) := forall x : A, ACC A R x.
21
Section Inverse_Image.
23
Variables (A B : Type) (R : B -> B -> Prop) (f : A -> B).
25
Definition Rof (x y : A) : Prop := R (f x) (f y).
28
forall y : B, ACC B R y -> forall x : A, y = f x -> ACC A Rof x.
29
simple induction 1; intros.
31
apply (H1 (f y0)); trivial.
32
elim H2 using eq_ind_r; trivial.
35
Lemma ACC_inverse_image : forall x : A, ACC B R (f x) -> ACC A Rof x.
36
intros; apply (ACC_lemma (f x)); trivial.
39
Lemma WF_inverse_image : WF B R -> WF A Rof.
40
red in |- *; intros; apply ACC_inverse_image; auto.
46
(* Remark: the paradox is written in Type, but also works in Prop or Set. *)
48
Section Burali_Forti_Paradox.
50
Definition morphism (A : Type) (R : A -> A -> Prop)
51
(B : Type) (S : B -> B -> Prop) (f : A -> B) :=
52
forall x y : A, R x y -> S (f x) (f y).
54
(* The hypothesis of the paradox:
55
assumes there exists an universal system of notations, i.e:
57
- An injection i0 from relations on any type into A0
58
- The proof that i0 is injective modulo morphism
60
Variable A0 : Type. (* Type_i *)
61
Variable i0 : forall X : Type, (X -> X -> Prop) -> A0. (* X: Type_j *)
64
forall (X1 : Type) (R1 : X1 -> X1 -> Prop) (X2 : Type)
65
(R2 : X2 -> X2 -> Prop),
66
i0 X1 R1 = i0 X2 R2 -> exists f : X1 -> X2, morphism X1 R1 X2 R2 f.
68
(* Embedding of x in y: x and y are images of 2 well founded relations
69
R1 and R2, the ordinal of R2 being strictly greater than that of R1.
71
Record emb (x y : A0) : Prop :=
73
R1 : X1 -> X1 -> Prop;
76
R2 : X2 -> X2 -> Prop;
80
fmorph : morphism X1 R1 X2 R2 f;
82
majf : forall z : X1, R2 (f z) maj}.
85
Lemma emb_trans : forall x y z : A0, emb x y -> emb y z -> emb x z.
89
generalize eqx0; clear eqx0.
90
elim eqy using eq_ind_r; intro.
91
case (inj _ _ _ _ eqx0); intros.
92
exists X1 R1 X3 R3 (fun x : X1 => f0 (x0 (f x))) maj0; trivial.
98
forall (X : Type) (R : X -> X -> Prop) (x : X),
100
forall (Y : Type) (S : Y -> Y -> Prop) (f : Y -> X),
101
morphism Y S X R f -> (forall y : Y, R (f y) x) -> ACC A0 emb (i0 Y S).
102
simple induction 1; intros.
105
elim eqx using eq_ind_r.
106
case (inj X2 R2 Y S).
107
apply sym_eq; assumption.
110
apply H1 with (y := f (x1 maj)) (f := fun x : X1 => f (x1 (f0 x)));
111
try red in |- *; auto.
114
(* The embedding relation is well founded *)
115
Lemma WF_emb : WF A0 emb.
118
elim eqx using eq_ind_r.
119
apply ACC_emb with (X := X2) (R := R2) (x := maj) (f := f); trivial.
123
(* The following definition enforces Type_j >= Type_i *)
124
Definition Omega : A0 := i0 A0 emb.
131
(* We define the type of elements of A0 smaller than a w.r.t embedding.
132
The Record is in Type, but it is possible to avoid such structure. *)
133
Record sub : Type := {witness : A0; emb_wit : emb witness a}.
135
(* F is its image through i0 *)
136
Definition F : A0 := i0 sub (Rof _ _ emb witness).
138
(* F is embedded in Omega:
139
- the witness projection is a morphism
140
- a is an upper bound because emb_wit proves that witness is
143
Lemma F_emb_Omega : emb F Omega.
144
exists sub (Rof _ _ emb witness) A0 emb witness a; trivial.
147
red in |- *; trivial.
155
Definition fsub (a b : A0) (H : emb a b) (x : sub a) :
156
sub b := Build_sub _ (witness _ x) (emb_trans _ _ _ (emb_wit _ x) H).
158
(* F is a morphism: a < b => F(a) < F(b)
159
- the morphism from F(a) to F(b) is fsub above
160
- the upper bound is a, which is in F(b) since a < b
162
Lemma F_morphism : morphism A0 emb A0 emb F.
166
(Rof _ _ emb (witness x))
168
(Rof _ _ emb (witness y))
170
(Build_sub _ x H); trivial.
171
apply WF_inverse_image.
174
unfold morphism, Rof, fsub in |- *; simpl in |- *; intros.
177
unfold Rof, fsub in |- *; simpl in |- *; intros.
182
(* Omega is embedded in itself:
184
- Omega is an upper bound of the image of F
186
Lemma Omega_refl : emb Omega Omega.
187
exists A0 emb A0 emb F Omega; trivial.
195
(* The paradox is that Omega cannot be embedded in itself, since
196
the embedding relation is well founded.
198
Theorem Burali_Forti : False.
199
apply ACC_nonreflexive with A0 emb Omega.
206
End Burali_Forti_Paradox.
209
(* The following type seems to satisfy the hypothesis of the paradox.
212
Record A0 : Type := (* Type_i' *)
213
i0 {X0 : Type; R0 : X0 -> X0 -> Prop}. (* X0: Type_j' *)
216
(* Note: this proof uses a large elimination of A0. *)
218
forall (X1 : Type) (R1 : X1 -> X1 -> Prop) (X2 : Type)
219
(R2 : X2 -> X2 -> Prop),
220
i0 X1 R1 = i0 X2 R2 -> exists f : X1 -> X2, morphism X1 R1 X2 R2 f.
223
match i0 X1 R1, i0 X2 R2 with
224
| i0 x1 r1, i0 x2 r2 => exists f : _, morphism x1 r1 x2 r2 f
226
case H; simpl in |- *.
227
exists (fun x : X1 => x).
228
red in |- *; trivial.
231
(* The following command raises 'Error: Universe Inconsistency'.
232
To allow large elimination of A0, i0 must not be a large constructor.
233
Hence, the constraint Type_j' < Type_i' is added, which is incompatible
234
with the constraint j >= i in the paradox.
237
Definition Paradox : False := Burali_Forti A0 i0 inj.