What are real_of_int, real and int in Isabelle? They sound a bit like types, but usually types are written something like x ::real and these are written like real x.
I am having trouble proving the following statement,
"S ((n*x)+(-x)) = S (n*x)*C (-x) + C (n*x)*S (-x)"
and I noticed that Isabelle writes it as:
S (real_of_int (int (n * x) + - int x)) =
S (real (n * x)) * C (real_of_int (- int x)) + C (real (n * x)) * S (real_of_int (- int x))
so I'd like to be able to understand what these mean.
When one uses Complex_Main (or a logic based on it like
HOL-Analysis,HOL-Probabilityetc) Isabelle supports coercions from nat, int and rat into reals. These are added automatically if the types do not fit.I.e. if
f :: real ⇒ real,n :: natandi :: int:where
real :: nat ⇒ realis thenattorealcoercion (an abbreviation forof_natwhere the range is fixed to real) andreal_of_int :: real ⇒ intis the abbreviation forof_intwhere the range is fixed to real.The coercions are essentially morphisms between the different numeral types, so there are many morphism lemmas available for them:
of_nat (l + n) = of_nat l + of_nat netc. The best is to search for them using justof_natandof_intand not thereal_…abbreviations.