(* ========================================================================= *)
(* Thales's theorem.                                                         *)
(* ========================================================================= *)
needs "Multivariate/convex.ml";;
prioritize_real();;
(* ------------------------------------------------------------------------- *)
(* Geometric concepts.                                                       *)
(* ------------------------------------------------------------------------- *)
let BETWEEN_THM = prove
 (`between x (a,b) <=>
       ?u. &0 <= u /\ u <= &1 /\ x = u % a + (&1 - u) % b`,
 
let length_def = new_definition
 `length(A:real^2,B:real^2) = norm(B - A)`;;
let THALES = prove
 (`!centre radius a b c.
        length(a,centre) = radius /\
        length(b,centre) = radius /\
        length(c,centre) = radius /\
        
is_midpoint centre (a,b)
        ==> orthogonal (c - a) (c - b)`,
 
let THALES = prove
 (`!centre radius a b c:real^2.
        length(a,centre) = radius /\
        length(b,centre) = radius /\
        length(c,centre) = radius /\
        between centre (a,b)
        ==> orthogonal (c - a) (c - b)`,