-
Notifications
You must be signed in to change notification settings - Fork 65
Linear_continuous structure #1913
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
mkerjean
wants to merge
1
commit into
math-comp:master
Choose a base branch
from
mkerjean:linear_continuous
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,4 +1,4 @@ | ||||||
| (* mathcomp analysis (c) 2017 Inria and AIST. License: CeCILL-C. *) | ||||||
| (* mathcomp analysis (c) 2017 Inria and AIST. License: CeCILL-C. *) | ||||||
| From HB Require Import structures. | ||||||
| From mathcomp Require Import all_ssreflect_compat ssralg ssrnum vector. | ||||||
| From mathcomp Require Import interval_inference. | ||||||
|
|
@@ -37,10 +37,10 @@ From mathcomp Require Import pseudometric_normed_Zmodule. | |||||
| (* UniformZmodule == HB class, join of UniformNmodule and Zmodule *) | ||||||
| (* with uniformly continuous opposite operator *) | ||||||
| (* PreUniformLmodule K == HB class, join of Uniform and Lmodule over K *) | ||||||
| (* K is a numDomainType. *) | ||||||
| (* K is a numDomainType *) | ||||||
| (* UniformLmodule K == HB class, join of UniformNmodule and Lmodule *) | ||||||
| (* with a uniformly continuous scaling operation *) | ||||||
| (* K is a numFieldType. *) | ||||||
| (* K is a numFieldType *) | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| (* convexTvsType R == interface type for a locally convex *) | ||||||
| (* tvs on a numDomain R *) | ||||||
| (* A convex tvs is constructed over a uniform *) | ||||||
|
|
@@ -49,7 +49,6 @@ From mathcomp Require Import pseudometric_normed_Zmodule. | |||||
| (* PreTopologicalLmod_isConvexTvs == factory allowing the construction of a *) | ||||||
| (* convex tvs from an Lmodule which is also a *) | ||||||
| (* topological space *) | ||||||
| (* ``` *) | ||||||
| (* HB instances: *) | ||||||
| (* - The type R^o (R : numFieldType) is endowed with the structure of *) | ||||||
| (* ConvexTvs. *) | ||||||
|
|
@@ -603,3 +602,198 @@ HB.instance Definition _ := | |||||
| Uniform_isConvexTvs.Build K (E * F)%type prod_locally_convex. | ||||||
|
|
||||||
| End prod_ConvexTvs. | ||||||
|
|
||||||
| HB.structure Definition LinearContinuous (K : numDomainType) (E : NbhsLmodule.type K) | ||||||
| (F : NbhsZmodule.type) (s : K -> F -> F) := | ||||||
| {f of @GRing.Linear K E F s f & @Continuous E F f }. | ||||||
|
|
||||||
| (* https://github.com/math-comp/math-comp/issues/1536 | ||||||
| we use GRing.Scale.law even though it is claimed to be internal *) | ||||||
| HB.factory Structure isLinearContinuous (K : numDomainType) (E : NbhsLmodule.type K) | ||||||
| (F : NbhsZmodule.type) (s : GRing.Scale.law K F) (f : E -> F) := { | ||||||
| linearP : linear_for s f ; | ||||||
| continuousP : continuous f | ||||||
| }. | ||||||
|
|
||||||
| HB.builders Context K E F s f of @isLinearContinuous K E F s f. | ||||||
|
|
||||||
| HB.instance Definition _ := GRing.isLinear.Build K E F s f linearP. | ||||||
| HB.instance Definition _ := isContinuous.Build E F f continuousP. | ||||||
|
|
||||||
| HB.end. | ||||||
|
|
||||||
| Section lcfun_pred. | ||||||
| Context {K : numDomainType} {E : NbhsLmodule.type K} {F : NbhsZmodule.type} {s : K -> F -> F}. | ||||||
| Definition lcfun : {pred E -> F} := mem [set f | linear_for s f /\ continuous f ]. | ||||||
| Definition lcfun_key : pred_key lcfun. Proof. exact. Qed. | ||||||
| Canonical lcfun_keyed := KeyedPred lcfun_key. | ||||||
|
|
||||||
| End lcfun_pred. | ||||||
|
|
||||||
| Reserved Notation "'{' 'linear_continuous' U '->' V '|' s '}'" | ||||||
| (at level 0, U at level 98, V at level 99, | ||||||
| format "{ 'linear_continuous' U -> V | s }"). | ||||||
| Reserved Notation "'{' 'linear_continuous' U '->' V '}'" | ||||||
| (at level 0, U at level 98, V at level 99, | ||||||
| format "{ 'linear_continuous' U -> V }"). | ||||||
| Notation "{ 'linear_continuous' U -> V | s }" := (@LinearContinuous.type _ U%type V%type s) | ||||||
| : type_scope. | ||||||
| Notation "{ 'linear_continuous' U -> V }" := {linear_continuous U%type -> V%type | *:%R} | ||||||
| : type_scope. | ||||||
|
|
||||||
| Section lcfun. | ||||||
| Context {R : numDomainType} {E : NbhsLmodule.type R} | ||||||
| {F : NbhsZmodule.type} {s : GRing.Scale.law R F}. | ||||||
| Notation T := {linear_continuous E -> F | s}. | ||||||
| Notation lcfun := (@lcfun _ E F s). | ||||||
|
|
||||||
| Section Sub. | ||||||
| Context (f : E -> F) (fP : f \in lcfun). | ||||||
|
|
||||||
| Definition lcfun_Sub_subproof := | ||||||
| @isLinearContinuous.Build _ E F s f (proj1 (set_mem fP)) (proj2 (set_mem fP)). | ||||||
| #[local] HB.instance Definition _ := lcfun_Sub_subproof. | ||||||
| Definition lcfun_Sub : {linear_continuous _ -> _ | _ } := f. | ||||||
| End Sub. | ||||||
|
|
||||||
| Lemma lcfun_rect (K : T -> Type) : | ||||||
| (forall f (Pf : f \in lcfun), K (lcfun_Sub Pf)) -> forall u : T, K u. | ||||||
| Proof. | ||||||
| move=> Ksub [f [[Pf1] [Pf2] [Pf3]]]. | ||||||
| set G := (G in K G). | ||||||
| have Pf : f \in lcfun. | ||||||
| by rewrite inE /=; split => // x u v; rewrite Pf1 Pf2. | ||||||
| suff -> : G = lcfun_Sub Pf by apply: Ksub. | ||||||
| rewrite {}/G. | ||||||
| congr LinearContinuous.Pack. | ||||||
| congr LinearContinuous.Class. | ||||||
| - by congr GRing.isNmodMorphism.Axioms_; apply: Prop_irrelevance. | ||||||
| - by congr GRing.isScalable.Axioms_; apply: Prop_irrelevance. | ||||||
| - by congr isContinuous.Axioms_; apply: Prop_irrelevance. | ||||||
| Qed. | ||||||
|
|
||||||
| Lemma lcfun_valP f (Pf : f \in lcfun) : lcfun_Sub Pf = f :> (_ -> _). | ||||||
| Proof. by []. Qed. | ||||||
|
|
||||||
| HB.instance Definition _ := isSub.Build _ _ T lcfun_rect lcfun_valP. | ||||||
|
|
||||||
| Lemma lcfuneqP (f g : {linear_continuous E -> F | s}) : f = g <-> f =1 g. | ||||||
| Proof. by split=> [->//|fg]; apply/val_inj/funext. Qed. | ||||||
|
|
||||||
| HB.instance Definition _ := [Choice of {linear_continuous E -> F | s} by <:]. | ||||||
|
|
||||||
| Variant lcfun_spec (f : E -> F) : (E -> F) -> bool -> Type := | ||||||
| | Islcfun (l : {linear_continuous E -> F | s}) : lcfun_spec f l true. | ||||||
|
|
||||||
| (*to be renamed ?*) | ||||||
| Lemma lcfunE (f : E -> F) : (f \in lcfun) -> lcfun_spec f f (f \in lcfun). | ||||||
| Proof. | ||||||
| move=> /[dup] f_lc ->. | ||||||
| have {2}-> :(f = (lcfun_Sub f_lc)) by rewrite lcfun_valP. | ||||||
| constructor. | ||||||
| Qed. | ||||||
|
|
||||||
| End lcfun. | ||||||
|
|
||||||
| Section lcfun_comp. | ||||||
|
|
||||||
| Context {R : numDomainType} {E F : NbhsLmodule.type R} | ||||||
| {S : NbhsZmodule.type} {s : GRing.Scale.law R S} | ||||||
| (f : {linear_continuous E -> F}) (g : {linear_continuous F -> S | s}). | ||||||
|
|
||||||
| Lemma lcfun_comp_subproof1 : linear_for s (g \o f). | ||||||
| Proof. by move=> *; move=> */=; rewrite !linearP. Qed. | ||||||
|
|
||||||
| (* TODO weaken proof continuous_comp to arbitrary nbhsType *) | ||||||
| Lemma lcfun_comp_subproof2 : continuous (g \o f). | ||||||
| Proof. by move=> x; move=> A /cts_fun /cts_fun. Qed. | ||||||
|
|
||||||
| HB.instance Definition _ := @isLinearContinuous.Build R E S s (g \o f) | ||||||
| lcfun_comp_subproof1 lcfun_comp_subproof2. | ||||||
|
|
||||||
| End lcfun_comp. | ||||||
|
|
||||||
| Section lcfun_lmodtype. | ||||||
| Context {R : numFieldType} {E F G: convexTvsType R}. | ||||||
|
|
||||||
| Implicit Types (r : R) (f g : {linear_continuous E -> F}) (h : {linear_continuous F -> G}). | ||||||
|
|
||||||
| Import GRing.Theory. | ||||||
|
|
||||||
| Lemma null_fun_continuous : continuous (\0 : E -> F). | ||||||
| Proof. | ||||||
| by apply: cst_continuous. | ||||||
| Qed. | ||||||
|
|
||||||
| HB.instance Definition _ := isContinuous.Build E F \0 null_fun_continuous. | ||||||
|
|
||||||
| Lemma lcfun0 : (\0 : {linear_continuous E -> F}) =1 cst 0 :> (_ -> _). | ||||||
| Proof. by []. Qed. | ||||||
|
|
||||||
| (* NB : cvgD in pseudometric_normedZmodule should be lowered to some common | ||||||
| structure to tvstype and pseudometric, then lcfun doesn't need to exist | ||||||
| anymore *) | ||||||
| Lemma lcfun_cvgD (U : set_system E) {FF : Filter U} f g a b : | ||||||
| f @ U --> a -> g @ U --> b -> (f \+ g) @ U --> a + b. | ||||||
| Proof. | ||||||
| move=> fa ga. | ||||||
| apply: continuous2_cvg; [|by []..]. | ||||||
| apply @add_continuous. (* TODO: why the @ ? *) | ||||||
| Qed. | ||||||
|
|
||||||
| Lemma lcfun_continuousD f g : continuous (f \+ g). | ||||||
| Proof. move=> /= x; apply: lcfun_cvgD; apply: cts_fun. Qed. | ||||||
|
|
||||||
|
|
||||||
| Lemma lcfun_cvgN (U : set_system E) {FF : Filter U} f a : f @ U --> a -> \- f @ U --> - a. | ||||||
| Proof. by move=> ?; apply: continuous_cvg => //; exact: opp_continuous. Qed. | ||||||
|
|
||||||
|
|
||||||
| Lemma lcfun_continuousN f : continuous (\- f). | ||||||
| Proof. | ||||||
| by move=> /= x; apply: lcfun_cvgN; apply: cts_fun. | ||||||
| Qed. | ||||||
|
|
||||||
| HB.instance Definition _ f g := isContinuous.Build E F (f \+ g) (@lcfun_continuousD f g). | ||||||
|
|
||||||
| Lemma lcfun_cvgZ (U : set_system E) {FF : Filter U} l f r a : l @ U --> r -> f @ U --> a -> | ||||||
| l x *: f x @[x --> U] --> r *: a. | ||||||
| Proof. | ||||||
| move=> ? ?; apply: continuous2_cvg => //; exact: (scale_continuous (_, _)). | ||||||
| Qed. | ||||||
|
|
||||||
| Lemma lcfun_cvgZr (U : set_system E) {FF : Filter U} k f a : f @ U --> a -> k \*: f @ U --> k *: a. | ||||||
| Proof. apply: lcfun_cvgZ => //; exact: cvg_cst. Qed. | ||||||
|
|
||||||
| Lemma lcfun_continuousM r g : continuous (r \*: g). | ||||||
| Proof. by move=> /= x; apply: lcfun_cvgZr; apply: cts_fun. Qed. | ||||||
|
|
||||||
| HB.instance Definition _ r g := isContinuous.Build E F (r \*: g) (@lcfun_continuousM r g). | ||||||
|
|
||||||
| Lemma lcfun_submod_closed : submod_closed (@lcfun R E F *:%R). | ||||||
| Proof. | ||||||
| split; first by rewrite inE; split; first apply/linearP; apply: cst_continuous. | ||||||
| move=> r /= _ _ /lcfunE[f] /lcfunE[g]. | ||||||
| by rewrite inE /=; split; [exact: linearP | exact: lcfun_continuousD]. | ||||||
| Qed. | ||||||
|
|
||||||
| HB.instance Definition _ f := isContinuous.Build E F (\- f) (@lcfun_continuousN f). | ||||||
|
|
||||||
| HB.instance Definition _ := | ||||||
| @GRing.isSubmodClosed.Build _ _ lcfun lcfun_submod_closed. | ||||||
|
|
||||||
| HB.instance Definition _ := | ||||||
| [SubChoice_isSubLmodule of {linear_continuous E -> F } by <:]. | ||||||
|
|
||||||
| End lcfun_lmodtype. | ||||||
|
|
||||||
|
|
||||||
| Section Substructures. | ||||||
| Context (R: numFieldType) (V : convexTvsType R). | ||||||
| Variable (A : pred V). | ||||||
|
|
||||||
| HB.instance Definition _ := ConvexTvs.on (subspace A). | ||||||
|
|
||||||
| Check {linear_continuous (subspace A) -> R^o}. | ||||||
|
|
||||||
| End Substructures. | ||||||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.