(** This file is part of the Coquelicot formalization of real analysis in Coq: http://coquelicot.saclay.inria.fr/  Copyright (C) 2011-2015 Sylvie Boldo #<br /># Copyright (C) 2011-2015 Catherine Lelay #<br /># Copyright (C) 2011-2015 Guillaume Melquiond  This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.  This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the COPYING file for more details. *)
(** This file describes improper integrals, such as integrals with an infinity endpoint or integrals of a function with a singularity. A few properties are given: Chasles, operations, composition, derivation.*)
Open Scope R_scope.
(** * Improper Riemann integral *)
Section is_RInt_gen.
Context {V : NormedModule R_AbsRing}.
Definition is_RInt_gen (f : R -> V) (Fa Fb : (R -> Prop) -> Prop) (l : V) :=
filterlimi (fun ab => is_RInt f (fst ab) (snd ab)) (filter_prod Fa Fb) (locally l).
Definition ex_RInt_gen (f : R -> V) (Fa Fb : (R -> Prop) -> Prop) :=
exists l : V, is_RInt_gen f Fa Fb l.
Definition is_RInt_gen_at_point f a b l :
is_RInt_gen f (at_point a) (at_point b) l
<-> is_RInt f a b l.
(** * Basic properties of integrals *)

(* Specifications: *)
Lemma is_RInt_gen_ext {Fa Fb : (R -> Prop) -> Prop}
{FFa : Filter Fa} {FFb : Filter Fb} (f g : R -> V) (l : V) :
filter_prod Fa Fb (fun ab => forall x, Rmin (fst ab) (snd ab) < x < Rmax (fst ab) (snd ab)
-> f x = g x) ->
is_RInt_gen f Fa Fb l -> is_RInt_gen g Fa Fb l.
Lemma ex_RInt_gen_ext {Fa Fb : (R -> Prop) -> Prop}
{FFa : Filter Fa} {FFb : Filter Fb} (f g : R -> V) :
filter_prod Fa Fb (fun ab => forall x, Rmin (fst ab) (snd ab) < x < Rmax (fst ab) (snd ab)
-> f x = g x) ->
ex_RInt_gen f Fa Fb -> ex_RInt_gen g Fa Fb.
Lemma ex_RInt_gen_ext_eq {Fa Fb : (R -> Prop) -> Prop}
{FFa : Filter Fa} {FFb : Filter Fb} (f g : R -> V) :
(forall x, f x = g x) -> ex_RInt_gen f Fa Fb -> ex_RInt_gen g Fa Fb.
Lemma is_RInt_gen_point (f : R -> V) (a : R) :
is_RInt_gen f (at_point a) (at_point a) zero.
Lemma is_RInt_gen_swap {Fa Fb : (R -> Prop) -> Prop}
{FFa : Filter Fa} {FFb : Filter Fb} (f : R -> V) (l : V) :
is_RInt_gen f Fb Fa l -> is_RInt_gen f Fa Fb (opp l).
Lemma is_RInt_gen_Chasles {Fa Fc : (R -> Prop) -> Prop}
{FFa : Filter Fa} {FFc : Filter Fc}
(f : R -> V) (b : R) (l1 l2 : V) :
is_RInt_gen f Fa (at_point b) l1 -> is_RInt_gen f (at_point b) Fc l2
-> is_RInt_gen f Fa Fc (plus l1 l2).