-
Notifications
You must be signed in to change notification settings - Fork 73
is_derive_trmx #2060
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
yosakaon
wants to merge
2
commits into
math-comp:master
Choose a base branch
from
yosakaon:29juil
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
is_derive_trmx #2060
Changes from all commits
Commits
Show all changes
2 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
Some comments aren't visible on the classic Files Changed page.
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
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 |
|---|---|---|
|
|
@@ -2511,6 +2511,54 @@ apply/derivable_mxP => i0 j0. | |
| by have [] := MdM i0 j0. | ||
| Qed. | ||
|
|
||
| Lemma derivable_trmx {m n} (M : V -> 'M[R]_(m, n)) t v : | ||
| derivable (fun x => (M x)^T) t v = derivable M t v. | ||
| Proof. | ||
| rewrite propeqE; split; rewrite /derivable/=. | ||
|
Comment on lines
+2514
to
+2517
Collaborator
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. This looks like essentially two times the same proof, couldn't it be factored? (I would expect ``derivable M -> derivable M^T |
||
| - move=> /cvg_ex[/= l Ml]; apply/cvg_ex => /=; exists l^T. | ||
| apply/cvgrPdist_le => /= e e0. | ||
| move/cvgrPdist_le : Ml => /(_ _ e0)[/= r r0 re]. | ||
| near=> x. | ||
| rewrite [leLHS](_ : _ = `|l - x^-1 *: ((M (x *: v + t))^T - (M t)^T)|). | ||
| rewrite -[RHS]norm_trmx [in RHS]linearD/= [in RHS]linearN/=. | ||
| congr (`| _ - _ |). | ||
| by rewrite [RHS]linearZ/= [in RHS]linearB /= !trmxK. | ||
| apply: re => /=. | ||
| rewrite sub0r normrN. | ||
| by near: x; exact: dnbhs0_lt. | ||
| by near: x; exact: nbhs_dnbhs_neq. | ||
| - move=> /cvg_ex[/= l Ml]; apply/cvg_ex => /=; exists l^T. | ||
| apply/cvgrPdist_le => /= e e0. | ||
| move/cvgrPdist_le : Ml => /(_ _ e0)[/= r r0 re]. | ||
| near=> x. | ||
| rewrite [leLHS](_ : _ = `|l - x^-1 *: ((M (x *: v + t)) - (M t))|). | ||
| rewrite -[RHS]norm_trmx [in RHS]linearD/= [in RHS]linearN/=. | ||
| congr (`| _ - _ |). | ||
| by rewrite [RHS]linearZ/= [in RHS]linearB. | ||
| apply: re => /=. | ||
| rewrite sub0r normrN. | ||
| by near: x; exact: dnbhs0_lt. | ||
| by near: x; exact: nbhs_dnbhs_neq. | ||
| Unshelve. all: by end_near. Qed. | ||
|
|
||
| Lemma derive_trmx {m n} (M : V -> 'M[R]_(m, n)) t v : | ||
| derivable M t v -> 'D_v (trmx \o M) t = ('D_v M t)^T. | ||
| Proof. | ||
| move=> Mtv; rewrite !derive_mx//=; first by rewrite derivable_trmx. | ||
| apply/matrixP => i j; rewrite !mxE. | ||
| by under eq_fun do rewrite mxE. | ||
| Qed. | ||
|
|
||
| Global Instance is_derive_trmx {m n} (f : V -> 'M[R]_(m, n)) (f' : 'M[R]_(m, n)) | ||
| (t : V) w : | ||
| is_derive t w f f' -> is_derive t w (fun x => (f x)^T) f'^T. | ||
| Proof. | ||
| move=> fD. | ||
| have fDer : derivable f t w by case: fD. | ||
| apply/DeriveDef; last by have [_ <-] := fD; rewrite derive_trmx. | ||
| by rewrite derivable_trmx. | ||
| Qed. | ||
|
|
||
| Fact dmx {m n : nat} (M : V -> 'M[R]_(m, n)) (x : V) : | ||
| let g := fun t : V => (\matrix_(i < m, j < n) 'd M x t i j) in | ||
| differentiable M x -> | ||
|
|
||
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.
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.
I was a bit surprised that we need to insert this
have. Maybe there is some automation ininterval_inference.vthat does not work as expected? @proux01 ?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.
Goal is
widen_itv 0%:itv <= x(with the order on Itv.t), of course this is convertible to0 <= x%:num(as shown byrewrite /Order.le/= /Order.PreCancelPartial.le/=) but trigerring hints for auto forge0do not match that syntactic pattern https://github.com/math-comp/math-comp/blob/900e37912dbecbd3c04d3c1b320efe721d3f56dd/algebra/interval_inference.v#L770 . So I'd say it's not expected to be simpler, except maybeby rewrite -num_le/=