(* 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                                                     *)
Unset Standard Proposition Elimination Names.
Fixpoint rest (p r s n : nat) {struct n} : nat :=
match n with
| O => r
| S n' =>
match s with
| O => 0
| S O => rest p 0 p n'
| S s' => rest p (S r) s' n'
end
end.
Definition mod_ (m n : nat) : nat := rest n 0 n m.
Proof with trivial.
intro m; unfold mod_ in |- *; unfold rest in |- *...
Qed.
Definition trkrate (phi : Bank) : R :=
toDeg (g * (tand phi / v intruderSpeed)).
left; rewrite <- Ropp_0; apply Ropp_lt_gt_contravar; unfold toDeg in |- *;
repeat simple apply Rmult_lt_0_compat.
unfold MaxBank in |- *; unfold Rdiv in |- *; apply Rmult_lt_0_compat.
prove_sup.
apply Rinv_0_lt_compat; prove_sup.
unfold plat in |- *; prove_sup.
apply Rinv_0_lt_compat; apply PI_RGT_0.
Qed.
left; unfold toDeg in |- *; repeat simple apply Rmult_lt_0_compat.
unfold MaxBank in |- *; unfold Rdiv in |- *; apply Rmult_lt_0_compat.
prove_sup.
apply Rinv_0_lt_compat; prove_sup.
unfold plat in |- *; prove_sup.
apply Rinv_0_lt_compat; apply PI_RGT_0.
Qed.
Proof with trivial.
unfold trkrate in |- *; replace (r (mkBank 0 cond1_0 cond2_0)) with 0%R...
unfold toDeg, tand in |- *; unfold toRad in |- *; repeat rewrite Rmult_0_l;
rewrite tan_0; unfold Rdiv in |- *; repeat rewrite Rmult_assoc;
repeat rewrite Rmult_0_l; apply Rmult_0_r...
Qed.
Definition distance (s1 s2 : State) : R :=
sqrt (Rsqr (xt s2 - xt s1) + Rsqr (yt s2 - yt s1)).

Lemma distance_sym : forall s1 s2 : State, distance s1 s2 = distance s2 s1.