|
1 | 1 | (* mathcomp analysis (c) 2026 Inria and AIST. License: CeCILL-C. *) |
2 | 2 | From HB Require Import structures. |
3 | | -From mathcomp Require Import all_ssreflect_compat ssralg ssrnum matrix interval poly. |
4 | | -From mathcomp Require Import sesquilinear. |
| 3 | +From mathcomp Require Import all_ssreflect_compat ssralg ssrnum matrix interval. |
| 4 | +From mathcomp Require Import poly sesquilinear. |
5 | 5 | #[warning="-warn-library-file-internal-analysis"] |
6 | 6 | From mathcomp Require Import unstable. |
7 | 7 | From mathcomp Require Import mathcomp_extra boolp contra classical_sets. |
@@ -660,7 +660,7 @@ move=> df; set g := RHS; have glin : linear g. |
660 | 660 | by move=> a u v; rewrite /g linearP /= scalerDl -scalerA. |
661 | 661 | pose glM := GRing.isLinear.Build _ _ _ _ _ glin. |
662 | 662 | pose gL : {linear _ -> _} := HB.pack g glM. |
663 | | -by apply:(@diff_unique _ _ _ gL); have [] := dscalel f df. |
| 663 | +by apply: (@diff_unique _ _ _ gL); have [] := dscalel f df. |
664 | 664 | Qed. |
665 | 665 |
|
666 | 666 | Lemma differentiableZl (k : V -> R) (f : W) x : |
@@ -2328,4 +2328,76 @@ rewrite (le_trans (ler_normD _ _))// (splitr e) lerD//. |
2328 | 2328 | by rewrite sub0r normrN; near: x; exact: dnbhs0_lt. |
2329 | 2329 | Unshelve. all: by end_near. Qed. |
2330 | 2330 |
|
| 2331 | +Global Instance is_derive_mx {m n : nat} (M : V -> 'M[R]_(m, n)) |
| 2332 | + (dM : 'M[R]_(m, n)) (x v : V) : |
| 2333 | + (forall i j, is_derive x v (fun x => M x i j) (dM i j)) -> |
| 2334 | + is_derive x v M dM. |
| 2335 | +Proof. |
| 2336 | +move=> MdM; apply: DeriveDef; first exact/derivable_mxP. |
| 2337 | +apply/matrixP => i j. |
| 2338 | +have [_ <-] := MdM i j. |
| 2339 | +rewrite derive_mx ?mxE//. |
| 2340 | +apply/derivable_mxP => i0 j0. |
| 2341 | +by have [] := MdM i0 j0. |
| 2342 | +Qed. |
| 2343 | + |
| 2344 | +Fact dmx {m n : nat} (M : V -> 'M[R]_(m, n)) (x : V) : |
| 2345 | + let g := fun x0 : V => (\matrix_(i < m, j < n) 'd M x x0 i j) in |
| 2346 | + differentiable M x -> |
| 2347 | + continuous g /\ |
| 2348 | + M \o shift x = cst (M x) + g +o_ 0 id. |
| 2349 | +Proof. |
| 2350 | +move=> dM Mx; split => [|]. |
| 2351 | +- apply/continuous_mx => i j v; apply/cvgrPdist_le => /= e e0. |
| 2352 | + case: Mx => -[+ _] => /(_ v)/cvgrPdist_le/(_ _ e0). |
| 2353 | + apply: filterS => /= t; apply: le_trans. |
| 2354 | + by rewrite {2}/Num.norm/= mx_normrE (le_trans _ (le_bigmax _ _ (i, j))) ?mxE. |
| 2355 | +- apply/eqaddoE; rewrite funeqE => y /=. |
| 2356 | + rewrite (diff_locallyx Mx) /dM !fctE; congr (_ + _ + _). |
| 2357 | + by apply/matrixP => i j/=; rewrite mxE. |
| 2358 | +Qed. |
| 2359 | + |
| 2360 | +Lemma diffmx {m n : nat} (M : V -> 'M[R]_(m, n)) t : |
| 2361 | + differentiable M t -> |
| 2362 | + 'd M (nbhs_filter_on t) = |
| 2363 | + (fun x0 : V => \matrix_(i < m, j < n) 'd M t x0 i j) :> (_ -> _). |
| 2364 | +Proof. |
| 2365 | +move=> dM. |
| 2366 | +set g := fun x0 : V => \matrix_(i, j) 'd M t x0 i j. |
| 2367 | +have glin : linear (g : V -> _). |
| 2368 | + move=> a u w. |
| 2369 | + by rewrite /g linearD linearZ/=; apply/matrixP => i j; rewrite !mxE. |
| 2370 | +pose glM := GRing.isLinear.Build _ _ _ _ _ glin. |
| 2371 | +pose gL : {linear _ -> _} := HB.pack g glM. |
| 2372 | +by apply: (@diff_unique _ _ _ _ gL); have [? ?] := dmx dM. |
| 2373 | +Qed. |
| 2374 | + |
2331 | 2375 | End pointwise_derive. |
| 2376 | + |
| 2377 | +Section Ris_diff_mx. |
| 2378 | +Local Open Scope classical_set_scope. |
| 2379 | +Context {R : realFieldType}. |
| 2380 | + |
| 2381 | +Global Instance is_diff_mx {m n : nat} (M dM : R -> 'M[R]_(m, n)) (x : R) : |
| 2382 | + (forall i j, is_diff x (fun x => M x i j) (fun x => dM x i j)) -> |
| 2383 | + is_diff x M dM. |
| 2384 | +Proof. |
| 2385 | +move=> /= MdM. |
| 2386 | +have diffM : differentiable M (nbhs_filter_on x). |
| 2387 | + apply/derivable1_diffP; apply/derivable_mxP => i j. |
| 2388 | + by have [/(@derivable1_diffP _ _ (fun x0 => M x0 i j) x)] := MdM i j. |
| 2389 | +have diffMx i j : differentiable (fun x0 : R => M x0 i j) x. |
| 2390 | + by have [/=] := MdM i j. |
| 2391 | +apply: DiffDef; first exact: diffM. |
| 2392 | +rewrite diffmx//=; apply/funext => /= v; apply/matrixP => i j. |
| 2393 | +rewrite !mxE. |
| 2394 | +have [diffMij dMdM] := MdM i j. |
| 2395 | +rewrite -deriveE//. |
| 2396 | +move/(congr1 (fun f => f v)) : dMdM. |
| 2397 | +rewrite -(deriveE _ diffMij) => <-. |
| 2398 | +rewrite derive_mx ?mxE//=. |
| 2399 | +apply/derivable_mxP => i0 j0/=. |
| 2400 | +by have [/diff_derivable-/(_ v)] := MdM i0 j0. |
| 2401 | +Qed. |
| 2402 | + |
| 2403 | +End Ris_diff_mx. |
0 commit comments