916 "Rep_matrix (move_matrix A y x) j i = |
916 "Rep_matrix (move_matrix A y x) j i = |
917 (if (((int j)-y) < 0) | (((int i)-x) < 0) then 0 else Rep_matrix A (nat((int j)-y)) (nat((int i)-x)))" |
917 (if (((int j)-y) < 0) | (((int i)-x) < 0) then 0 else Rep_matrix A (nat((int j)-y)) (nat((int i)-x)))" |
918 apply (simp add: move_matrix_def) |
918 apply (simp add: move_matrix_def) |
919 apply (auto) |
919 apply (auto) |
920 by (subst RepAbs_matrix, |
920 by (subst RepAbs_matrix, |
921 rule exI[of _ "(nrows A)+(nat (abs y))"], auto, rule nrows, arith, |
921 rule exI[of _ "(nrows A)+(nat \<bar>y\<bar>)"], auto, rule nrows, arith, |
922 rule exI[of _ "(ncols A)+(nat (abs x))"], auto, rule ncols, arith)+ |
922 rule exI[of _ "(ncols A)+(nat \<bar>x\<bar>)"], auto, rule ncols, arith)+ |
923 |
923 |
924 lemma move_matrix_0_0[simp]: "move_matrix A 0 0 = A" |
924 lemma move_matrix_0_0[simp]: "move_matrix A 0 0 = A" |
925 by (simp add: move_matrix_def) |
925 by (simp add: move_matrix_def) |
926 |
926 |
927 lemma move_matrix_ortho: "move_matrix A j i = move_matrix (move_matrix A j 0) 0 i" |
927 lemma move_matrix_ortho: "move_matrix A j i = move_matrix (move_matrix A j 0) 0 i" |
1611 qed |
1611 qed |
1612 |
1612 |
1613 instance matrix :: (lattice_ring) lattice_ring |
1613 instance matrix :: (lattice_ring) lattice_ring |
1614 proof |
1614 proof |
1615 fix A B C :: "('a :: lattice_ring) matrix" |
1615 fix A B C :: "('a :: lattice_ring) matrix" |
1616 show "abs A = sup A (-A)" |
1616 show "\<bar>A\<bar> = sup A (-A)" |
1617 by (simp add: abs_matrix_def) |
1617 by (simp add: abs_matrix_def) |
1618 qed |
1618 qed |
1619 |
1619 |
1620 lemma Rep_matrix_add[simp]: |
1620 lemma Rep_matrix_add[simp]: |
1621 "Rep_matrix ((a::('a::monoid_add)matrix)+b) j i = (Rep_matrix a j i) + (Rep_matrix b j i)" |
1621 "Rep_matrix ((a::('a::monoid_add)matrix)+b) j i = (Rep_matrix a j i) + (Rep_matrix b j i)" |