| author | paulson <lp15@cam.ac.uk> | 
| Wed, 02 May 2018 12:47:56 +0100 | |
| changeset 68064 | b249fab48c76 | 
| parent 48891 | c0eafbd55de3 | 
| child 69605 | a96320074298 | 
| permissions | -rw-r--r-- | 
| 47455 | 1  | 
(* Title: HOL/Matrix_LP/Cplex.thy  | 
| 16784 | 2  | 
Author: Steven Obua  | 
3  | 
*)  | 
|
4  | 
||
5  | 
theory Cplex  | 
|
| 
32491
 
d5d8bea0cd94
reorganized Compute theories for HOL-Matrix -- avoiding theory files within main HOL/Tools;
 
wenzelm 
parents: 
31816 
diff
changeset
 | 
6  | 
imports SparseMatrix LP ComputeFloat ComputeNumeral  | 
| 16784 | 7  | 
begin  | 
8  | 
||
| 48891 | 9  | 
ML_file "Cplex_tools.ML"  | 
10  | 
ML_file "CplexMatrixConverter.ML"  | 
|
11  | 
ML_file "FloatSparseMatrixBuilder.ML"  | 
|
12  | 
ML_file "fspmlp.ML"  | 
|
13  | 
||
| 27484 | 14  | 
lemma spm_mult_le_dual_prts:  | 
15  | 
assumes  | 
|
16  | 
"sorted_sparse_matrix A1"  | 
|
17  | 
"sorted_sparse_matrix A2"  | 
|
18  | 
"sorted_sparse_matrix c1"  | 
|
19  | 
"sorted_sparse_matrix c2"  | 
|
20  | 
"sorted_sparse_matrix y"  | 
|
21  | 
"sorted_sparse_matrix r1"  | 
|
22  | 
"sorted_sparse_matrix r2"  | 
|
23  | 
"sorted_spvec b"  | 
|
| 31816 | 24  | 
"le_spmat [] y"  | 
| 27484 | 25  | 
"sparse_row_matrix A1 \<le> A"  | 
26  | 
"A \<le> sparse_row_matrix A2"  | 
|
27  | 
"sparse_row_matrix c1 \<le> c"  | 
|
28  | 
"c \<le> sparse_row_matrix c2"  | 
|
29  | 
"sparse_row_matrix r1 \<le> x"  | 
|
30  | 
"x \<le> sparse_row_matrix r2"  | 
|
| 
35028
 
108662d50512
more consistent naming of type classes involving orderings (and lattices) -- c.f. NEWS
 
haftmann 
parents: 
32491 
diff
changeset
 | 
31  | 
  "A * x \<le> sparse_row_matrix (b::('a::lattice_ring) spmat)"
 | 
| 27484 | 32  | 
shows  | 
| 31816 | 33  | 
"c * x \<le> sparse_row_matrix (add_spmat (mult_spmat y b)  | 
| 27484 | 34  | 
(let s1 = diff_spmat c1 (mult_spmat y A2); s2 = diff_spmat c2 (mult_spmat y A1) in  | 
| 31816 | 35  | 
add_spmat (mult_spmat (pprt_spmat s2) (pprt_spmat r2)) (add_spmat (mult_spmat (pprt_spmat s1) (nprt_spmat r2))  | 
36  | 
(add_spmat (mult_spmat (nprt_spmat s2) (pprt_spmat r1)) (mult_spmat (nprt_spmat s1) (nprt_spmat r1))))))"  | 
|
| 27484 | 37  | 
apply (simp add: Let_def)  | 
| 28637 | 38  | 
apply (insert assms)  | 
| 29667 | 39  | 
apply (simp add: sparse_row_matrix_op_simps algebra_simps)  | 
40  | 
apply (rule mult_le_dual_prts[where A=A, simplified Let_def algebra_simps])  | 
|
| 27484 | 41  | 
apply (auto)  | 
42  | 
done  | 
|
| 16784 | 43  | 
|
| 27484 | 44  | 
lemma spm_mult_le_dual_prts_no_let:  | 
45  | 
assumes  | 
|
46  | 
"sorted_sparse_matrix A1"  | 
|
47  | 
"sorted_sparse_matrix A2"  | 
|
48  | 
"sorted_sparse_matrix c1"  | 
|
49  | 
"sorted_sparse_matrix c2"  | 
|
50  | 
"sorted_sparse_matrix y"  | 
|
51  | 
"sorted_sparse_matrix r1"  | 
|
52  | 
"sorted_sparse_matrix r2"  | 
|
53  | 
"sorted_spvec b"  | 
|
| 31816 | 54  | 
"le_spmat [] y"  | 
| 27484 | 55  | 
"sparse_row_matrix A1 \<le> A"  | 
56  | 
"A \<le> sparse_row_matrix A2"  | 
|
57  | 
"sparse_row_matrix c1 \<le> c"  | 
|
58  | 
"c \<le> sparse_row_matrix c2"  | 
|
59  | 
"sparse_row_matrix r1 \<le> x"  | 
|
60  | 
"x \<le> sparse_row_matrix r2"  | 
|
| 
35028
 
108662d50512
more consistent naming of type classes involving orderings (and lattices) -- c.f. NEWS
 
haftmann 
parents: 
32491 
diff
changeset
 | 
61  | 
  "A * x \<le> sparse_row_matrix (b::('a::lattice_ring) spmat)"
 | 
| 27484 | 62  | 
shows  | 
| 31816 | 63  | 
"c * x \<le> sparse_row_matrix (add_spmat (mult_spmat y b)  | 
64  | 
(mult_est_spmat r1 r2 (diff_spmat c1 (mult_spmat y A2)) (diff_spmat c2 (mult_spmat y A1))))"  | 
|
| 28637 | 65  | 
by (simp add: assms mult_est_spmat_def spm_mult_le_dual_prts[where A=A, simplified Let_def])  | 
| 16784 | 66  | 
|
| 48891 | 67  | 
ML_file "matrixlp.ML"  | 
| 16784 | 68  | 
|
| 27484 | 69  | 
end  | 
| 46543 | 70  |