Debian Codegraph @

test-suite/bugs/bug_19833.v

raw
1 Class hasPt (T : Type) := Pt { pt_ : T }.
2 Structure ptType := Pointed {
3 sort :> Type;
4 class : hasPt sort
5 }.
6
7 Definition pt (T : ptType) := @pt_ T (class T).
8
9 Canonical nat_ptType := Pointed nat (Pt nat 0).
10 Canonical forall_ptType (T : Type) (U : T -> ptType) :=
11 Pointed (forall t, U t) (Pt (forall t, U t) (fun t => pt (U t))).
12
13 Definition constant {T U : Type} (f : T -> U) := forall (x y : T), f x = f y.
14 Definition cst (T U : Type) (y : U) := fun _ : T => y.
15 Lemma constant_cst (T U : Type) (y : U) : constant (cst T U y).
16 Proof. intros x x'; reflexivity. Qed.
17
18 Goal forall {T : Type} {U : ptType}, constant (pt (T -> U)).
19 Proof.
20 intros.
21 exact (constant_cst _ _ _).
22 Qed.