伊莎贝尔 'real_of_int' 和 'real'?
'real_of_int' and 'real' in Isabelle?
伊莎贝尔的real_of_int
、real
和int
是什么?它们听起来有点像类型,但通常类型写成 x ::real
而这些写成 real x
.
我无法证明以下陈述,
"S ((n*x)+(-x)) = S (n*x)*C (-x) + C (n*x)*S (-x)"
我注意到伊莎贝尔把它写成:
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))
所以我希望能够理解这些是什么意思。
当使用 Complex_Main(或基于它的逻辑,如 HOL-Analysis
、HOL-Probability
等)时,Isabelle 支持从 nat、int 和 rat 转换为实数。如果类型不合适,这些会自动添加。
即如果 f :: real ⇒ real
、n :: nat
和 i :: int
:
f n ↝ f (real n)
f i ↝ f (real_of_int i)
其中 real :: nat ⇒ real
是 nat
到 real
的强制转换(of_nat
的缩写,范围固定为实数),real_of_int :: real ⇒ int
是of_int
的缩写,范围固定为实数。
强制转换本质上是不同数字类型之间的态射,因此有许多可用的态射引理:of_nat (l + n) = of_nat l + of_nat n
等。最好只使用 of_nat
和 [= 搜索它们21=] 而不是 real_…
缩写。
伊莎贝尔的real_of_int
、real
和int
是什么?它们听起来有点像类型,但通常类型写成 x ::real
而这些写成 real x
.
我无法证明以下陈述,
"S ((n*x)+(-x)) = S (n*x)*C (-x) + C (n*x)*S (-x)"
我注意到伊莎贝尔把它写成:
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))
所以我希望能够理解这些是什么意思。
当使用 Complex_Main(或基于它的逻辑,如 HOL-Analysis
、HOL-Probability
等)时,Isabelle 支持从 nat、int 和 rat 转换为实数。如果类型不合适,这些会自动添加。
即如果 f :: real ⇒ real
、n :: nat
和 i :: int
:
f n ↝ f (real n)
f i ↝ f (real_of_int i)
其中 real :: nat ⇒ real
是 nat
到 real
的强制转换(of_nat
的缩写,范围固定为实数),real_of_int :: real ⇒ int
是of_int
的缩写,范围固定为实数。
强制转换本质上是不同数字类型之间的态射,因此有许多可用的态射引理:of_nat (l + n) = of_nat l + of_nat n
等。最好只使用 of_nat
和 [= 搜索它们21=] 而不是 real_…
缩写。