(* shows that we need A<>B in elim_py_on_line_d_middle Lemma essai : forall A P Q Y : Point, forall r:F, r<> 0 -> on_line_d Y P Q r -> False. *)

(* Specifications: *)
Theorem elim_py_on_line_middle :
forall A B P Q Y : Point,
on_line Y P Q ->
Py A Y B = Py A P B + P ** Y / Q ** P * (Py A P B - Py A Q B + 2* Py Q P Q) -
P ** Y / Q ** P * (1 - P ** Y / Q ** P) * Py Q P Q.
Theorem elim_py_inter_ll_right :
forall A B P Q U V Y : Point,
inter_ll Y P Q U V ->
Py A B Y = 1 / S4 P U Q V * (S P U V * Py A B Q + S Q V U * Py A B P).
Theorem elim_py_inter_ll_right_invariant :
forall A B P Q U V Y : Point,
inter_ll Y P Q U V -> S4 P U Q V <> 0.
Theorem elim_py_inter_ll_left_right :
forall B P Q U V Y : Point,
inter_ll Y P Q U V ->
Py Y B Y = 1 / S4 P U Q V *
(S P U V * (1 / S4 P U Q V * (S P U V * Py Q B Q + S Q V U * Py Q B P)) +
S Q V U * (1 / S4 P U Q V * (S P U V * Py P B Q + S Q V U * Py P B P))).
Theorem elim_py_inter_ll_left_right_invariant :
forall B P Q U V Y : Point,
inter_ll Y P Q U V -> S4 P U Q V <> 0.
Theorem elim_py_inter_ll_middle :
forall A B P Q U V Y : Point,
inter_ll Y P Q U V ->
Py A Y B = - (S P V U / S4 P U Q V) * Py A Q B + - (S Q U V / S4 P U Q V) * Py A P B -
- (S P V U / S4 P U Q V) * - (S Q U V / S4 P U Q V) * Py P Q P.
Theorem elim_py_inter_ll_middle_invariant :
forall A B P Q U V Y : Point,
inter_ll Y P Q U V -> S4  P U Q V <> 0.
Theorem elim_py_on_foot_right :
forall A B P U V Y : Point,
on_foot Y P U V ->
Py A B Y = (Py P U V * Py A B V + Py P V U * Py A B U) / (Py U V U).
Theorem elim_py_on_foot_left_right :
forall B P U V Y : Point,
on_foot Y P U V ->
Py Y B Y =
(Py P U V * Py P U V * Py V B V + Py P U V * Py P V U * Py V B U +
Py P U V * Py P V U * Py U B V + Py P V U * Py P V U * Py U B U) / (Py U V U *  Py U V U).
Theorem elim_py_on_foot_left_right_invariant :
forall B P U V Y : Point,
on_foot Y P U V -> (Py U V U *  Py U V U) <> 0.
Theorem elim_py_on_foot_right_invariant :
forall A B P U V Y : Point,
on_foot Y P U V -> Py U V U <> 0.
Theorem elim_py_on_foot_middle :
forall A B P U V Y : Point,
on_foot Y P U V ->
Py A Y B = (Py P U V / Py U V U) * Py A V B +
(Py P V U) / (Py  U V U) * Py A U B -
(Py P U V * Py P V U) / Py U V U.
Theorem elim_py_on_foot_middle_invariant :
forall A B P U V Y : Point,
on_foot Y P U V -> Py U V U <> 0.
Theorem elim_py_on_perp_d_right :
forall A B P Q Y : Point, forall r: F,
on_perp_d Y P Q r ->
Py A B Y = Py A B P - (2+2) * r * S4 P A Q B.
Theorem elim_py_on_perp_d_middle :
forall A B U V Y : Point, forall r: F,
on_perp_d Y U V r ->
Py A Y B = Py A U B + r * r * Py U V U - (2+2)*r*(S A U V + S B U V).