equal
deleted
inserted
replaced
11 definition nonzero_positions :: "(nat \<Rightarrow> nat \<Rightarrow> 'a::zero) \<Rightarrow> (nat \<times> nat) set" where |
11 definition nonzero_positions :: "(nat \<Rightarrow> nat \<Rightarrow> 'a::zero) \<Rightarrow> (nat \<times> nat) set" 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 definition "matrix = {(f::(nat \<Rightarrow> nat \<Rightarrow> 'a::zero)). finite (nonzero_positions f)}" |
14 definition "matrix = {(f::(nat \<Rightarrow> nat \<Rightarrow> 'a::zero)). finite (nonzero_positions f)}" |
15 |
15 |
16 typedef (open) 'a matrix = "matrix :: (nat \<Rightarrow> nat \<Rightarrow> 'a::zero) set" |
16 typedef 'a matrix = "matrix :: (nat \<Rightarrow> nat \<Rightarrow> 'a::zero) set" |
17 unfolding matrix_def |
17 unfolding matrix_def |
18 proof |
18 proof |
19 show "(\<lambda>j i. 0) \<in> {(f::(nat \<Rightarrow> nat \<Rightarrow> 'a::zero)). finite (nonzero_positions f)}" |
19 show "(\<lambda>j i. 0) \<in> {(f::(nat \<Rightarrow> nat \<Rightarrow> 'a::zero)). finite (nonzero_positions f)}" |
20 by (simp add: nonzero_positions_def) |
20 by (simp add: nonzero_positions_def) |
21 qed |
21 qed |