src/HOL/Matrix/cplex/Cplex.thy
author wenzelm
Thu Jul 09 22:01:41 2009 +0200 (2009-07-09)
changeset 31971 8c1b845ed105
parent 31816 ffaf6dd53045
child 32491 d5d8bea0cd94
permissions -rw-r--r--
renamed functor TableFun to Table, and GraphFun to Graph;
obua@16784
     1
(*  Title:      HOL/Matrix/cplex/Cplex.thy
obua@16784
     2
    ID:         $Id$
obua@16784
     3
    Author:     Steven Obua
obua@16784
     4
*)
obua@16784
     5
obua@16784
     6
theory Cplex 
hoelzl@29804
     7
imports SparseMatrix LP "~~/src/HOL/Tools/ComputeFloat" "~~/src/HOL/Tools/ComputeNumeral"
wenzelm@28637
     8
uses "Cplex_tools.ML" "CplexMatrixConverter.ML" "FloatSparseMatrixBuilder.ML"
wenzelm@28637
     9
  "fspmlp.ML" ("matrixlp.ML")
obua@16784
    10
begin
obua@16784
    11
haftmann@27484
    12
lemma spm_mult_le_dual_prts: 
haftmann@27484
    13
  assumes
haftmann@27484
    14
  "sorted_sparse_matrix A1"
haftmann@27484
    15
  "sorted_sparse_matrix A2"
haftmann@27484
    16
  "sorted_sparse_matrix c1"
haftmann@27484
    17
  "sorted_sparse_matrix c2"
haftmann@27484
    18
  "sorted_sparse_matrix y"
haftmann@27484
    19
  "sorted_sparse_matrix r1"
haftmann@27484
    20
  "sorted_sparse_matrix r2"
haftmann@27484
    21
  "sorted_spvec b"
nipkow@31816
    22
  "le_spmat [] y"
haftmann@27484
    23
  "sparse_row_matrix A1 \<le> A"
haftmann@27484
    24
  "A \<le> sparse_row_matrix A2"
haftmann@27484
    25
  "sparse_row_matrix c1 \<le> c"
haftmann@27484
    26
  "c \<le> sparse_row_matrix c2"
haftmann@27484
    27
  "sparse_row_matrix r1 \<le> x"
haftmann@27484
    28
  "x \<le> sparse_row_matrix r2"
haftmann@27484
    29
  "A * x \<le> sparse_row_matrix (b::('a::lordered_ring) spmat)"
haftmann@27484
    30
  shows
nipkow@31816
    31
  "c * x \<le> sparse_row_matrix (add_spmat (mult_spmat y b)
haftmann@27484
    32
  (let s1 = diff_spmat c1 (mult_spmat y A2); s2 = diff_spmat c2 (mult_spmat y A1) in 
nipkow@31816
    33
  add_spmat (mult_spmat (pprt_spmat s2) (pprt_spmat r2)) (add_spmat (mult_spmat (pprt_spmat s1) (nprt_spmat r2)) 
nipkow@31816
    34
  (add_spmat (mult_spmat (nprt_spmat s2) (pprt_spmat r1)) (mult_spmat (nprt_spmat s1) (nprt_spmat r1))))))"
haftmann@27484
    35
  apply (simp add: Let_def)
wenzelm@28637
    36
  apply (insert assms)
nipkow@29667
    37
  apply (simp add: sparse_row_matrix_op_simps algebra_simps)  
nipkow@29667
    38
  apply (rule mult_le_dual_prts[where A=A, simplified Let_def algebra_simps])
haftmann@27484
    39
  apply (auto)
haftmann@27484
    40
  done
obua@16784
    41
haftmann@27484
    42
lemma spm_mult_le_dual_prts_no_let: 
haftmann@27484
    43
  assumes
haftmann@27484
    44
  "sorted_sparse_matrix A1"
haftmann@27484
    45
  "sorted_sparse_matrix A2"
haftmann@27484
    46
  "sorted_sparse_matrix c1"
haftmann@27484
    47
  "sorted_sparse_matrix c2"
haftmann@27484
    48
  "sorted_sparse_matrix y"
haftmann@27484
    49
  "sorted_sparse_matrix r1"
haftmann@27484
    50
  "sorted_sparse_matrix r2"
haftmann@27484
    51
  "sorted_spvec b"
nipkow@31816
    52
  "le_spmat [] y"
haftmann@27484
    53
  "sparse_row_matrix A1 \<le> A"
haftmann@27484
    54
  "A \<le> sparse_row_matrix A2"
haftmann@27484
    55
  "sparse_row_matrix c1 \<le> c"
haftmann@27484
    56
  "c \<le> sparse_row_matrix c2"
haftmann@27484
    57
  "sparse_row_matrix r1 \<le> x"
haftmann@27484
    58
  "x \<le> sparse_row_matrix r2"
haftmann@27484
    59
  "A * x \<le> sparse_row_matrix (b::('a::lordered_ring) spmat)"
haftmann@27484
    60
  shows
nipkow@31816
    61
  "c * x \<le> sparse_row_matrix (add_spmat (mult_spmat y b)
nipkow@31816
    62
  (mult_est_spmat r1 r2 (diff_spmat c1 (mult_spmat y A2)) (diff_spmat c2 (mult_spmat y A1))))"
wenzelm@28637
    63
  by (simp add: assms mult_est_spmat_def spm_mult_le_dual_prts[where A=A, simplified Let_def])
obua@16784
    64
haftmann@27484
    65
use "matrixlp.ML"
obua@16784
    66
haftmann@27484
    67
end