(* This program 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 2.1   *)
(* of the License, or (at your option) any later version.             *)
(*                                                                    *)
(* This program 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      *)
(* GNU General Public License for more details.                       *)
(*                                                                    *)
(* You should have received a copy of the GNU Lesser General Public   *)
(* License along with this program; if not, write to the Free         *)
(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *)
(* 02110-1301 USA                                                     *)
Record Trajectory : Type := mkTrajectory
{x : Differential;
y : Differential;
theta : Differential;
phi : Differential;
h : TypeSpeed;
cond_x :
forall t : R, derive_pt x t (cond_diff x t) = (h * cos (theta t))%R;
cond_y :
forall t : R, derive_pt y t (cond_diff y t) = (h * sin (theta t))%R;
cond_phi : forall t : R, (- MaxBank <= phi t <= MaxBank)%R;
cond_theta :
forall t : R,
derive_pt theta t (cond_diff theta t) = (g * (tan (phi t) / h))%R}.
Record EvaderTrajectory : Type := mkEvaderTrajectory
{tr : Trajectory;
tr_cond1 : forall t : R, x tr t = (x tr 0 + h tr * t)%R;
tr_cond2 : forall t : R, y tr t = y tr 0%R;
tr_cond3 : forall t : R, theta tr t = 0%R;
tr_cond4 : forall t : R, phi tr t = 0%R}.
intro; reg.
Qed.
intro; reg.
Qed.
intros; reg.
rewrite cos_0; ring.
Qed.
intros; reg.
rewrite sin_0; ring.
Qed.
intros; simpl in |- *; cut (0 < MaxBank)%R.
split.
left; rewrite <- Ropp_0; apply Ropp_lt_gt_contravar; assumption.
left; assumption.
unfold MaxBank in |- *; unfold Rdiv in |- *; apply Rmult_lt_0_compat;
[ prove_sup | apply Rinv_0_lt_compat; prove_sup ].
Qed.
intro; reg.
Qed.
intros; reg.
unfold Rdiv in |- *; rewrite tan_0; ring.
Qed.
(**********)
Definition init_tr (h : TypeSpeed) : Trajectory :=
mkTrajectory
(mkDifferential (fun t : R => (h * t)%R) (init_tr_derivable_x h))
(mkDifferential (fun t : R => 0%R) (init_tr_derivable_y h))
(mkDifferential (fun t : R => 0%R) (init_tr_derivable_y h))
(mkDifferential (fun t : R => 0%R) (init_tr_derivable_y h)) h
(init_tr_cond_x h) (init_tr_cond_y h) init_tr_cond_phi
(init_tr_cond_theta h).
split.
unfold MaxBank in |- *; unfold Rdiv in |- *; apply Rmult_lt_0_compat;
[ prove_sup | apply Rinv_0_lt_compat; prove_sup ].
apply Rlt_trans with (PI_lb / 4)%R.
unfold MaxBank in |- *; unfold Rdiv in |- *; apply Rmult_lt_reg_l with 100%R.
prove_sup0.
rewrite <- Rmult_comm; rewrite Rmult_assoc; rewrite <- Rinv_l_sym.
rewrite Rmult_1_r; apply Rmult_lt_reg_l with 4%R.
prove_sup.
repeat rewrite (Rmult_comm 4); repeat rewrite Rmult_assoc;
rewrite <- Rinv_l_sym.
unfold PI_lb in |- *; prove_sup.
discrR.
discrR.
unfold Rdiv in |- *; repeat rewrite <- (Rmult_comm (/ 4));
apply Rmult_lt_compat_l.
apply Rinv_0_lt_compat; prove_sup.
elim PI_approx; trivial.
Qed.

(**********)
Lemma dtheta_rho :
forall (tr : Trajectory) (t : R),
(- rho (h tr) <= derive_pt (theta tr) t (cond_diff (theta tr) t) <=
rho (h tr))%R.