Skip to content

Commit 13446e9

Browse files
committed
repair admit and move linfun to functions.v
1 parent 1ad035b commit 13446e9

2 files changed

Lines changed: 114 additions & 107 deletions

File tree

classical/functions.v

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,12 @@ Add Search Blacklist "_mixin_".
128128
(* fctE == multi-rule for fct *)
129129
(* ``` *)
130130
(* *)
131+
(* ``` *)
132+
(*Section linfun_lmodtype == canonical lmodtype structure on linear maps *)
133+
(* between lmodtypes. *)
134+
(* *)
135+
(* *)
136+
(* *)
131137
(******************************************************************************)
132138

133139
Set SsrOldRewriteGoalsOrder. (* change Set to Unset when porting the file, then remove the line when requiring MathComp >= 2.6 *)
@@ -2750,3 +2756,111 @@ End function_space_lemmas.
27502756

27512757
Lemma inv_funK T (R : unitRingType) (f : T -> R) : (f\^-1\^-1)%R = f.
27522758
Proof. by apply/funeqP => x; rewrite /inv_fun/= GRing.invrK. Qed.
2759+
2760+
2761+
Local Open Scope ring_scope.
2762+
Import GRing.Theory.
2763+
2764+
Section linfun_pred.
2765+
(* Beware that lfun is reserved for vector types, hence this one has been
2766+
renamed linfun *)
2767+
Context {K : numDomainType} {E : lmodType K} {F : lmodType K} {s : K -> F -> F}.
2768+
Definition linfun : {pred E -> F} := mem [set f | linear_for s f ].
2769+
Definition linfun_key : pred_key linfun. Proof. exact. Qed.
2770+
Canonical linfun_keyed := KeyedPred linfun_key.
2771+
2772+
End linfun_pred.
2773+
2774+
Section linfun.
2775+
Context {R : numDomainType} {E : lmodType R}
2776+
{F : lmodType R} {s : GRing.Scale.law R F}.
2777+
Notation T := {linear E -> F | s}.
2778+
Notation linfun := (@linfun _ E F s).
2779+
2780+
Section Sub.
2781+
Context (f : E -> F) (fP : f \in linfun).
2782+
2783+
Definition linfun_Sub_subproof :=
2784+
@GRing.isLinear.Build _ E F s f (set_mem fP).
2785+
2786+
#[local] HB.instance Definition _ := linfun_Sub_subproof.
2787+
Definition linfun_Sub : {linear _ -> _ | _ } := f.
2788+
End Sub.
2789+
2790+
Lemma linfun_rect (K : T -> Type) :
2791+
(forall f (Pf : f \in linfun), K (linfun_Sub Pf)) -> forall u : T, K u.
2792+
Proof.
2793+
move=> Ksub [f] [[[Pf1 Pf2]] [Pf3]].
2794+
set G := (G in K G).
2795+
have Pf : f \in linfun.
2796+
by rewrite inE /= => // x u y; rewrite Pf2 Pf3.
2797+
suff -> : G = linfun_Sub Pf by apply: Ksub.
2798+
rewrite {}/G.
2799+
congr GRing.Linear.Pack.
2800+
congr GRing.Linear.Class.
2801+
- by congr GRing.isNmodMorphism.Axioms_; apply: Prop_irrelevance.
2802+
- by congr GRing.isScalable.Axioms_; apply: Prop_irrelevance.
2803+
Qed.
2804+
2805+
Lemma linfun_valP f (Pf : f \in linfun) : linfun_Sub Pf = f :> (_ -> _).
2806+
Proof. by []. Qed.
2807+
2808+
HB.instance Definition _ := isSub.Build _ _ T linfun_rect linfun_valP.
2809+
2810+
Lemma linfuneqP (f g : {linear E -> F | s}) : f = g <-> f =1 g.
2811+
Proof. by split=> [->//|fg]; apply/val_inj/funext. Qed.
2812+
2813+
HB.instance Definition _ := [Choice of {linear E -> F | s} by <:].
2814+
2815+
Variant linfun_spec (f : E -> F) : (E -> F) -> bool -> Type :=
2816+
| Islinfun (l : {linear E -> F | s}) : linfun_spec f l true.
2817+
2818+
(*to be renamed ?*)
2819+
Lemma linfunE (f : E -> F) : (f \in linfun) -> linfun_spec f f (f \in linfun).
2820+
Proof.
2821+
move=> /[dup] f_lc ->.
2822+
have {2}-> :(f = (linfun_Sub f_lc)) by rewrite linfun_valP.
2823+
constructor.
2824+
Qed.
2825+
2826+
End linfun.
2827+
2828+
Section linfun_comp.
2829+
2830+
Context {R : numDomainType} {E F : lmodType R}
2831+
{S : lmodType R} {s : GRing.Scale.law R S}
2832+
(f : {linear E -> F}) (g : {linear F -> S | s}).
2833+
2834+
Lemma linfun_comp_subproof : linear_for s (g \o f).
2835+
Proof. by move=> *; move=> */=; rewrite !linearP. Qed.
2836+
2837+
HB.instance Definition _ := @GRing.isLinear.Build R E S s (g \o f)
2838+
linfun_comp_subproof.
2839+
(* HB warning : no new instance generated but before we have
2840+
Fail Check ( (g \o f) : {linear E -> F | s}). ? *)
2841+
2842+
End linfun_comp.
2843+
2844+
Section linfun_lmodtype.
2845+
Context {R : numFieldType} {E F G: lmodType R}.
2846+
2847+
Implicit Types (r : R) (f g : {linear E -> F}) (h : {linear F -> G}).
2848+
2849+
Import GRing.Theory.
2850+
2851+
Lemma linfun0 : (\0 : {linear E -> F}) =1 cst 0 :> (_ -> _). Proof. by []. Qed.
2852+
2853+
Lemma linfun_submod_closed : submod_closed (@linfun R E F *:%R).
2854+
Proof.
2855+
split; first by rewrite inE; apply/linearP.
2856+
move=> r /= _ _ /linfunE[f] /linfunE[g].
2857+
by rewrite inE /=; exact: linearP.
2858+
Qed.
2859+
2860+
HB.instance Definition _ :=
2861+
@GRing.isSubmodClosed.Build _ _ linfun linfun_submod_closed.
2862+
2863+
HB.instance Definition _ :=
2864+
[SubChoice_isSubLmodule of {linear E -> F } by <:].
2865+
2866+
End linfun_lmodtype.

theories/normedtype_theory/tvs.v

Lines changed: 0 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -603,113 +603,6 @@ HB.instance Definition _ :=
603603

604604
End prod_ConvexTvs.
605605

606-
607-
Section linfun_pred.
608-
(* Beware that lfun is reserved for vector types, hence this one has been
609-
renamed linfun *)
610-
Context {K : numDomainType} {E : lmodType K} {F : lmodType K} {s : K -> F -> F}.
611-
Definition linfun : {pred E -> F} := mem [set f | linear_for s f ].
612-
Definition linfun_key : pred_key linfun. Proof. exact. Qed.
613-
Canonical linfun_keyed := KeyedPred linfun_key.
614-
615-
End linfun_pred.
616-
617-
Section linfun.
618-
Context {R : numDomainType} {E : lmodType R}
619-
{F : lmodType R} {s : GRing.Scale.law R F}.
620-
Notation T := {linear E -> F | s}.
621-
Notation linfun := (@linfun _ E F s).
622-
623-
Section Sub.
624-
Context (f : E -> F) (fP : f \in linfun).
625-
626-
Definition linfun_Sub_subproof :=
627-
@GRing.isLinear.Build _ E F s f (set_mem fP).
628-
#[local] HB.instance Definition _ := linfun_Sub_subproof.
629-
Definition linfun_Sub : {linear _ -> _ | _ } := f.
630-
End Sub.
631-
632-
Lemma linfun_rect (K : T -> Type) :
633-
(forall f (Pf : f \in linfun), K (linfun_Sub Pf)) -> forall u : T, K u.
634-
Proof.
635-
move=> Ksub [f Pf1].
636-
set G := (G in K G).
637-
have Pf : f \in linfun.
638-
rewrite inE /=. move => // x u y. admit.
639-
suff -> : G = linfun_Sub Pf by apply: Ksub.
640-
rewrite {}/G.
641-
congr GRing.Linear.Pack.
642-
congr GRing.Linear.Class.
643-
(*- by congr GRing.isNmodMorphism.Axioms_; apply: Prop_irrelevance.
644-
- by congr GRing.isScalable.Axioms_; apply: Prop_irrelevance.
645-
Qed.
646-
*)
647-
Admitted.
648-
649-
Lemma linfun_valP f (Pf : f \in linfun) : linfun_Sub Pf = f :> (_ -> _).
650-
Proof. by []. Qed.
651-
652-
HB.instance Definition _ := isSub.Build _ _ T linfun_rect linfun_valP.
653-
654-
Lemma linfuneqP (f g : {linear E -> F | s}) : f = g <-> f =1 g.
655-
Proof. by split=> [->//|fg]; apply/val_inj/funext. Qed.
656-
657-
HB.instance Definition _ := [Choice of {linear E -> F | s} by <:].
658-
659-
Variant linfun_spec (f : E -> F) : (E -> F) -> bool -> Type :=
660-
| Islinfun (l : {linear E -> F | s}) : linfun_spec f l true.
661-
662-
(*to be renamed ?*)
663-
Lemma linfunE (f : E -> F) : (f \in linfun) -> linfun_spec f f (f \in linfun).
664-
Proof.
665-
move=> /[dup] f_lc ->.
666-
have {2}-> :(f = (linfun_Sub f_lc)) by rewrite linfun_valP.
667-
constructor.
668-
Qed.
669-
670-
End linfun.
671-
672-
Section linfun_comp.
673-
674-
Context {R : numDomainType} {E F : lmodType R}
675-
{S : lmodType R} {s : GRing.Scale.law R S}
676-
(f : {linear E -> F}) (g : {linear F -> S | s}).
677-
678-
Lemma linfun_comp_subproof : linear_for s (g \o f).
679-
Proof. by move=> *; move=> */=; rewrite !linearP. Qed.
680-
681-
HB.instance Definition _ := @GRing.isLinear.Build R E S s (g \o f)
682-
linfun_comp_subproof.
683-
(* HB warning : no new instance generated but before we have
684-
Fail Check ( (g \o f) : {linear E -> F | s}). ? *)
685-
686-
End linfun_comp.
687-
688-
Section linfun_lmodtype.
689-
Context {R : numFieldType} {E F G: lmodType R}.
690-
691-
Implicit Types (r : R) (f g : {linear E -> F}) (h : {linear F -> G}).
692-
693-
Import GRing.Theory.
694-
695-
Lemma linfun0 : (\0 : {linear E -> F}) =1 cst 0 :> (_ -> _). Proof. by []. Qed.
696-
697-
Lemma linfun_submod_closed : submod_closed (@linfun R E F *:%R).
698-
Proof.
699-
split; first by rewrite inE; apply/linearP.
700-
move=> r /= _ _ /linfunE[f] /linfunE[g].
701-
by rewrite inE /=; exact: linearP.
702-
Qed.
703-
704-
HB.instance Definition _ :=
705-
@GRing.isSubmodClosed.Build _ _ linfun linfun_submod_closed.
706-
707-
HB.instance Definition _ :=
708-
[SubChoice_isSubLmodule of {linear E -> F } by <:].
709-
710-
End linfun_lmodtype.
711-
712-
713606
HB.structure Definition LinearContinuous (K : numDomainType) (E : NbhsLmodule.type K)
714607
(F : NbhsZmodule.type) (s : K -> F -> F) :=
715608
{f of @GRing.Linear K E F s f & @Continuous E F f }.

0 commit comments

Comments
 (0)