Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions theories/derive.v
Original file line number Diff line number Diff line change
Expand Up @@ -2341,6 +2341,66 @@ 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/=.
- move=> /cvg_ex[/= l Hl].
apply/cvg_ex => /=; exists l^T.
apply/cvgrPdist_le => /= e e0.
move/cvgrPdist_le : Hl => /(_ _ e0)[/= r r0 re].
near=> x.
rewrite [leLHS](_ : _ =
`|l - x^-1 *: ((M (x *: v + t))^T - (M t)^T)|); last 2 first.
rewrite -[RHS]norm_trmx.
rewrite [in RHS]linearD/=.
rewrite [in RHS]linearN/=.
congr (`| _ - _ |).
rewrite [RHS]linearZ/=.
rewrite [in RHS]linearB.
by rewrite /= !trmxK.
apply: re => /=.
rewrite sub0r normrN.
by near: x; exact: dnbhs0_lt.
by near: x; exact: nbhs_dnbhs_neq.
- move=> /cvg_ex[/= l Hl].
apply/cvg_ex => /=; exists l^T.
apply/cvgrPdist_le => /= e e0.
move/cvgrPdist_le : Hl => /(_ _ e0)[/= r r0 re].
near=> x.
rewrite [leLHS](_ : _ = `|l - x^-1 *: ((M (x *: v + t)) - (M t))|); last 2 first.
rewrite -[RHS]norm_trmx.
rewrite [in RHS]linearD/=.
rewrite [in RHS]linearN/=.
congr (`| _ - _ |).
rewrite [RHS]linearZ/=.
by rewrite [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 : nat} (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=> Mt1.
rewrite !derive_mx//=.
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 : nat}
(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 ->
Expand Down
28 changes: 28 additions & 0 deletions theories/normedtype_theory/matrix_normedtype.v
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,34 @@ Qed.

End mx_norm.

Section norm_trmx.

Import Order.TTheory GRing.Theory Num.Def Num.Theory.
Import Order.Def.
Local Open Scope ring_scope.
Lemma nng_max0r {K : realFieldType} : left_id ((0:K)%:nng) (@maxr {nonneg K}).
Proof.
move=> x.
rewrite /max; case: ifPn => //.
rewrite -leNgt => x0.
apply/eqP; rewrite eq_le; apply/andP; split; last first.
exact: x0.
by have : 0 <= x%:nngnum by []. (* NB: this should be automatic *)
Qed.

HB.instance Definition _ {K : realFieldType} :=
Monoid.isComLaw.Build {nonneg K} 0%:nng max maxA maxC nng_max0r.

Lemma norm_trmx m n {R : realFieldType} (M : 'M[R]_(m, n)) : mx_norm (M^T) = mx_norm M.
Proof.
rewrite [LHS]mx_normE/=.
under eq_bigr do rewrite mxE /=.
rewrite -(pair_big xpredT xpredT (fun i j => `|M j i|%:nng))/=.
by rewrite exchange_big//= pair_big.
Qed.

End norm_trmx.

Lemma mx_normrE (K : realDomainType) (m n : nat) (x : 'M[K]_(m, n)) :
mx_norm x = \big[maxr/0]_ij `|x ij.1 ij.2|.
Proof.
Expand Down
Loading