-
Notifications
You must be signed in to change notification settings - Fork 65
Normed vector types, infinite norm, norm equivalence thm, continuity … #1718
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
Open
Tragicus
wants to merge
5
commits into
math-comp:master
Choose a base branch
from
Tragicus:linear_findim_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.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
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,6 +1,7 @@ | ||
| (* mathcomp analysis (c) 2026 Inria and AIST. License: CeCILL-C. *) | ||
| From HB Require Import structures. | ||
| From mathcomp Require Import all_ssreflect_compat finmap ssralg ssrnum ssrint. | ||
| From mathcomp Require Import archimedean interval. | ||
| From mathcomp Require Import vector archimedean interval. | ||
|
|
||
| (**md**************************************************************************) | ||
| (* # MathComp extra *) | ||
|
|
@@ -23,6 +24,11 @@ From mathcomp Require Import archimedean interval. | |
| (* the dependent sum *) | ||
| (* prodA x := sends (X * Y) * Z to X * (Y * Z) *) | ||
| (* prodAr x := sends X * (Y * Z) to (X * Y) * Z *) | ||
| (* max_norm x := maximum of the norms of the coordinates of the *) | ||
| (* vector x in a given basis. *) | ||
| (* max_space V := alias of the vectType V equipped with a *) | ||
| (* structure of normed Z-module, where the norm is *) | ||
| (* max_norm. *) | ||
| (* ``` *) | ||
| (* *) | ||
| (******************************************************************************) | ||
|
|
@@ -592,3 +598,117 @@ Proof. exact: real_ltr_bound. Qed. | |
|
|
||
| Lemma ltrNbound {R : archiRealDomainType} (x : R) : - x < (Num.bound x)%:R. | ||
| Proof. exact: real_ltrNbound. Qed. | ||
|
|
||
| (* normedZmodType provide norms but the subject is not the norm. We define here | ||
| a structure of norm where the subject is the function from the left-module to | ||
| its scalar field. *) | ||
| Module Norm. | ||
|
|
||
| HB.mixin Record isNorm (K : numDomainType) (L : lmodType K) (norm : L -> K) := { | ||
| norm0 : norm 0 = 0; | ||
| norm_ge0 : forall x, 0 <= norm x; | ||
| norm0_eq0 : forall x, norm x = 0 -> x = 0; | ||
| ler_normD : forall x y, norm (x + y) <= norm x + norm y; | ||
| normZ : forall r x, norm (r *: x) = `|r| * norm x; | ||
| }. | ||
|
|
||
| #[export] | ||
| HB.structure Definition Norm K L := { norm of @isNorm K L norm }. | ||
|
|
||
| Module Import Theory. | ||
| Section Theory. | ||
| Variables (K : numDomainType) (L : lmodType K) (norm : Norm.type L). | ||
|
|
||
| Lemma normMn x n : norm (x *+ n) = norm x *+ n. | ||
| Proof. by rewrite -scaler_nat normZ normr_nat mulr_natl. Qed. | ||
|
|
||
| Lemma normN x : norm (- x) = norm x. | ||
| Proof. by rewrite -scaleN1r normZ normrN1 mul1r. Qed. | ||
|
|
||
| Lemma ler_norm_sum (I : Type) (r : seq I) (F : I -> L) : | ||
| norm (\sum_(i <- r) F i) <= \sum_(i <- r) norm (F i). | ||
| Proof. | ||
| by elim/big_ind2 : _ => *; rewrite ?norm0// (le_trans (ler_normD _ _))// lerD. | ||
| Qed. | ||
|
|
||
| End Theory. | ||
| End Theory. | ||
|
|
||
| Module Import Exports. HB.reexport. End Exports. | ||
| End Norm. | ||
| Export Norm.Exports. | ||
|
|
||
| Section InfiniteNorm. | ||
| Variables (K : numFieldType) (V : vectType K). | ||
| Let V' := @fullv _ V. | ||
| Variable B : (\dim V').-tuple V. | ||
| Hypothesis Bbasis : basis_of V' B. | ||
|
|
||
| Definition max_norm x := \big[Order.max/0]_(i < \dim V') `|coord B i x|. | ||
|
Collaborator
Author
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. Inference of a Norm.type for |
||
|
|
||
| Definition max_space : Type := (fun=> V) Bbasis. | ||
|
|
||
| HB.instance Definition _ := Vector.on max_space. | ||
|
|
||
| Let max_norm_ge0 x : 0 <= max_norm x. | ||
| Proof. | ||
| rewrite /max_norm. | ||
| by elim/big_ind : _ => //= ? ? ? ?; rewrite /Order.max; case: ifP. | ||
| Qed. | ||
|
|
||
| Lemma le_coord_max_norm x i : `|coord B i x| <= max_norm x. | ||
| Proof. | ||
| rewrite /max_norm; elim: (index_enum _) (mem_index_enum i) => //= j l IHl. | ||
| rewrite inE big_cons [X in _ <= X _ _]/Order.max/= => /predU1P[<-|/IHl {}IHl]; | ||
| case: ifP => [/ltW|]// /negbT. | ||
| set b := (X in _ < X). | ||
| have bR : b \is Num.real by apply: bigmax_real => // a _; apply: normr_real. | ||
| have /comparable_leNgt <- := real_comparable bR (normr_real (coord B j x)). | ||
| by move=> /(le_trans IHl). | ||
| Qed. | ||
|
|
||
| Let max_norm0 : max_norm 0 = 0. | ||
| Proof. | ||
| apply: le_anti; rewrite max_norm_ge0 andbT. | ||
| apply: bigmax_le => // i _. | ||
| have <-: \sum_(i < \dim V') 0 *: B`_i = 0. | ||
| under eq_bigr do rewrite scale0r. | ||
| by rewrite sumr_const mul0rn. | ||
| by rewrite coord_sum_free ?normr0// (basis_free Bbasis). | ||
| Qed. | ||
|
|
||
| Let ler_max_normD x y : max_norm (x + y) <= max_norm x + max_norm y. | ||
| Proof. | ||
| apply: bigmax_le => [|/= i _]; first by rewrite addr_ge0// max_norm_ge0. | ||
| by rewrite raddfD/= (le_trans (ler_normD _ _))// lerD// le_coord_max_norm. | ||
| Qed. | ||
|
|
||
| Let max_norm0_eq0 x : max_norm x = 0 -> x = 0. | ||
| Proof. | ||
| move=> x0; rewrite (coord_basis Bbasis (memvf x)). | ||
| suff: forall i, coord B i x = 0. | ||
| by move=> {}x0; rewrite big1//= => j _; rewrite x0 scale0r. | ||
| by move=> i; apply/normr0_eq0/le_anti; rewrite normr_ge0 -x0 le_coord_max_norm. | ||
| Qed. | ||
|
|
||
| Let max_normZ r x : max_norm (r *: x) = `|r| * max_norm x. | ||
| Proof. | ||
| rewrite /max_norm. | ||
| under eq_bigr do rewrite linearZ/= normrM. | ||
| elim: (index_enum _) => [|i l IHl]; first by rewrite !big_nil mulr0. | ||
| by rewrite !big_cons IHl maxr_pMr. | ||
| Qed. | ||
|
|
||
| HB.instance Definition _ := Norm.isNorm.Build K V max_norm | ||
| max_norm0 max_norm_ge0 max_norm0_eq0 ler_max_normD max_normZ. | ||
|
|
||
| Let max_normMn x n : max_norm (x *+ n) = max_norm x *+ n. | ||
| Proof. exact: Norm.Theory.normMn. Qed. | ||
|
|
||
| Let max_normN x : max_norm (- x) = max_norm x. | ||
| Proof. exact: Norm.Theory.normN. Qed. | ||
|
|
||
| HB.instance Definition _ := Num.Zmodule_isNormed.Build K | ||
| max_space ler_max_normD max_norm0_eq0 max_normMn max_normN. | ||
|
|
||
| End InfiniteNorm. | ||
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
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
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
Maybe
max_normshould be documented in the header (maybe alsomax_spacejust below)?