@@ -224,7 +224,7 @@ Section diff_locally_converse_tentative.
224224(* and thus a littleo of 1, and so is id  *) 
225225(* This can be generalized to any dimension  *) 
226226Lemma  diff_locally_converse_part1 (f : R -> R) (a b x : R) :
227-   f \o shift x = cst a + b *: idfun +o_ 0 id -> f x = a.
227+   f \o shift x = cst a + b *: (@ idfun R)  +o_ 0 id -> f x = a.
228228Proof .
229229rewrite funeqE => /(_ 0) /=; rewrite add0r => ->.
230230by rewrite -[LHS]/(_ 0 + _ 0 + _ 0) /cst [X in a + X]scaler0 littleo_lim0 ?addr0.
@@ -253,12 +253,12 @@ Lemma derivable_nbhs (f : V -> W) a v :
253253Proof .
254254move=> df; apply/eqaddoP => _/posnumP[e].
255255rewrite -nbhs_nearE nbhs_simpl /= dnbhsE; split; last first.
256-   rewrite /at_point opprD -![(_ + _ : _ -> _) _]/(_ + _)  scale0r add0r.
256+   rewrite /at_point opprD !add_funE !opp_funE/=  scale0r add0r.
257257  by rewrite addrA subrr add0r normrN scale0r !normr0 mulr0.
258258have /eqolimP := df.
259259move=> /eqaddoP /(_ e%:num) /(_ [gt0 of e%:num]).
260260apply: filter_app; rewrite /= !near_simpl near_withinE; near=> h => hN0.
261- rewrite /= opprD -![(_ + _ : _ -> _) _]/(_ + _) -![(- _ : _ -> _) _]/(- _) .
261+ rewrite /= opprD !add_funE !opp_funE .
262262rewrite /cst /= [`|1|]normr1 mulr1 => dfv.
263263rewrite addrA -[X in X + _]scale1r -(@mulVf _ h) //.
264264rewrite mulrC -scalerA -scalerBr normrZ.
@@ -276,7 +276,7 @@ move=> df; apply/cvg_ex; exists ('D_v f a).
276276apply/(@eqolimP _ _ _ (dnbhs_filter_on _))/eqaddoP => _/posnumP[e].
277277have /eqaddoP /(_ e%:num) /(_ [gt0 of e%:num]) := df.
278278rewrite /= !(near_simpl, near_withinE); apply: filter_app; near=> h.
279- rewrite /= opprD -![(_ + _ : _ -> _) _]/(_ + _) -![(- _ : _ -> _) _]/(- _) .
279+ rewrite /= opprD !add_funE !opp_funE .
280280rewrite /cst /= [`|1|]normr1 mulr1 addrA => dfv hN0.
281281rewrite -[X in _ - X]scale1r -(@mulVf _ h) //.
282282rewrite -scalerA -scalerBr normrZ normfV ler_pdivrMl ?normr_gt0 //.
@@ -398,7 +398,7 @@ Variable R : numFieldType.
398398Fact  dcst (V W : normedModType R) (a : W) (x : V) : continuous (0 : V -> W) /\
399399  cst a \o shift x = cst (cst a x) + \0 +o_ 0 id.
400400Proof .
401- split; first exact: cst_continuous.
401+ split; first exact: (@ cst_continuous _ _ 0) .
402402apply/eqaddoE; rewrite addr0 funeqE => ? /=; rewrite -[LHS]addr0; congr (_ + _).
403403by rewrite littleoE; last exact: littleo0_subproof.
404404Qed .
@@ -412,7 +412,7 @@ Fact dadd (f g : V -> W) x :
412412Proof .
413413move=> df dg; split => [?|]; do ?exact: continuousD.
414414apply/(@eqaddoE R); rewrite funeqE => y /=; rewrite -[(f + g) _]/(_ + _).
415- by rewrite ![_ (_ + x)]diff_locallyx// addrACA addox addrACA.
415+ by rewrite add_funE  ![_ (_ + x)]diff_locallyx// addrACA addox addrACA.
416416Qed .
417417
418418Fact  dopp (f : V -> W) x :
@@ -521,8 +521,8 @@ Lemma diff_unique (V W : normedModType R) (f : V -> W)
521521  continuous df -> f \o shift x = cst (f x) + df +o_ 0 id ->
522522  'd f x = df :> (V -> W).
523523Proof .
524- move=> dfc dxf; apply/subr0_eq; rewrite -[LHS]/(_ \- _) .
525- apply/littleo_linear0/eqoP/ eq_some_oP => /=; rewrite funeqE => y /=.
524+ move=> dfc dxf; apply/subr0_eq/(littleo_linear0 (f:=GRing.sub_fun _ _))/eqoP .
525+ apply/eq_some_oP => /=; rewrite funeqE => y /=.
526526have hdf h : (f \o shift x = cst (f x) + h +o_ 0 id) ->
527527    h = f \o shift x - cst (f x) +o_ 0 id.
528528  move=> hdf; apply: eqaddoE.
@@ -544,7 +544,7 @@ by rewrite littleo_center0 (comp_centerK x id) -[- _ in RHS](comp_centerK x).
544544Qed .
545545
546546Lemma  diff_cst (V W : normedModType R) a x : ('d (cst a) x : V -> W) = 0.
547- Proof . by apply/diff_unique; have [] := dcst a x. Qed .
547+ Proof . by apply/( diff_unique (df:=\0)) ; have [] := dcst a x. Qed .
548548
549549Variables  (V W : normedModType R).
550550
@@ -558,7 +558,10 @@ Proof. exact: DiffDef (differentiable_cst _ _) (diff_cst _ _). Qed.
558558Lemma  diffD (f g : V -> W) x :
559559  differentiable f x -> differentiable g x ->
560560  'd (f + g) x = 'd f x \+ 'd g x :> (V -> W).
561- Proof . by move=> df dg; apply/diff_unique; have [] := dadd df dg. Qed .
561+ Proof .
562+ move=> df dg.
563+ by apply/(diff_unique (df:=GRing.add_fun _ _)); have [] := dadd df dg.
564+ Qed .
562565
563566Lemma  differentiableD (f g : V -> W) x :
564567  differentiable f x -> differentiable g x -> differentiable (f + g) x.
576579Lemma  differentiable_sum n (f : 'I_n -> V -> W) (x : V) :
577580  (forall  i, differentiable (f i) x) -> differentiable (\sum_(i < n) f i) x.
578581Proof .
579- by elim/big_ind : _ => // ? ? g h ?; apply: differentiableD; [exact:g|exact:h].
582+ elim/big_ind : _ => //[_|? ? g h ?]; first exact/(@differentiable_cst _ 0).
583+ apply: differentiableD; [exact:g|exact:h].
580584Qed .
581585
582586Lemma  diffN (f : V -> W) x :
@@ -614,7 +618,10 @@ Proof. by move=> /differentiableP df /differentiableP dg. Qed.
614618
615619Lemma  diffZ (f : V -> W) k x :
616620  differentiable f x -> 'd (k *: f) x = k \*: 'd f x :> (V -> W).
617- Proof . by move=> df; apply/diff_unique; have [] := dscale k df. Qed .
621+ Proof .
622+ move=> df.
623+ by apply/(diff_unique (df:=GRing.scale_fun _ _)); have [] := dscale k df.
624+ Qed .
618625
619626Lemma  differentiableZ (f : V -> W) k x :
620627  differentiable f x -> differentiable (k *: f) x.
@@ -1152,7 +1159,7 @@ Global Instance is_derive_sum n (h : 'I_n -> V -> W) (x v : V)
11521159  (dh : 'I_n -> W) : (forall i, is_derive x v (h i) (dh i)) ->
11531160  is_derive x v (\sum_(i < n) h i) (\sum_(i < n) dh i).
11541161Proof .
1155- by elim/big_ind2 : _ => // [|] *; [exact:  is_derive_cst|exact: is_deriveD].
1162+ by elim/big_ind2 : _ => // [|] *; [exact/( is_derive_cst 0) |exact: is_deriveD].
11561163Qed .
11571164
11581165Lemma  derivable_sum n (h : 'I_n -> V -> W) (x v : V) :
@@ -1324,7 +1331,10 @@ by rewrite [in LHS]mulr_natl exprfctE -mulrSr mulr_natl.
13241331Qed .
13251332
13261333Lemma  derivableX f n (x v : V) : derivable f x v -> derivable (f ^+ n) x v.
1327- Proof . by case: n => [_|n /derivableP]; [rewrite expr0|]. Qed .
1334+ Proof .
1335+ case: n => [_|n /derivableP]; last by [].
1336+ by rewrite expr0; apply/(derivable_cst (1 : R)).
1337+ Qed .
13281338
13291339Lemma  deriveX f n (x v : V) : derivable f x v ->
13301340  'D_v (f ^+ n.+1) x = (n.+1%:R * f x ^+ n) *: 'D_v f x.
@@ -1378,7 +1388,7 @@ Proof. by rewrite derive1E derive_cst. Qed.
13781388Lemma  exprn_derivable {R : numFieldType} n (x : R) v :
13791389  derivable (@GRing.exp R ^~ n) x v.
13801390Proof .
1381- elim: n => [/=|n ih]; first by rewrite (_ : _ ^~ _ = 1).
1391+ elim: n => [/=|n ih]; first by rewrite (_ : _ ^~ _ = cst  1).
13821392rewrite (_ : _ ^~ _ = (fun x => x * x ^+ n)); last first.
13831393  by apply/funext => y; rewrite exprS.
13841394by apply: derivableM; first exact: derivable_id.
@@ -1573,7 +1583,7 @@ have gcont : {within `[a, b], continuous g}.
15731583  move=> x; apply: continuousD _ ; first by move=>?; exact: fcont.
15741584  by apply/continuousN/continuous_subspaceT=> ?; exact: scalel_continuous.
15751585have gaegb : g a = g b.
1576-   rewrite /g -![(_ - _ : _ -> _) _]/(_ - _) .
1586+   rewrite /g !add_funE !opp_funE .
15771587  apply/eqP; rewrite -subr_eq /= opprK addrAC -addrA -scalerBl.
15781588  rewrite [_ *: _]mulrA mulrC mulrA mulVf.
15791589    by rewrite mul1r addrCA subrr addr0.
0 commit comments