Skip to content

Commit 73f40eb

Browse files
committed
wip
1 parent e9fef19 commit 73f40eb

File tree

7 files changed

+650
-584
lines changed

7 files changed

+650
-584
lines changed

classical/unstable.v

Lines changed: 130 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
(* mathcomp analysis (c) 2022 Inria and AIST. License: CeCILL-C. *)
22
From mathcomp Require Import all_ssreflect finmap ssralg ssrnum ssrint rat.
3-
From mathcomp Require Import archimedean finset interval mathcomp_extra.
3+
From mathcomp Require Import archimedean finset interval complex mathcomp_extra.
44

55
(**md**************************************************************************)
66
(* # MathComp extra *)
@@ -33,6 +33,7 @@ Unset Strict Implicit.
3333
Unset Printing Implicit Defensive.
3434

3535
Import Order.TTheory GRing.Theory Num.Theory.
36+
Local Open Scope complex_scope.
3637
Local Open Scope ring_scope.
3738

3839
Section ssralg.
@@ -483,3 +484,131 @@ Notation " R ~~> R' " := (@respectful _ _ (Program.Basics.flip (R%signature)) (R
483484

484485
Export -(notations) Morphisms.
485486
End ProperNotations.
487+
488+
(* TODO: backport to real-closed *)
489+
Section complex_extras.
490+
Variable R : rcfType.
491+
Local Notation sqrtr := Num.sqrt.
492+
Local Notation C := R[i].
493+
494+
Import Normc.
495+
Import Num.Def.
496+
Import complex.
497+
498+
Lemma scalecE (w v : C) : v *: w = v * w.
499+
Proof. by []. Qed.
500+
501+
(* FIXME: unused *)
502+
Lemma normcr (x : R) : normc (x%:C) = normr x.
503+
Proof. by rewrite /normc/= expr0n //= addr0 sqrtr_sqr. Qed.
504+
505+
Lemma Im_mul (x : R) : x *i = x%:C * 'i%C.
506+
Proof. by simpc. Qed.
507+
508+
Lemma mulrnc (a b : R) k : a +i* b *+ k = (a *+ k) +i* (b *+ k).
509+
Proof.
510+
by elim: k => // k ih; apply/eqP; rewrite !mulrS eq_complex !ih !eqxx.
511+
Qed.
512+
513+
Lemma complexA (h : C) : h%:A = h.
514+
Proof. by rewrite scalecE mulr1. Qed.
515+
516+
Lemma normc_natmul (k : nat) : normc k%:R = k%:R :> R.
517+
Proof. by rewrite mulrnc /= mul0rn expr0n addr0 sqrtr_sqr normr_nat. Qed.
518+
519+
Lemma normc_mulrn (x : C) k : normc (x *+ k) = (normc x) *+ k.
520+
Proof.
521+
by rewrite -mulr_natr normcM -[in RHS]mulr_natr normc_natmul.
522+
Qed.
523+
524+
Lemma gt0_normc (r : C) : 0 < r -> r = (normc r)%:C.
525+
Proof.
526+
case: r => x y /= /andP[] /eqP -> x0.
527+
by rewrite expr0n addr0 sqrtr_sqr gtr0_norm.
528+
Qed.
529+
530+
Lemma gt0_realC (r : C) : 0 < r -> r = (Re r)%:C.
531+
Proof. by case: r => x y /andP[] /eqP -> _. Qed.
532+
533+
Lemma ltc0E (k : R): (0 < k%:C) = (0 < k).
534+
Proof. by simpc. Qed.
535+
536+
Lemma ltc0P (k : R): (0 < k%:C) <-> (0 < k).
537+
Proof. by simpc. Qed.
538+
539+
Lemma ltcP (k t: R): (t%:C < k%:C) <-> (t < k).
540+
Proof. by simpc. Qed.
541+
542+
Lemma lecP (k t: R): (t%:C <= k%:C) <-> (t <= k).
543+
Proof. by simpc. Qed.
544+
545+
(* (*TBA algC *) *)
546+
Lemma realC_gt0 (d : C) : 0 < d -> (0 < Re d :> R).
547+
Proof. by rewrite ltcE => /andP [] //. Qed.
548+
549+
Lemma Creal_gtE (c d : C) : c < d -> (complex.Re c < complex.Re d).
550+
Proof. by rewrite ltcE => /andP [] //. Qed.
551+
552+
Lemma realC_norm (b : R) : `|b%:C| = `|b|%:C.
553+
Proof. by rewrite normc_def /= expr0n addr0 sqrtr_sqr. Qed.
554+
555+
Lemma eqCr (r s : R) : (r%:C == s%:C) = (r == s).
556+
Proof. exact: (inj_eq (@complexI _)). Qed.
557+
558+
Lemma eqCI (r s : R) : (r *i == s *i) = (r == s).
559+
Proof. by apply/idP/idP => [/eqP[] ->//|/eqP ->]. Qed.
560+
561+
Lemma neqCr0 (r : R) : (r%:C != 0) = (r != 0).
562+
Proof. by apply/negP/negP; rewrite ?eqCr. Qed.
563+
564+
Lemma real_normc_ler (x : C) :
565+
`|Re x| <= normc x.
566+
Proof.
567+
case: x => x y /=.
568+
rewrite -ler_sqr ?nnegrE ?normr_ge0 ?sqrtr_ge0 //.
569+
rewrite sqr_sqrtr ?addr_ge0 ?sqr_ge0 ?real_normK //=.
570+
by rewrite lerDl ?sqr_ge0.
571+
Qed.
572+
573+
Lemma im_normc_ler (x : C) :
574+
`|Im x| <= normc x.
575+
Proof.
576+
case: x => x y /=.
577+
rewrite -ler_sqr ?nnegrE ?normr_ge0 ?sqrtr_ge0 //.
578+
rewrite sqr_sqrtr ?addr_ge0 ?sqr_ge0 ?real_normK //=.
579+
by rewrite lerDr ?sqr_ge0.
580+
Qed.
581+
582+
End complex_extras.
583+
584+
Notation "f %:Rfun" :=
585+
(f : (Rcomplex _) -> (Rcomplex _))
586+
(at level 5, format "f %:Rfun") : complex_scope.
587+
588+
Notation "v %:Rc" := (v : (Rcomplex _))
589+
(at level 5, format "v %:Rc") : complex_scope.
590+
591+
Section algebraic_lemmas.
592+
Variable (R: rcfType).
593+
Notation C := R[i].
594+
Notation Rcomplex := (Rcomplex R).
595+
596+
Import Normc.
597+
598+
Lemma realCZ (a : R) (b : Rcomplex) : a%:C * b = a *: b.
599+
Proof. by case: b => x y; simpc. Qed.
600+
601+
Lemma realC_alg (a : R) : a *: (1%:Rc) = a%:C.
602+
Proof. by rewrite /GRing.scale/= mulr1 mulr0. Qed.
603+
604+
Lemma scalecr (w: C) (r : R) : r *: (w: Rcomplex) = r%:C *: w .
605+
Proof. by case w => a b; simpc. Qed.
606+
607+
Lemma scalecV (h: R) (v: Rcomplex):
608+
h != 0 -> v != 0 -> (h *: v)^-1 = h^-1 *: v^-1. (* scaleCV *)
609+
Proof.
610+
by move=> h0 v0; rewrite scalecr invrM // ?unitfE ?eqCr // mulrC scalecr fmorphV.
611+
Qed.
612+
613+
End algebraic_lemmas.
614+

theories/function_spaces.v

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1557,6 +1557,40 @@ End cartesian_closed.
15571557

15581558
End currying.
15591559

1560+
Section big_continuous.
1561+
1562+
Lemma cvg_big (T : Type) (U : topologicalType) [F : set_system T] [I : Type]
1563+
(r : seq I) (P : pred I) (Ff : I -> T -> U) (Fa : I -> U)
1564+
(op : U -> U -> U) (x0 : U):
1565+
Filter F ->
1566+
continuous (fun x : U * U => op x.1 x.2) ->
1567+
(forall i, P i -> Ff i x @[x --> F] --> Fa i) ->
1568+
\big[op/x0]_(i <- r | P i) (Ff i x) @[x --> F] -->
1569+
\big[op/x0]_(i <- r | P i) Fa i.
1570+
Proof.
1571+
move=> FF opC0 cvg_f.
1572+
elim: r => [|x r IHr].
1573+
rewrite big_nil.
1574+
under eq_cvg do rewrite big_nil.
1575+
exact: cvg_cst.
1576+
rewrite big_cons (eq_cvg _ _ (fun x => big_cons _ _ _ _ _ _)).
1577+
case/boolP: (P x) => // Px.
1578+
apply: (@cvg_comp _ _ _ (fun x1 => (Ff x x1, \big[op/x0]_(j <- r | P j) Ff j x1)) _ _ (nbhs (Fa x, \big[op/x0]_(j <- r | P j) Fa j)) _ _ (continuous_curry_cvg opC0)).
1579+
by apply: cvg_pair => //; apply: cvg_f.
1580+
Qed.
1581+
1582+
Lemma continuous_big [K T : topologicalType] [I : Type] (r : seq I)
1583+
(P : pred I) (F : I -> T -> K) (op : K -> K -> K) (x0 : K) :
1584+
continuous (fun x : K * K => op x.1 x.2) ->
1585+
(forall i, P i -> continuous (F i)) ->
1586+
continuous (fun x => \big[op/x0]_(i <- r | P i) F i x).
1587+
Proof.
1588+
move=> op_cont f_cont x.
1589+
by apply: cvg_big => // i /f_cont; apply.
1590+
Qed.
1591+
1592+
End big_continuous.
1593+
15601594
Definition eval {X Y : topologicalType} : continuousType X Y * X -> Y :=
15611595
uncurry (id : continuousType X Y -> (X -> Y)).
15621596

0 commit comments

Comments
 (0)