Debian Codegraph @

test-suite/bugs/bug_8785.v

raw
1 Universe u v w.
2 Inductive invertible {X:Type@{u}} {Y:Type} (f:X->Y) : Prop := .
3
4 Inductive FiniteT : Type -> Prop :=
5 | add_finite: forall T:Type@{v}, FiniteT T -> FiniteT (option T)
6 | bij_finite: forall (X:Type@{w}) (Y:Type) (f:X->Y), FiniteT X ->
7 invertible f -> FiniteT Y.
8
9 Set Printing Universes.
10
11 Axiom a : False.
12 (*
13 Constraint v <= u.
14 Constraint v <= w.
15 *)
16 Lemma finite_subtype: forall (X:Type) (P:X->Prop),
17 FiniteT X -> (forall x:X, P x \/ ~ P x) ->
18 FiniteT {x:X | P x}.
19 Proof.
20 intros.
21 induction H.
22
23 destruct (H0 None).
24 elim a.
25
26 pose (g := fun (x:{x:T | P (Some x)}) =>
27 match x return {x:option T | P x} with
28 | exist _ x0 i => exist (fun x:option T => P x) (Some x0) i
29 end).
30 apply bij_finite with _ g.
31 apply IHFiniteT.
32 intro; apply H0.
33 elim a.
34
35 pose (g := fun (x:{x:X | P (f x)}) =>
36 match x with
37 | exist _ x0 i => exist (fun x:Y => P x) (f x0) i
38 end).
39 apply bij_finite with _ g.
40 apply IHFiniteT.
41 intro; apply H0.
42 elim a.
43
44 Qed.