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-Probability
etc) 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 :: nat
andi :: int
:where
real :: nat ⇒ real
is thenat
toreal
coercion (an abbreviation forof_nat
where the range is fixed to real) andreal_of_int :: real ⇒ int
is the abbreviation forof_int
where 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 n
etc. The best is to search for them using justof_nat
andof_int
and not thereal_…
abbreviations.