Skip to content

Commit fb543b2

Browse files
affeldt-aistmkerjean
authored andcommitted
uncomment and make compile
1 parent 8cce383 commit fb543b2

6 files changed

Lines changed: 89 additions & 106 deletions

File tree

CHANGELOG_UNRELEASED.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,17 @@
44

55
### Added
66

7+
- in `functions.v`:
8+
+ mixin ...
9+
10+
- in `tvs.v`:
11+
+ ...
12+
713
### Changed
814

15+
- moved from `topology_structure.v` to `filter.v`:
16+
+ lemma `continuous_comp` (and generalized)
17+
918
### Renamed
1019

1120
- in `tvs.v`:

classical/classical_sets.v

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2463,6 +2463,17 @@ HB.instance Definition _ m n (T : pointedType) :=
24632463
HB.instance Definition _ (T : choiceType) := isPointed.Build (option T) None.
24642464
HB.instance Definition _ (T : choiceType) := isPointed.Build {fset T} fset0.
24652465

2466+
HB.instance Definition _ {R : numDomainType} (E F : lmodType R) :=
2467+
isPointed.Build {linear E -> F} (Algebra.null_fun _).
2468+
2469+
(*Section coucou.
2470+
Context {R : numDomainType} (E F : lmodType R).
2471+
2472+
Check (point : {linear E -> F}%R).*)
2473+
2474+
2475+
2476+
24662477
Notation get := (xget point).
24672478
Notation "[ 'get' x | E ]" := (get [set x | E])
24682479
(at level 0, x name, format "[ 'get' x | E ]", only printing) : form_scope.

classical/filter.v

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -946,6 +946,11 @@ Definition continuous_at (T U : nbhsType) (x : T) (f : T -> U) :=
946946
(f%function @ x --> f%function x).
947947
Notation continuous f := (forall x, continuous_at x f).
948948

949+
Lemma continuous_comp (R S T : nbhsType) (f : R -> S) (g : S -> T) x :
950+
{for x, continuous f} -> {for (f x), continuous g} ->
951+
{for x, continuous (g \o f)}.
952+
Proof. exact: cvg_comp. Qed.
953+
949954
Lemma near_fun (T T' : nbhsType) (f : T -> T') (x : T) (P : T' -> Prop) :
950955
{for x, continuous f} ->
951956
(\forall y \near f x, P y) -> (\near x, P (f x)).

classical/functions.v

Lines changed: 22 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -2757,17 +2757,15 @@ End function_space_lemmas.
27572757
Lemma inv_funK T (R : unitRingType) (f : T -> R) : (f\^-1\^-1)%R = f.
27582758
Proof. by apply/funeqP => x; rewrite /inv_fun/= GRing.invrK. Qed.
27592759

2760-
(* TODO : correct - choicetype on {linear _ -> _} is no longer seen, cf bug in
2761-
derive.v when uncommenting *)
2762-
2763-
(*
27642760
Local Open Scope ring_scope.
27652761
Import GRing.Theory.
27662762

27672763
Section linfun_pred.
2768-
(* Beware that lfun is reserved for vector types, hence this one has been
2769-
renamed linfun *)
2770-
Context {K : numDomainType} {E : lmodType K} {F : lmodType K} {s : K -> F -> F}.
2764+
Context {K : numDomainType} {E : lmodType K} {F : lmodType K}
2765+
{s : K -> F -> F}.
2766+
2767+
(**md Beware that `lfun` is reserved for vector types, hence this one has been
2768+
named `linfun` *)
27712769
Definition linfun : {pred E -> F} := mem [set f | linear_for s f ].
27722770
Definition linfun_key : pred_key linfun. Proof. exact. Qed.
27732771
Canonical linfun_keyed := KeyedPred linfun_key.
@@ -2795,14 +2793,12 @@ Lemma linfun_rect (K : T -> Type) :
27952793
Proof.
27962794
move=> Ksub [f] [[[Pf1 Pf2]] [Pf3]].
27972795
set G := (G in K G).
2798-
have Pf : f \in linfun.
2799-
by rewrite inE /= => // x u y; rewrite Pf2 Pf3.
2796+
have Pf : f \in linfun by rewrite inE /= => // x u y; rewrite Pf2 Pf3.
28002797
suff -> : G = linfun_Sub Pf by apply: Ksub.
28012798
rewrite {}/G.
2802-
congr GRing.Linear.Pack.
2803-
congr GRing.Linear.Class.
2804-
- by congr GRing.isNmodMorphism.Axioms_; apply: Prop_irrelevance.
2805-
- by congr GRing.isScalable.Axioms_; apply: Prop_irrelevance.
2799+
congr (GRing.Linear.Pack (GRing.Linear.Class _ _)).
2800+
- by congr GRing.isNmodMorphism.Axioms_; exact: Prop_irrelevance.
2801+
- by congr GRing.isScalable.Axioms_; exact: Prop_irrelevance.
28062802
Qed.
28072803

28082804
Lemma linfun_valP f (Pf : f \in linfun) : linfun_Sub Pf = f :> (_ -> _).
@@ -2818,52 +2814,35 @@ HB.instance Definition _ := [Choice of {linear E -> F | s} by <:].
28182814
Variant linfun_spec (f : E -> F) : (E -> F) -> bool -> Type :=
28192815
| Islinfun (l : {linear E -> F | s}) : linfun_spec f l true.
28202816

2821-
(*to be renamed ?*)
2822-
Lemma linfunE (f : E -> F) : (f \in linfun) -> linfun_spec f f (f \in linfun).
2817+
Lemma linfunP (f : E -> F) : f \in linfun -> linfun_spec f f (f \in linfun).
28232818
Proof.
28242819
move=> /[dup] f_lc ->.
2825-
have {2}-> :(f = (linfun_Sub f_lc)) by rewrite linfun_valP.
2826-
constructor.
2820+
have {2}-> : f = linfun_Sub f_lc by rewrite linfun_valP.
2821+
by constructor.
28272822
Qed.
28282823

28292824
End linfun.
28302825

2831-
Section linfun_comp.
2832-
2833-
Context {R : numDomainType} {E F : lmodType R}
2834-
{S : lmodType R} {s : GRing.Scale.law R S}
2835-
(f : {linear E -> F}) (g : {linear F -> S | s}).
2836-
2837-
Lemma linfun_comp_subproof : linear_for s (g \o f).
2838-
Proof. by move=> *; move=> */=; rewrite !linearP. Qed.
2839-
2840-
HB.instance Definition _ := @GRing.isLinear.Build R E S s (g \o f)
2841-
linfun_comp_subproof.
2842-
(* HB warning : no new instance generated but before we have
2843-
Fail Check ( (g \o f) : {linear E -> F | s}). ? *)
2844-
2845-
End linfun_comp.
2846-
28472826
Section linfun_lmodtype.
2848-
Context {R : numFieldType} {E F G: lmodType R}.
2849-
2850-
Implicit Types (r : R) (f g : {linear E -> F}) (h : {linear F -> G}).
2827+
Context {R : numFieldType} {E F : lmodType R}.
28512828

28522829
Import GRing.Theory.
28532830

2854-
Lemma linfun0 : (\0 : {linear E -> F}) =1 cst 0 :> (_ -> _). Proof. by []. Qed.
2855-
28562831
Lemma linfun_submod_closed : submod_closed (@linfun R E F *:%R).
28572832
Proof.
2858-
split; first by rewrite inE; apply/linearP.
2859-
move=> r /= _ _ /linfunE[f] /linfunE[g].
2833+
split; first by rewrite inE; exact/linearP.
2834+
move=> r /= _ _ /linfunP[f] /linfunP[g].
28602835
by rewrite inE /=; exact: linearP.
2861-
Qed.
2862-
2836+
Qed.
2837+
28632838
HB.instance Definition _ :=
28642839
@GRing.isSubmodClosed.Build _ _ linfun linfun_submod_closed.
28652840

28662841
HB.instance Definition _ :=
28672842
[SubChoice_isSubLmodule of {linear E -> F } by <:].
28682843

2869-
End linfun_lmodtype.*)
2844+
End linfun_lmodtype.
2845+
2846+
(* TODO: we wanted to declare this instance in classical_sets.v but failed and did not understand why, also we couldn't generaliz *)
2847+
HB.instance Definition _ {R : numDomainType} (E F : lmodType R) :=
2848+
isPointed.Build {linear E -> F} (\0)%R.

theories/normedtype_theory/tvs.v

Lines changed: 42 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(* mathcomp analysis (c) 2017 Inria and AIST. License: CeCILL-C. *)
1+
(* mathcomp analysis (c) 2017 Inria and AIST. License: CeCILL-C. *)
22
From HB Require Import structures.
33
From mathcomp Require Import all_ssreflect_compat ssralg ssrnum vector.
44
From mathcomp Require Import interval_inference.
@@ -640,7 +640,7 @@ Notation "{ 'linear_continuous' U -> V | s }" := (@LinearContinuous.type _ U%typ
640640
: type_scope.
641641
Notation "{ 'linear_continuous' U -> V }" := {linear_continuous U%type -> V%type | *:%R}
642642
: type_scope.
643-
643+
644644
Section lcfun.
645645
Context {R : numDomainType} {E : NbhsLmodule.type R}
646646
{F : NbhsZmodule.type} {s : GRing.Scale.law R F}.
@@ -649,7 +649,7 @@ Notation lcfun := (@lcfun _ E F s).
649649

650650
Section Sub.
651651
Context (f : E -> F) (fP : f \in lcfun).
652-
652+
653653
Definition lcfun_Sub_subproof :=
654654
@isLinearContinuous.Build _ E F s f (proj1 (set_mem fP)) (proj2 (set_mem fP)).
655655
#[local] HB.instance Definition _ := lcfun_Sub_subproof.
@@ -665,11 +665,10 @@ have Pf : f \in lcfun.
665665
by rewrite inE /=; split => // x u v; rewrite Pf1 Pf2.
666666
suff -> : G = lcfun_Sub Pf by apply: Ksub.
667667
rewrite {}/G.
668-
congr LinearContinuous.Pack.
669-
congr LinearContinuous.Class.
670-
- by congr GRing.isNmodMorphism.Axioms_; apply: Prop_irrelevance.
671-
- by congr GRing.isScalable.Axioms_; apply: Prop_irrelevance.
672-
- by congr isContinuous.Axioms_; apply: Prop_irrelevance.
668+
congr (LinearContinuous.Pack (LinearContinuous.Class _ _ _)).
669+
- by congr GRing.isNmodMorphism.Axioms_; exact: Prop_irrelevance.
670+
- by congr GRing.isScalable.Axioms_; exact: Prop_irrelevance.
671+
- by congr isContinuous.Axioms_; exact: Prop_irrelevance.
673672
Qed.
674673

675674
Lemma lcfun_valP f (Pf : f \in lcfun) : lcfun_Sub Pf = f :> (_ -> _).
@@ -685,12 +684,11 @@ HB.instance Definition _ := [Choice of {linear_continuous E -> F | s} by <:].
685684
Variant lcfun_spec (f : E -> F) : (E -> F) -> bool -> Type :=
686685
| Islcfun (l : {linear_continuous E -> F | s}) : lcfun_spec f l true.
687686

688-
(*to be renamed ?*)
689-
Lemma lcfunE (f : E -> F) : (f \in lcfun) -> lcfun_spec f f (f \in lcfun).
687+
Lemma lcfunP (f : E -> F) : f \in lcfun -> lcfun_spec f f (f \in lcfun).
690688
Proof.
691689
move=> /[dup] f_lc ->.
692-
have {2}-> :(f = (lcfun_Sub f_lc)) by rewrite lcfun_valP.
693-
constructor.
690+
have {2}-> : f = lcfun_Sub f_lc by rewrite lcfun_valP.
691+
by constructor.
694692
Qed.
695693

696694
End lcfun.
@@ -701,22 +699,20 @@ Context {R : numDomainType} {E F : NbhsLmodule.type R}
701699
{S : NbhsZmodule.type} {s : GRing.Scale.law R S}
702700
(f : {linear_continuous E -> F}) (g : {linear_continuous F -> S | s}).
703701

704-
Lemma lcfun_comp_subproof1 : linear_for s (g \o f).
705-
Proof. by move=> *; move=> */=; rewrite !linearP. Qed.
702+
Let lcfun_comp_subproof1 : linear_for s (g \o f).
703+
Proof. by move=> *; move=> *; rewrite !linearP. Qed.
706704

707-
(* TODO weaken proof continuous_comp to arbitrary nbhsType *)
708-
Lemma lcfun_comp_subproof2 : continuous (g \o f).
709-
Proof. by move=> x; move=> A /cts_fun /cts_fun. Qed.
705+
Let lcfun_comp_subproof2 : continuous (g \o f).
706+
Proof. by move=> x; apply: continuous_comp; exact/cts_fun. Qed.
710707

711708
HB.instance Definition _ := @isLinearContinuous.Build R E S s (g \o f)
712709
lcfun_comp_subproof1 lcfun_comp_subproof2.
713710

714711
End lcfun_comp.
715712

716713
Section lcfun_lmodtype.
717-
Context {R : numFieldType} {E F G: convexTvsType R}.
718-
719-
Implicit Types (r : R) (f g : {linear_continuous E -> F}) (h : {linear_continuous F -> G}).
714+
Context {R : numFieldType} {E F : convexTvsType R}.
715+
Implicit Types (r : R) (f g : {linear_continuous E -> F}).
720716

721717
Import GRing.Theory.
722718

@@ -727,57 +723,56 @@ Qed.
727723

728724
HB.instance Definition _ := isContinuous.Build E F \0 null_fun_continuous.
729725

730-
Lemma lcfun0 : (\0 : {linear_continuous E -> F}) =1 cst 0 :> (_ -> _).
731-
Proof. by []. Qed.
732-
733-
(* NB : cvgD in pseudometric_normedZmodule should be lowered to some common
734-
structure to tvstype and pseudometric, then lcfun doesn't need to exist
735-
anymore *)
726+
(** NB : cvgD in pseudometric_normedZmodule could be lowered to some common
727+
structure to convexTvsType and pseudometric, then `lcfun_cvgD` doesn't need to
728+
exist anymore (we are however not sure that this deserves the introduction of
729+
a new structure that combines nbhs and normedZmodule) *)
736730
Lemma lcfun_cvgD (U : set_system E) {FF : Filter U} f g a b :
737731
f @ U --> a -> g @ U --> b -> (f \+ g) @ U --> a + b.
738732
Proof.
739733
move=> fa ga.
740-
apply: continuous2_cvg; [|by []..].
741-
apply @add_continuous. (* TODO: why the @ ? *)
734+
by apply: continuous2_cvg; [exact: (add_continuous (a, b))|by []..].
742735
Qed.
743736

744737
Lemma lcfun_continuousD f g : continuous (f \+ g).
745-
Proof. move=> /= x; apply: lcfun_cvgD; apply: cts_fun. Qed.
746-
738+
Proof. by move=> /= x; apply: lcfun_cvgD; exact: cts_fun. Qed.
747739

748-
Lemma lcfun_cvgN (U : set_system E) {FF : Filter U} f a : f @ U --> a -> \- f @ U --> - a.
740+
Lemma lcfun_cvgN (U : set_system E) {FF : Filter U} f a :
741+
f @ U --> a -> \- f @ U --> - a.
749742
Proof. by move=> ?; apply: continuous_cvg => //; exact: opp_continuous. Qed.
750743

751-
752744
Lemma lcfun_continuousN f : continuous (\- f).
753-
Proof.
754-
by move=> /= x; apply: lcfun_cvgN; apply: cts_fun.
755-
Qed.
745+
Proof. by move=> /= x; apply: lcfun_cvgN; exact: cts_fun. Qed.
756746

757-
HB.instance Definition _ f g := isContinuous.Build E F (f \+ g) (@lcfun_continuousD f g).
747+
HB.instance Definition _ f g :=
748+
isContinuous.Build E F (f \+ g) (@lcfun_continuousD f g).
758749

759-
Lemma lcfun_cvgZ (U : set_system E) {FF : Filter U} l f r a : l @ U --> r -> f @ U --> a ->
760-
l x *: f x @[x --> U] --> r *: a.
750+
Lemma lcfun_cvgZ (U : set_system E) {FF : Filter U} l f r a :
751+
l @ U --> r -> f @ U --> a ->
752+
l x *: f x @[x --> U] --> r *: a.
761753
Proof.
762-
move=> ? ?; apply: continuous2_cvg => //; exact: (scale_continuous (_, _)).
754+
by move=> *; apply: continuous2_cvg => //; exact: (scale_continuous (_, _)).
763755
Qed.
764756

765-
Lemma lcfun_cvgZr (U : set_system E) {FF : Filter U} k f a : f @ U --> a -> k \*: f @ U --> k *: a.
766-
Proof. apply: lcfun_cvgZ => //; exact: cvg_cst. Qed.
757+
Lemma lcfun_cvgZr (U : set_system E) {FF : Filter U} k f a :
758+
f @ U --> a -> k \*: f @ U --> k *: a.
759+
Proof. by apply: lcfun_cvgZ => //; exact: cvg_cst. Qed.
767760

768761
Lemma lcfun_continuousM r g : continuous (r \*: g).
769-
Proof. by move=> /= x; apply: lcfun_cvgZr; apply: cts_fun. Qed.
762+
Proof. by move=> /= x; apply: lcfun_cvgZr; exact: cts_fun. Qed.
770763

771-
HB.instance Definition _ r g := isContinuous.Build E F (r \*: g) (@lcfun_continuousM r g).
764+
HB.instance Definition _ r g :=
765+
isContinuous.Build E F (r \*: g) (@lcfun_continuousM r g).
772766

773-
Lemma lcfun_submod_closed : submod_closed (@lcfun R E F *:%R).
767+
Lemma lcfun_submod_closed : submod_closed (@lcfun R E F *:%R).
774768
Proof.
775-
split; first by rewrite inE; split; first apply/linearP; apply: cst_continuous.
776-
move=> r /= _ _ /lcfunE[f] /lcfunE[g].
769+
split; first by rewrite inE; split; first apply/linearP; exact: cst_continuous.
770+
move=> r /= _ _ /lcfunP[f] /lcfunP[g].
777771
by rewrite inE /=; split; [exact: linearP | exact: lcfun_continuousD].
778772
Qed.
779773

780-
HB.instance Definition _ f := isContinuous.Build E F (\- f) (@lcfun_continuousN f).
774+
HB.instance Definition _ f :=
775+
isContinuous.Build E F (\- f) (@lcfun_continuousN f).
781776

782777
HB.instance Definition _ :=
783778
@GRing.isSubmodClosed.Build _ _ lcfun lcfun_submod_closed.
@@ -786,14 +781,3 @@ HB.instance Definition _ :=
786781
[SubChoice_isSubLmodule of {linear_continuous E -> F } by <:].
787782

788783
End lcfun_lmodtype.
789-
790-
791-
Section Substructures.
792-
Context (R: numFieldType) (V : convexTvsType R).
793-
Variable (A : pred V).
794-
795-
HB.instance Definition _ := ConvexTvs.on (subspace A).
796-
797-
Check {linear_continuous (subspace A) -> R^o}.
798-
799-
End Substructures.

theories/topology_theory/topology_structure.v

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -260,11 +260,6 @@ move=> s A; rewrite nbhs_simpl /= !nbhsE => - [B [Bop Bfs] sBA].
260260
by exists (f @^-1` B); [split=> //; apply/fcont|move=> ? /sBA].
261261
Qed.
262262

263-
Lemma continuous_comp (R S T : topologicalType) (f : R -> S) (g : S -> T) x :
264-
{for x, continuous f} -> {for (f x), continuous g} ->
265-
{for x, continuous (g \o f)}.
266-
Proof. exact: cvg_comp. Qed.
267-
268263
Lemma open_comp {T U : topologicalType} (f : T -> U) (D : set U) :
269264
{in f @^-1` D, continuous f} -> open D -> open (f @^-1` D).
270265
Proof.

0 commit comments

Comments
 (0)