Skip to content

Commit 6bc95eb

Browse files
Linear_continuous structure (#1913)
* linfun and lcfun are lmodtypes -- Co-authored-by: Cyril Cohen <cohen@crans.org> Co-authored-by: Reynald Affeldt <reynald.affeldt@aist.go.jp>
1 parent 8c72fe8 commit 6bc95eb

File tree

5 files changed

+393
-29
lines changed

5 files changed

+393
-29
lines changed

CHANGELOG_UNRELEASED.md

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,46 @@
2525
+ definition `preimage_set_system`
2626
+ lemmas `preimage_set_system0`, `preimage_set_systemU`, `preimage_set_system_comp`,
2727
`preimage_set_system_id`
28+
- in `functions.v`:
29+
+ lemmas `linfunP`, `linfun_eqP`
30+
+ instances of `SubLmodule` and `pointedType` on `{linear _->_ | _ }`
31+
32+
- in `tvs.v`:
33+
+ structure `LinearContinuous`
34+
+ factory `isLinearContinuous`
35+
+ instance of `ChoiceType` on `{linear_continuous _ -> _ }`
36+
+ instance of `LinearContinuous` with the composition of two functions of type `LinearContinuous`
37+
+ instance of `LinearContinuous` with the sum of two functions of type `LinearContinuous`
38+
+ instance of `LinearContinuous` with the scalar multiplication of a function of type
39+
`LinearContinuous`
40+
+ instance of `Continuous` on \-f when f is of type `LinearContinuous`
41+
+ instance of `SubModClosed` on `{linear_continuous _ -> _}`
42+
+ instance of `SubLModule` on `{linear_continuous _ -> _ }`
43+
+ instance of `LinearContinuous` on the null function
44+
+ notations `{linear_continuous _ -> _ | _ }` and `{linear_continuous _ -> _ }`
45+
+ definitions `lcfun`, `lcfun_key, `lcfunP`
46+
+ lemmas `lcfun_eqP`, `null_fun_continuous`, `fun_cvgD`,
47+
`fun_cvgN`, `fun_cvgZ`, `fun_cvgZr`
48+
+ lemmas `lcfun_continuous` and `lcfun_linear`
49+
50+
### Changed
51+
52+
- moved from `topology_structure.v` to `filter.v`:
53+
+ lemma `continuous_comp` (and generalized)
2854

2955
### Renamed
3056

3157
- in `tvs.v`:
3258
+ definition `tvsType` -> `convexTvsType`
33-
+ HB class `Tvs` -> `ConvexTvs`
34-
+ HB mixin `Uniform_isTvs` -> `Uniform_isConvexTvs`
35-
+ HB factory `PreTopologicalLmod_isTvs` -> `PreTopologicalLmod_isConvexTvs`
36-
+ Section `Tvs_numDomain` -> `ConvexTvs_numDomain`
37-
+ Section `Tvs_numField` -> `ConvexTvs_numField`
38-
+ Section `prod_Tvs` -> `prod_ConvexTvs`
59+
+ class `Tvs` -> `ConvexTvs`
60+
+ mixin `Uniform_isTvs` -> `Uniform_isConvexTvs`
61+
+ factory `PreTopologicalLmod_isTvs` -> `PreTopologicalLmod_isConvexTvs`
62+
+ section `Tvs_numDomain` -> `ConvexTvs_numDomain`
63+
+ section `Tvs_numField` -> `ConvexTvs_numField`
64+
+ section `prod_Tvs` -> `prod_ConvexTvs`
3965

4066
- in `normed_module.v`
41-
+ HB mixin ` PseudoMetricNormedZmod_Tvs_isNormedModule` ->
67+
+ mixin ` PseudoMetricNormedZmod_Tvs_isNormedModule` ->
4268
` PseudoMetricNormedZmod_ConvexTvs_isNormedModule`
4369

4470
### Generalized

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: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,19 @@ Add Search Blacklist "_mixin_".
128128
(* fctE == multi-rule for fct *)
129129
(* ``` *)
130130
(* *)
131+
(* ``` *)
132+
(* linfun E F s == membership predicate for linear functions of *)
133+
(* type E -> F with scalar operator *)
134+
(* s : K -> F -> F *)
135+
(* E and F have type lmodType K. *)
136+
(* This is used in particular to attach a type of *)
137+
(* lmodType to {linear E -> F | s}. *)
138+
(* linfun_spec f == specification for membership of the linear *)
139+
(* function f *)
140+
(* ``` *)
141+
(* *)
142+
(* *)
143+
(* *)
131144
(******************************************************************************)
132145

133146
Unset SsrOldRewriteGoalsOrder. (* remove the line when requiring MathComp >= 2.6 *)
@@ -2750,3 +2763,96 @@ End function_space_lemmas.
27502763

27512764
Lemma inv_funK T (R : unitRingType) (f : T -> R) : (f\^-1\^-1)%R = f.
27522765
Proof. by apply/funeqP => x; rewrite /inv_fun/= GRing.invrK. Qed.
2766+
2767+
Local Open Scope ring_scope.
2768+
Import GRing.Theory.
2769+
2770+
Section linfun_pred.
2771+
Context {K : numDomainType} {E : lmodType K} {F : lmodType K}
2772+
{s : K -> F -> F}.
2773+
2774+
(**md Beware that `lfun` is reserved for vector types, hence this one has been
2775+
named `linfun` *)
2776+
Definition linfun : {pred E -> F} := mem [set f | linear_for s f ].
2777+
2778+
Definition linfun_key : pred_key linfun. Proof. exact. Qed.
2779+
2780+
Canonical linfun_keyed := KeyedPred linfun_key.
2781+
2782+
End linfun_pred.
2783+
2784+
Section linfun.
2785+
Context {R : numDomainType} {E : lmodType R}
2786+
{F : lmodType R} {s : GRing.Scale.law R F}.
2787+
2788+
Notation T := {linear E -> F | s}.
2789+
2790+
Notation linfun := (@linfun _ E F s).
2791+
2792+
Section Sub.
2793+
Context (f : E -> F) (fP : f \in linfun).
2794+
2795+
#[local] Definition linfun_Sub_subproof :=
2796+
@GRing.isLinear.Build _ E F s f (set_mem fP).
2797+
2798+
#[local] HB.instance Definition _ := linfun_Sub_subproof.
2799+
Definition linfun_Sub : {linear _ -> _ | _ } := f.
2800+
End Sub.
2801+
2802+
Let linfun_rect (K : T -> Type) :
2803+
(forall f (Pf : f \in linfun), K (linfun_Sub Pf)) -> forall u : T, K u.
2804+
Proof.
2805+
move=> Ksub [f] [[[Pf1 Pf2]] [Pf3]].
2806+
set G := (G in K G).
2807+
have Pf : f \in linfun by rewrite inE /= => // x u y; rewrite Pf2 Pf3.
2808+
suff -> : G = linfun_Sub Pf by apply: Ksub.
2809+
rewrite {}/G.
2810+
congr (GRing.Linear.Pack (GRing.Linear.Class _ _)).
2811+
- by congr GRing.isNmodMorphism.Axioms_; exact: Prop_irrelevance.
2812+
- by congr GRing.isScalable.Axioms_; exact: Prop_irrelevance.
2813+
Qed.
2814+
2815+
Let linfun_valP f (Pf : f \in linfun) : linfun_Sub Pf = f :> (_ -> _).
2816+
Proof. by []. Qed.
2817+
2818+
HB.instance Definition _ := isSub.Build _ _ T linfun_rect linfun_valP.
2819+
2820+
Lemma linfun_eqP (f g : {linear E -> F | s}) : f = g <-> f =1 g.
2821+
Proof. by split=> [->//|fg]; exact/val_inj/funext. Qed.
2822+
2823+
HB.instance Definition _ := [Choice of {linear E -> F | s} by <:].
2824+
2825+
Variant linfun_spec (f : E -> F) : (E -> F) -> bool -> Type :=
2826+
| Islinfun (l : {linear E -> F | s}) : linfun_spec f l true.
2827+
2828+
Lemma linfunP (f : E -> F) : f \in linfun -> linfun_spec f f (f \in linfun).
2829+
Proof.
2830+
move=> /[dup] f_lc ->.
2831+
have {2}-> : f = linfun_Sub f_lc by rewrite linfun_valP.
2832+
by constructor.
2833+
Qed.
2834+
2835+
End linfun.
2836+
2837+
Section linfun_lmodtype.
2838+
Context {R : numDomainType} {E F : lmodType R}.
2839+
Import GRing.Theory.
2840+
2841+
Let linfun_submod_closed : submod_closed (@linfun R E F *:%R).
2842+
Proof.
2843+
split; first by rewrite inE; exact/linearP.
2844+
move=> r /= _ _ /linfunP[f] /linfunP[g].
2845+
by rewrite inE /=; exact: linearP.
2846+
Qed.
2847+
2848+
HB.instance Definition _ :=
2849+
@GRing.isSubmodClosed.Build _ _ linfun linfun_submod_closed.
2850+
2851+
HB.instance Definition _ :=
2852+
[SubChoice_isSubLmodule of {linear E -> F } by <:].
2853+
2854+
End linfun_lmodtype.
2855+
2856+
(* TODO: we wanted to declare this instance in classical_sets.v but failed and did not understand why, also we couldn't generalize *)
2857+
HB.instance Definition _ {R : numDomainType} (E F : lmodType R) :=
2858+
isPointed.Build {linear E -> F} 0.

0 commit comments

Comments
 (0)