1 (*.(c) by Richard Lang, 2003 .*)
2 (* collecting all knowledge for Root Equations
9 (* use"../knowledge/RootEq.ML";
10 use"knowledge/RootEq.ML";
22 (*-------------------- consts------------------------------------------------*)
24 (*-------------------------root-----------------------*)
25 is'_rootTerm'_in :: [real, real] => bool ("_ is'_rootTerm'_in _")
26 is'_sqrtTerm'_in :: [real, real] => bool ("_ is'_sqrtTerm'_in _")
27 is'_normSqrtTerm'_in :: [real, real] => bool ("_ is'_normSqrtTerm'_in _")
28 (*----------------------scripts-----------------------*)
29 Norm'_sq'_root'_equation
31 \ bool list] => bool list"
32 ("((Script Norm'_sq'_root'_equation (_ _ =))// \
34 Solve'_sq'_root'_equation
36 \ bool list] => bool list"
37 ("((Script Solve'_sq'_root'_equation (_ _ =))// \
39 Solve'_left'_sq'_root'_equation
41 \ bool list] => bool list"
42 ("((Script Solve'_left'_sq'_root'_equation (_ _ =))// \
44 Solve'_right'_sq'_root'_equation
46 \ bool list] => bool list"
47 ("((Script Solve'_right'_sq'_root'_equation (_ _ =))// \
50 (*-------------------- rules------------------------------------------------*)
61 (* simplification of root*)
63 "[|0 <= a|] ==> (sqrt a)^^^2 = a"
67 "sqrt a * sqrt b = sqrt(a*b)"
69 "a * sqrt b * sqrt c = a * sqrt(b*c)"
71 (* isolate one root on the LEFT or RIGHT hand side of the equation *)
73 "[|bdv occurs_in c|] ==> (a + b*sqrt(c) = d) = (b * sqrt(c) = d+ (-1) * a)"
75 "[|bdv occurs_in c|] ==>(a + sqrt(c) = d) = ((sqrt(c) = d+ (-1) * a))"
77 "[|bdv occurs_in c|] ==> (a + b*(e/sqrt(c)) = d) = (b * (e/sqrt(c)) = d+ (-1) * a)"
79 "[|bdv occurs_in c|] ==>(a + b/(f*sqrt(c)) = d) = (b / (f*sqrt(c)) = d+ (-1) * a)"
81 "[|bdv occurs_in c|] ==> (a + b*(e/(f*sqrt(c))) = d) = (b * (e/(f*sqrt(c))) = d+ (-1) * a)"
83 "[|bdv occurs_in c|] ==>(a + b/sqrt(c) = d) = (b / sqrt(c) = d+ (-1) * a)"
85 "[|bdv occurs_in f|] ==>(a = d + e*sqrt(f)) = (a + (-1) * d = e*sqrt(f))"
87 "[|bdv occurs_in f|] ==>(a = d + sqrt(f)) = (a + (-1) * d = sqrt(f))"
88 (* small hack: thm 3,5,6 are not needed if rootnormalize is well done*)
90 "[|bdv occurs_in f|] ==>(a = d + e*(g/sqrt(f))) = (a + (-1) * d = e*(g/sqrt(f)))"
92 "[|bdv occurs_in f|] ==>(a = d + g/sqrt(f)) = (a + (-1) * d = g/sqrt(f))"
94 "[|bdv occurs_in f|] ==>(a = d + e*(g/(h*sqrt(f)))) = (a + (-1) * d = e*(g/(h*sqrt(f))))"
96 "[|bdv occurs_in f|] ==>(a = d + g/(h*sqrt(f))) = (a + (-1) * d = g/(h*sqrt(f)))"
98 (* eliminate isolates sqrt *)
99 sqrt_square_equation_both_1
100 "[|bdv occurs_in b; bdv occurs_in d|] ==>
101 ( (sqrt a + sqrt b = sqrt c + sqrt d) =
102 (a+2*sqrt(a)*sqrt(b)+b = c+2*sqrt(c)*sqrt(d)+d))"
103 sqrt_square_equation_both_2
104 "[|bdv occurs_in b; bdv occurs_in d|] ==>
105 ( (sqrt a - sqrt b = sqrt c + sqrt d) =
106 (a - 2*sqrt(a)*sqrt(b)+b = c+2*sqrt(c)*sqrt(d)+d))"
107 sqrt_square_equation_both_3
108 "[|bdv occurs_in b; bdv occurs_in d|] ==>
109 ( (sqrt a + sqrt b = sqrt c - sqrt d) =
110 (a + 2*sqrt(a)*sqrt(b)+b = c - 2*sqrt(c)*sqrt(d)+d))"
111 sqrt_square_equation_both_4
112 "[|bdv occurs_in b; bdv occurs_in d|] ==>
113 ( (sqrt a - sqrt b = sqrt c - sqrt d) =
114 (a - 2*sqrt(a)*sqrt(b)+b = c - 2*sqrt(c)*sqrt(d)+d))"
115 sqrt_square_equation_left_1
116 "[|bdv occurs_in a; 0 <= a; 0 <= b|] ==> ( (sqrt (a) = b) = (a = (b^^^2)))"
117 sqrt_square_equation_left_2
118 "[|bdv occurs_in a; 0 <= a; 0 <= b*c|] ==> ( (c*sqrt(a) = b) = (c^^^2*a = b^^^2))"
119 sqrt_square_equation_left_3
120 "[|bdv occurs_in a; 0 <= a; 0 <= b*c|] ==> ( c/sqrt(a) = b) = (c^^^2 / a = b^^^2)"
121 (* small hack: thm 4-6 are not needed if rootnormalize is well done*)
122 sqrt_square_equation_left_4
123 "[|bdv occurs_in a; 0 <= a; 0 <= b*c*d|] ==> ( (c*(d/sqrt (a)) = b) = (c^^^2*(d^^^2/a) = b^^^2))"
124 sqrt_square_equation_left_5
125 "[|bdv occurs_in a; 0 <= a; 0 <= b*c*d|] ==> ( c/(d*sqrt(a)) = b) = (c^^^2 / (d^^^2*a) = b^^^2)"
126 sqrt_square_equation_left_6
127 "[|bdv occurs_in a; 0 <= a; 0 <= b*c*d*e|] ==> ( (c*(d/(e*sqrt (a))) = b) = (c^^^2*(d^^^2/(e^^^2*a)) = b^^^2))"
128 sqrt_square_equation_right_1
129 "[|bdv occurs_in b; 0 <= a; 0 <= b|] ==> ( (a = sqrt (b)) = (a^^^2 = b))"
130 sqrt_square_equation_right_2
131 "[|bdv occurs_in b; 0 <= a*c; 0 <= b|] ==> ( (a = c*sqrt (b)) = ((a^^^2) = c^^^2*b))"
132 sqrt_square_equation_right_3
133 "[|bdv occurs_in b; 0 <= a*c; 0 <= b|] ==> ( (a = c/sqrt (b)) = (a^^^2 = c^^^2/b))"
134 (* small hack: thm 4-6 are not needed if rootnormalize is well done*)
135 sqrt_square_equation_right_4
136 "[|bdv occurs_in b; 0 <= a*c*d; 0 <= b|] ==> ( (a = c*(d/sqrt (b))) = ((a^^^2) = c^^^2*(d^^^2/b)))"
137 sqrt_square_equation_right_5
138 "[|bdv occurs_in b; 0 <= a*c*d; 0 <= b|] ==> ( (a = c/(d*sqrt (b))) = (a^^^2 = c^^^2/(d^^^2*b)))"
139 sqrt_square_equation_right_6
140 "[|bdv occurs_in b; 0 <= a*c*d*e; 0 <= b|] ==> ( (a = c*(d/(e*sqrt (b)))) = ((a^^^2) = c^^^2*(d^^^2/(e^^^2*b))))"