Isabelle: Power of a matrix (A^n)?

戏子无情 提交于 2019-12-04 21:56:14

I have found the following definition in HOL/Power.thy :

primrec power :: "'a ⇒ nat ⇒ 'a" (infixr "^" 80) where
    power_0: "a ^ 0 = 1"
  | power_Suc: "a ^ Suc n = a * a ^ n"

(Control + Click gets you to the respecitve definition! So I clicked on "^", I just wrote "1 ^ 1 = 1" as a lemma first.

Here is the definition for the power of a matrice. (As I only use square matrices this is fine, but a more general type of ^'n^'m would be nice.)

primrec powerM :: "(('a::semiring_1) ^'n^'n) ⇒ nat ⇒ (('a::semiring_1) ^'n^'n)" 
(infixr "^^^" 80) where
  powerM_0: "A ^^^(0::nat) = mat 1"
| powerM_Suc: "A ^^^(Suc n) = A ** (powerM A n)"
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!