equal
deleted
inserted
replaced
4 |
4 |
5 theory Matrix |
5 theory Matrix |
6 imports Main "~~/src/HOL/Library/Lattice_Algebras" |
6 imports Main "~~/src/HOL/Library/Lattice_Algebras" |
7 begin |
7 begin |
8 |
8 |
9 types 'a infmatrix = "nat \<Rightarrow> nat \<Rightarrow> 'a" |
9 type_synonym 'a infmatrix = "nat \<Rightarrow> nat \<Rightarrow> 'a" |
10 |
10 |
11 definition nonzero_positions :: "(nat \<Rightarrow> nat \<Rightarrow> 'a::zero) \<Rightarrow> nat \<times> nat \<Rightarrow> bool" where |
11 definition nonzero_positions :: "(nat \<Rightarrow> nat \<Rightarrow> 'a::zero) \<Rightarrow> nat \<times> nat \<Rightarrow> bool" where |
12 "nonzero_positions A = {pos. A (fst pos) (snd pos) ~= 0}" |
12 "nonzero_positions A = {pos. A (fst pos) (snd pos) ~= 0}" |
13 |
13 |
14 typedef 'a matrix = "{(f::(nat \<Rightarrow> nat \<Rightarrow> 'a::zero)). finite (nonzero_positions f)}" |
14 typedef 'a matrix = "{(f::(nat \<Rightarrow> nat \<Rightarrow> 'a::zero)). finite (nonzero_positions f)}" |