src/HOL/Matrix_LP/Matrix.thy
changeset 49834 b27bbb021df1
parent 47455 26315a545e26
child 50027 7747a9f4c358
equal deleted inserted replaced
49833:1d80798e8d8a 49834:b27bbb021df1
    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