Section trajectory.
Unset Standard Proposition Elimination Names.
Variable intr : Trajectory.
Variable evad : EvaderTrajectory.
Variable T : TimeT.
unfold thetat in |- *; apply (cond_diff (theta intr)).
Qed.
Definition xe : R := x (tr evad) T.
Definition ye : R := y (tr evad) T.
Definition ve : R := v (h (tr evad)).
Definition r_vi : R := r (vi intr).
Definition rho_vi : R := rho (vi intr).
Definition Die (ti te : R) : R :=
sqrt
(Rsqr (xi intr ti - x (tr evad) te) + Rsqr (yi intr ti - y (tr evad) te)).
Definition conflict (t : R) : bool :=
match Rle_dec (Die t t) ConflictRange with
| left _ => true
| right _ => false
end.
intro; unfold xi, vi, thetat in |- *.
assert (H := cond_x intr t).
rewrite <- H.
apply pr_nu.
Qed.
intro; unfold yi, vi, thetat in |- *.
assert (H := cond_y intr t).
rewrite <- H.
apply pr_nu.
Qed.
Definition l : R := Die 0 T.
Definition d : R := Die 0 0.
Axiom
beta_exists :
{ beta : R |
xe = (l * cos beta + xi intr 0)%R /\
ye = (yi intr 0 - l * sin beta)%R /\
(0 <= beta + thetat intr 0 < 2 * PI)%R }.
Definition beta := let (a,_) := beta_exists in a.
unfold beta in |- *; case beta_exists; trivial.
Qed.
Definition Omega (a : R) : bool :=
match Rle_dec (PI / 2) a with
| left _ =>
match Rle_dec a (3 * (PI / 2)) with
| left _ => true
| right _ => false
end
| right _ => false
end.
Proof with trivial.
generalize beta_def; intro; elim H...
Qed.
Proof with trivial.
generalize beta_def; intro; elim H; intros _ H0; elim H0...
Qed.
Proof with trivial.
unfold d in |- *; unfold Die in |- *; rewrite Rsqr_sqrt...
replace (xi intr 0 - x (tr evad) 0)%R with
(xi intr 0 - xe + (xe - x (tr evad) 0))%R...
replace (yi intr 0 - y (tr evad) 0)%R with
(yi intr 0 - ye + (ye - y (tr evad) 0))%R...
repeat rewrite Rsqr_plus; cut ((ye - y (tr evad) 0)%R = 0%R)...
intro; rewrite H; repeat rewrite Rmult_0_r; rewrite Rsqr_0;
repeat rewrite Rplus_0_r; cut ((xe - x (tr evad) 0)%R = (ve * T)%R)...
intro; rewrite H0;
replace
(Rsqr (xi intr 0 - xe) + Rsqr (ve * T) + 2 * (xi intr 0 - xe) * (ve * T) +
Rsqr (yi intr 0 - ye))%R with
(Rsqr (ve * T) + (Rsqr (xi intr 0 - xe) + Rsqr (yi intr 0 - ye)) +
2 * (xi intr 0 - xe) * (ve * T))%R...
cut (Rsqr l = (Rsqr (xi intr 0 - xe) + Rsqr (yi intr 0 - ye))%R)...
intro; rewrite <- H1; rewrite xe_0; ring...
unfold l in |- *; unfold Die in |- *; rewrite Rsqr_sqrt;
[ unfold xe, ye in |- * | apply Rplus_le_le_0_compat; apply Rle_0_sqr ]...
ring...
unfold xe, ve in |- *; rewrite (tr_cond1 evad); ring...
unfold ye, ve in |- *; rewrite (tr_cond2 evad); unfold Rminus in |- *;
rewrite Rplus_opp_r...
ring...
ring...
apply Rplus_le_le_0_compat; apply Rle_0_sqr...
Qed.
Definition yp (t : R) : R :=
(- sin (thetat intr 0) * (xi intr t - xe) +
cos (thetat intr 0) * (yi intr t - ye))%R.
Hint Resolve xi_derivable yi_derivable: diff.
unfold yp in |- *; set (thetat_p := thetat intr); set (xi_p := xi intr);
set (yi_p := yi intr); reg.
apply (yi_derivable intr).
apply (xi_derivable intr).
Qed.
Hint Resolve yp_derivable: diff.
Definition xp (t : R) : R :=
(cos (thetat intr 0) * (xi intr t - xe) +
sin (thetat intr 0) * (yi intr t - ye))%R.
unfold xp in |- *; set (thetat_p := thetat intr); set (xi_p := xi intr);
set (yi_p := yi intr); reg.
apply (yi_derivable intr).
apply (xi_derivable intr).
Qed.
Hint Resolve xp_derivable: diff.
Definition Rsqr_evader_distance (t : R) : R :=
(Rsqr (xi intr t - xe) + Rsqr (yi intr t - ye))%R.
unfold Rsqr_evader_distance in |- *.
set (xi_p := xi intr); set (yi_p := yi intr); reg.
apply (yi_derivable intr).
apply (xi_derivable intr).
Qed.
Hint Resolve Rsqr_evader_distance_derivable: diff.
Definition Rsqr_intruder_distance (t : R) : R :=
(Rsqr (xi intr t - xi intr 0) + Rsqr (yi intr t - yi intr 0))%R.
unfold Rsqr_intruder_distance in |- *; set (xi_p := xi intr);
set (yi_p := yi intr); reg.
apply (yi_derivable intr).
apply (xi_derivable intr).
Qed.
Hint Resolve Rsqr_intruder_distance_derivable: diff.
intro; unfold Rsqr_evader_distance in |- *; apply Rplus_le_le_0_compat;
apply Rle_0_sqr.
Qed.
intro; unfold Rsqr_intruder_distance in |- *; apply Rplus_le_le_0_compat;
apply Rle_0_sqr.
Qed.
Definition e (t : R) : R := sqrt (Rsqr_evader_distance t).
Definition i (t : R) : R := sqrt (Rsqr_intruder_distance t).
Proof with trivial.
unfold conflict in |- *; cut (e T = Die T T)...
intro; case (Rle_dec (Die T T) ConflictRange); intros;
[ rewrite H; exact r | elim diff_false_true ]...
Qed.
Proof with trivial.
intro; cut (e T = Die T T)...
intro; rewrite H0 in H; unfold conflict in |- *;
case (Rle_dec (Die T T) ConflictRange); intro...
elim n; assumption...
Qed.
rewrite xe_0; rewrite ye_0; unfold Rminus in |- *;
rewrite <- (Rplus_comm (- (l * sin beta))); repeat rewrite Rplus_assoc;
repeat rewrite Rplus_opp_r; repeat rewrite Rplus_0_r;
rewrite <- Rsqr_neg; repeat rewrite Rsqr_mult;
rewrite <- (Rmult_comm (Rsqr (sin beta))); rewrite sin2;
unfold Rminus in |- *; rewrite Rmult_plus_distr_r;
ring.
Qed.
intro; apply Rsqr_incr_0.
rewrite Rsqr_plus.
cut
(Rsqr l =
(Rsqr (e t) + Rsqr (i t) +
2 *
((xe - xi intr t) * (xi intr t - xi intr 0) +
(ye - yi intr t) * (yi intr t - yi intr 0)))%R).
intro.
rewrite H.
apply Rplus_le_compat_l.
repeat rewrite Rmult_assoc.
apply Rmult_le_compat_l.
left; prove_sup0.
unfold e, i in |- *.
unfold Rsqr_evader_distance, Rsqr_intruder_distance in |- *.
rewrite (Rsqr_neg (xi intr t - xe)).
rewrite (Rsqr_neg (yi intr t - ye)).
replace (- (xi intr t - xe))%R with (xe - xi intr t)%R.
replace (- (yi intr t - ye))%R with (ye - yi intr t)%R.
apply sqrt_cauchy.
ring.
ring.
rewrite L.
unfold e, i in |- *.
repeat rewrite Rsqr_sqrt.
unfold Rsqr_evader_distance, Rsqr_intruder_distance in |- *.
replace (xe - xi intr 0)%R with (xe - xi intr t + (xi intr t - xi intr 0))%R.
replace (ye - yi intr 0)%R with (ye - yi intr t + (yi intr t - yi intr 0))%R.
repeat rewrite Rsqr_plus.
rewrite (Rsqr_neg (xe - xi intr t)).
rewrite (Rsqr_neg (ye - yi intr t)).
replace (- (xe - xi intr t))%R with (xi intr t - xe)%R.
replace (- (ye - yi intr t))%R with (yi intr t - ye)%R.
ring.
ring.
ring.
ring.
ring.
apply Rsqr_intruder_distance_pos.
apply Rsqr_evader_distance_pos.
unfold l in |- *; unfold Die in |- *.
apply sqrt_positivity.
apply Rplus_le_le_0_compat; apply Rle_0_sqr.
unfold e, i in |- *; apply Rplus_le_le_0_compat; apply sqrt_positivity.
apply Rsqr_evader_distance_pos.
apply Rsqr_intruder_distance_pos.
Qed.
unfold l in |- *; unfold Die in |- *; apply sqrt_positivity;
apply Rplus_le_le_0_compat; apply Rle_0_sqr.
Qed.
intro.
apply Rsqr_incr_0.
rewrite Rsqr_plus.
cut
(Rsqr (e t) =
(Rsqr l + Rsqr (i t) +
2 *
((xi intr t - xi intr 0) * (xi intr 0 - xe) +
(yi intr t - yi intr 0) * (yi intr 0 - ye)))%R).
intro.
rewrite H.
apply Rplus_le_compat_l.
repeat rewrite Rmult_assoc.
apply Rmult_le_compat_l.
left; prove_sup0.
cut (l = sqrt (Rsqr (xe - xi intr 0) + Rsqr (ye - yi intr 0))).
intro.
rewrite H0.
unfold i in |- *.
unfold Rsqr_intruder_distance in |- *.
rewrite (Rsqr_neg (xe - xi intr 0)).
rewrite (Rsqr_neg (ye - yi intr 0)).
replace (- (xe - xi intr 0))%R with (xi intr 0 - xe)%R.
replace (- (ye - yi intr 0))%R with (yi intr 0 - ye)%R.
rewrite <-
(Rmult_comm
(sqrt (Rsqr (xi intr t - xi intr 0) + Rsqr (yi intr t - yi intr 0))))
.
apply sqrt_cauchy.
ring.
ring.
apply Rsqr_inj.
apply l_is_pos.
apply sqrt_positivity; apply Rplus_le_le_0_compat; apply Rle_0_sqr.
rewrite Rsqr_sqrt.
apply L.
apply Rplus_le_le_0_compat; apply Rle_0_sqr.
rewrite L.
unfold e, i in |- *.
repeat rewrite Rsqr_sqrt.
unfold Rsqr_evader_distance, Rsqr_intruder_distance in |- *.
replace (xi intr t - xe)%R with (xi intr t - xi intr 0 + (xi intr 0 - xe))%R.
replace (yi intr t - ye)%R with (yi intr t - yi intr 0 + (yi intr 0 - ye))%R.
repeat rewrite Rsqr_plus.
rewrite (Rsqr_neg (xe - xi intr 0)).
rewrite (Rsqr_neg (ye - yi intr 0)).
replace (- (xe - xi intr 0))%R with (xi intr 0 - xe)%R.
replace (- (ye - yi intr 0))%R with (yi intr 0 - ye)%R.
ring.
ring.
ring.
ring.
ring.
apply Rsqr_intruder_distance_pos.
apply Rsqr_evader_distance_pos.
unfold e in |- *.
apply sqrt_positivity.
apply Rsqr_evader_distance_pos.
apply Rplus_le_le_0_compat.
apply l_is_pos.
unfold i in |- *.
apply sqrt_positivity.
apply Rsqr_intruder_distance_pos.
Qed.
intro.
apply Rsqr_incr_0.
rewrite Rsqr_plus.
cut
(Rsqr (i t) =
(Rsqr l + Rsqr (e t) +
2 *
((xi intr t - xe) * (xe - xi intr 0) + (yi intr t - ye) * (ye - yi intr 0)))%R).
intro.
rewrite H.
apply Rplus_le_compat_l.
repeat rewrite Rmult_assoc.
apply Rmult_le_compat_l.
left; prove_sup0.
cut (l = sqrt (Rsqr (xe - xi intr 0) + Rsqr (ye - yi intr 0))).
intro.
rewrite H0.
unfold e in |- *.
unfold Rsqr_evader_distance in |- *.
rewrite <-
(Rmult_comm (sqrt (Rsqr (xi intr t - xe) + Rsqr (yi intr t - ye))))
.
apply sqrt_cauchy.
apply Rsqr_inj.
apply l_is_pos.
apply sqrt_positivity; apply Rplus_le_le_0_compat; apply Rle_0_sqr.
rewrite Rsqr_sqrt.
apply L.
apply Rplus_le_le_0_compat; apply Rle_0_sqr.
rewrite L.
unfold e, i in |- *.
repeat rewrite Rsqr_sqrt.
unfold Rsqr_evader_distance, Rsqr_intruder_distance in |- *.
replace (xi intr t - xi intr 0)%R with (xi intr t - xe + (xe - xi intr 0))%R.
replace (yi intr t - yi intr 0)%R with (yi intr t - ye + (ye - yi intr 0))%R.
repeat rewrite Rsqr_plus.
ring.
ring.
ring.
apply Rsqr_evader_distance_pos.
apply Rsqr_intruder_distance_pos.
unfold i in |- *.
apply sqrt_positivity.
apply Rsqr_intruder_distance_pos.
apply Rplus_le_le_0_compat.
apply l_is_pos.
unfold e in |- *.
apply sqrt_positivity.
apply Rsqr_evader_distance_pos.
Qed.
Proof with trivial.
generalize (dtheta_rho intr); intros; split...
unfold thetat in |- *; cut (derivable (fun y : R => (- rho_vi * y)%R));
[ intro X | reg ]...
cut
(forall z : R,
derive_pt (fun y : R => (- rho_vi * y)%R) z (X z) = (- rho_vi)%R);
[ intro | intro; reg ]...
apply Rplus_le_reg_l with (- theta intr 0)%R...
replace (- theta intr 0 + (theta intr 0 - rho_vi * t))%R with
(- rho_vi * t - - rho_vi * 0)%R; [ idtac | ring ]...
replace (- theta intr 0 + theta intr t)%R with
(theta intr t - theta intr 0)%R; [ idtac | ring ]...
apply
(IAF_var (theta intr) (fun y : R => (- rho_vi * y)%R) 0 t
(cond_diff (theta intr)) X H0)...
intros; rewrite (H1 c); unfold rho_vi in |- *; unfold vi in |- *; elim (H c);
intros H4 _; assumption...
unfold thetat in |- *; cut (derivable (fun y : R => (rho_vi * y)%R));
[ intro X | reg ]...
cut (forall z : R, derive_pt (fun y : R => (rho_vi * y)%R) z (X z) = rho_vi);
[ intro | intro; reg ]...
apply Rplus_le_reg_l with (- theta intr 0)%R...
replace (- theta intr 0 + (theta intr 0 + rho_vi * t))%R with
(rho_vi * t - rho_vi * 0)%R; [ idtac | ring ]...
replace (- theta intr 0 + theta intr t)%R with
(theta intr t - theta intr 0)%R; [ idtac | ring ]...
apply
(IAF_var (fun y : R => (rho_vi * y)%R) (theta intr) 0 t X
(cond_diff (theta intr)) H0)...
intros; rewrite (H1 c); unfold rho_vi in |- *; unfold vi in |- *; elim (H c)...
Qed.
Proof with trivial.
intros; apply Rmult_le_pos...
left; unfold rho_vi in |- *; apply rho_pos...
Qed.
Proof with trivial.
intros; apply Rmult_le_compat_l...
left; unfold rho_vi in |- *; apply rho_pos...
Qed.
intro; unfold yp in |- *.
assert (H := xi_derivable intr t).
assert (H0 := yi_derivable intr t).
assert (H1 := thetat_derivable t).
set (xi_p := xi intr) in H |- *.
set (yi_p := yi intr) in H0 |- *.
set (thetat_p := thetat intr) in H1 |- *.
reg.
assert (H2 := cond_x intr t).
assert (H3 := cond_y intr t).
replace (derive_pt xi_p t H) with
(derive_pt (x intr) t (cond_diff (x intr) t)); [ idtac | apply pr_nu ].
replace (derive_pt yi_p t H0) with
(derive_pt (y intr) t (cond_diff (y intr) t)); [ idtac | apply pr_nu ].
rewrite H2; rewrite H3.
rewrite sin_minus.
unfold fct_cte, vi, thetat_p, thetat in |- *.
ring.
Qed.
Proof with trivial.
intros...
rewrite Dyp...
generalize (theta_inv t H); intro; elim H1; intros...
cut (thetat intr t - thetat intr 0 <= rho_vi * t)%R...
cut (- (rho_vi * t) <= thetat intr t - thetat intr 0)%R...
intros...
split...
replace (- (vi intr * sin (rho_vi * t)))%R with
(vi intr * - sin (rho_vi * t))%R...
apply Rmult_le_compat_l...
left; apply TypeSpeed_pos...
rewrite <- (sin_neg (rho_vi * t))...
apply sin_incr_1...
apply Ropp_ge_le_contravar; apply Rle_ge...
apply Rle_trans with 0%R...
rewrite <- Ropp_0...
apply Ropp_ge_le_contravar; apply Rle_ge; apply (rho_t_pos t H)...
left; apply PI2_RGT_0...
apply Rle_trans with (- (rho_vi * t))%R...
apply Ropp_ge_le_contravar...
apply Rle_ge...
apply Rle_trans with (rho_vi * t)%R...
ring...
apply Rmult_le_compat_l...
left; apply TypeSpeed_pos...
apply sin_incr_1...
apply Rle_trans with (- (rho_vi * t))%R...
apply Ropp_ge_le_contravar; apply Rle_ge...
apply Rle_trans with (rho_vi * t)%R...
apply Rle_trans with 0%R...
rewrite <- Ropp_0; apply Ropp_ge_le_contravar; apply Rle_ge; left;
apply PI2_RGT_0...
apply (rho_t_pos t H)...
apply Rplus_le_reg_l with (thetat intr 0)...
unfold Rminus in |- *...
rewrite (Rplus_comm (thetat intr t))...
repeat rewrite <- Rplus_assoc...
rewrite Rplus_opp_r...
rewrite Rplus_0_l...
apply Rplus_le_reg_l with (thetat intr 0)...
unfold Rminus in |- *...
rewrite (Rplus_comm (thetat intr t))...
repeat rewrite <- Rplus_assoc...
rewrite Rplus_opp_r...
rewrite Rplus_0_l...
Qed.
unfold yp in |- *; rewrite xe_0; rewrite ye_0;
rewrite <- (Rplus_comm (xi intr 0)); unfold Rminus in |- *;
repeat rewrite Ropp_plus_distr; repeat rewrite <- Rplus_assoc;
repeat rewrite Rplus_opp_r; repeat rewrite Rplus_0_l;
rewrite sin_plus; ring.
Qed.
Definition hy (t : R) : R := (r_vi * cos (rho_vi * t))%R.
unfold hy in |- *; reg.
Qed.
Proof with trivial.
intro; unfold hy in |- *; reg...
replace (vi intr:R) with (r_vi * rho_vi)%R.
ring.
unfold rho_vi, r_vi in |- *; unfold r in |- *.
field.
assert (H := rho_pos (vi intr)); red in |- *; intro; rewrite H0 in H;
elim (Rlt_irrefl _ H)...
Qed.
Proof with trivial.
intros; split...
apply (IAF_var yp hy 0 t yp_derivable hy_derivable H)...
intros; elim H1; intros...
generalize
(Dyp0_PI2 c H2
(Rle_trans (rho_vi * c) (rho_vi * t) (PI / 2) (rho_t_le c t H3) H0));
intro...
elim H4; intros...
cut (derive_pt hy c (hy_derivable c) = (- (vi intr * sin (rho_vi * c)))%R)...
intro...
rewrite <- H7 in H5...
rewrite Dhy; ring...
replace (hy 0 - hy t)%R with ((- hy)%F t - (- hy)%F 0)%R...
apply
(IAF_var (- hy)%F yp 0 t (derivable_opp hy hy_derivable) yp_derivable H)...
intros; elim H1; intros...
generalize
(Dyp0_PI2 c H2
(Rle_trans (rho_vi * c) (rho_vi * t) (PI / 2) (rho_t_le c t H3) H0));
intro...
elim H4; intros...
cut ((- derive_pt hy c (hy_derivable c))%R = (vi intr * sin (rho_vi * c))%R)...
intro; rewrite <- H7 in H6...
replace (derive_pt (- hy) c (derivable_opp hy hy_derivable c)) with
(derive_pt (- hy) c (derivable_pt_opp hy c (hy_derivable c)));
[ idtac | apply pr_nu ]...
rewrite (derive_pt_opp hy c (hy_derivable c))...
rewrite Dhy; ring...
unfold opp_fct in |- *; ring...
Qed.
intros; generalize (ypt t H H0); intro; elim H1; intros; split;
[ unfold hy in H2; unfold Rminus in H2; rewrite yp0 in H2;
rewrite Rmult_0_r in H2; rewrite cos_0 in H2; rewrite Rmult_1_r in H2;
generalize
(Rplus_le_compat_r (l * sin (thetat intr 0 + beta))
(r_vi * cos (rho_vi * t) + - r_vi)
(yp t + - (l * sin (thetat intr 0 + beta))) H2);
replace (r_vi * cos (rho_vi * t) + - r_vi)%R with
(r_vi * (cos (rho_vi * t) - 1))%R;
[ repeat rewrite Rplus_assoc; rewrite Rplus_opp_l; rewrite Rplus_0_r;
intro; rewrite <- (Rplus_comm (r_vi * (cos (rho_vi * t) - 1)));
rewrite (Rplus_comm beta); assumption
| ring ]
| unfold hy in H3; unfold Rminus in H3; rewrite yp0 in H3;
rewrite Rmult_0_r in H3; rewrite cos_0 in H3; rewrite Rmult_1_r in H3;
generalize
(Rplus_le_compat_r (l * sin (thetat intr 0 + beta))
(yp t + - (l * sin (thetat intr 0 + beta)))
(r_vi + - (r_vi * cos (rho_vi * t))) H3);
replace (r_vi + - (r_vi * cos (rho_vi * t)))%R with
(- (r_vi * (cos (rho_vi * t) - 1)))%R;
[ repeat rewrite Rplus_assoc; rewrite Rplus_opp_l; rewrite Rplus_0_r;
intro; unfold Rminus in |- *; rewrite (Rplus_comm beta);
rewrite <- (Rplus_comm (- (r_vi * (cos (rho_vi * t) + -1))));
assumption
| unfold Rminus in |- *; rewrite Rmult_plus_distr_l; ring ] ].
Qed.
intro; unfold xp in |- *.
assert (H := xi_derivable intr t).
assert (H0 := yi_derivable intr t).
assert (H1 := thetat_derivable t).
set (xi_p := xi intr) in H |- *.
set (yi_p := yi intr) in H0 |- *.
set (thetat_p := thetat intr) in H1 |- *.
reg.
assert (H2 := cond_x intr t).
assert (H3 := cond_y intr t).
replace (derive_pt yi_p t H0) with
(derive_pt (y intr) t (cond_diff (y intr) t)); [ idtac | apply pr_nu ].
replace (derive_pt xi_p t H) with
(derive_pt (x intr) t (cond_diff (x intr) t)); [ idtac | apply pr_nu ].
unfold vi in |- *.
rewrite H2; rewrite H3; rewrite cos_minus; unfold thetat_p, thetat; ring.
Qed.

Lemma Dx0_PI :
forall t : R,
(0 <= t)%R ->
(rho_vi * t <= PI)%R ->
(vi intr * cos (rho_vi * t) <= derive_pt xp t (xp_derivable t))%R.