Skip to content

Commit 30a83f0

Browse files
CohenCyrilaffeldt-aistCécile MarconQuentin Vermande
committed
Experimenting with a generic sup interface
Co-Authored-By: Reynald Affeldt <reynald.affeldt@aist.go.jp> Co-Authored-By: Cécile Marcon <cecile.marcon@inria.fr> Co-Authored-By: Quentin Vermande <quentin.vermande@inria.fr>
1 parent 4d9168b commit 30a83f0

File tree

1 file changed

+66
-0
lines changed

1 file changed

+66
-0
lines changed

classical/sup.v

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
From HB Require Import structures.
2+
From mathcomp Require Import all_ssreflect.
3+
4+
5+
Set Implicit Arguments.
6+
Unset Strict Implicit.
7+
Unset Printing Implicit Defensive.
8+
9+
Import Order.TTheory.
10+
Local Open Scope order_scope.
11+
12+
About family.
13+
14+
From mathcomp Require Import classical_sets boolp.
15+
16+
Record universe := Universe {universe_sort :> Type; El : universe_sort -> Type}.
17+
(* Definition universe_universe := @Universe universe universe_sort. *)
18+
19+
Definition family (U : universe) X := {I : U & {P : set (El I) & El I -> X}}.
20+
21+
Definition finfamily := @family (@Universe finType (id : finType -> Type)).
22+
Definition seqfamily := @family (@Universe {A : eqType & seq A} (fun X => {x | x \in projT2 X})).
23+
(* Definition seqfamily_ (I : eqType) := @family (seq I) (fun s => {x | x \in s}). *)
24+
25+
HB.mixin Record isSup d (T : porderType d) (pT : predType T)
26+
(Q : set pT) (sup : pT -> T) := {
27+
supP : forall (A : Q) (y : T),
28+
reflect (forall x : T, x \in val A -> x <= y) (sup (val A) <= y)
29+
}.
30+
HB.structure Definition Sup d T pT Q := {sup of @isSup d T pT Q sup}.
31+
32+
(* HB.mixin Record isSupFam d (I : porderType d) T Q (sup : set I -> (I -> T) -> T) := { *)
33+
(* supP : F (y : T), *)
34+
(* reflect (forall x : T, x \in val A -> x <= y) (sup (val A) <= y) *)
35+
(* }. *)
36+
(* HB.structure Definition Sup d T pT Q := {sup of @isSup d T pT Q sup}. *)
37+
38+
39+
HB.mixin Record isLeftAdjoint d d' (C : porderType d') (D : porderType d)
40+
(R : D -> C) (L : C -> D) := {
41+
LeftP : forall A y, (L A <= y) = (A <= R y)
42+
}.
43+
HB.structure Definition LeftAdjoint d d' T U R :=
44+
{L of @isLeftAdjoint d d' T U R L}.
45+
46+
From mathcomp Require Import classical_sets boolp reals constructive_ereal ereal.
47+
Local Open Scope classical_set_scope.
48+
Section RealSup.
49+
Variable (R : realType).
50+
51+
Lemma sup_isSup : @isSup _ R (set R) (@has_ubound _ R `&` nonempty) sup.
52+
Proof.
53+
split=> -[/= A /[!inE]/= -[Abnd AN0]] y; apply: (iffP idP).
54+
move=> supA_le_y x xA; rewrite (le_trans _ supA_le_y)//.
55+
by apply/ub_le_sup => //=; exact/set_mem.
56+
by move=> ble; apply/ge_sup => // x /mem_set; apply/ble.
57+
Qed.
58+
HB.instance Definition _ := sup_isSup.
59+
60+
Lemma ereal_sup_isSup :
61+
@isSup _ (\bar R) (set (\bar R)) [set: set (\bar R)] (@ereal_sup R).
62+
Proof.
63+
split=> -[/= A _] y; apply: (equivP ereal_supP).
64+
by split=> [Ay x /set_mem|Ay x /mem_set]; apply: Ay.
65+
Qed.
66+
HB.instance Definition _ := ereal_sup_isSup.

0 commit comments

Comments
 (0)