(** 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 aims at proving that d'Alembert's formula defines a function that is solution to the one-dimensional wave equation. We also need to prove the regularity of this function. *)
Local Open Scope R_scope.
Ltac auto_derive_2 :=
match goal with
| |- is_derive_n ?f 2 ?x ?d =>
auto_derive_fun f ;
match goal with
| |- (forall x, _ -> is_derive _ x (@?d x)) -> _ =>
let H := fresh "H" in
let u := fresh "u" in
intro H ;
apply (is_derive_ext d) ;
[ intro u ;
apply sym_eq, is_derive_unique ;
apply H
| auto_derive ] ;
clear H
end
end.
Section DAlembert.
Parameter c : R.
Hypothesis Zc : c <> 0.
Parameter u0 : R -> R.
Hypothesis Du0 : forall x, ex_derive (fun u => u0 u) x.
Hypothesis D2u0 : forall x, ex_derive_n (fun u => u0 u) 2 x.
Section Alpha.
Definition alpha x t := 1/2 * (u0 (x + c * t) + u0 (x - c * t)).
Definition alpha20 x t := 1/2 * (Derive_n u0 2 (x + c * t) + Derive_n u0 2 (x - c * t)).
Definition alpha02 x t := c^2/2 * (Derive_n u0 2 (x + c * t) + Derive_n u0 2 (x - c * t)).

Lemma alpha_02_lim :
forall x t, is_derive_n (fun u => alpha x u) 2 t (alpha02 x t).