1013 |
1013 |
1014 lemma image_minus_const_atLeastAtMost' [simp]: |
1014 lemma image_minus_const_atLeastAtMost' [simp]: |
1015 "(\<lambda>t. t-d)`{a..b} = {a-d..b-d}" for d::"'a::linordered_idom" |
1015 "(\<lambda>t. t-d)`{a..b} = {a-d..b-d}" for d::"'a::linordered_idom" |
1016 by (metis (no_types, lifting) diff_conv_add_uminus image_add_atLeastAtMost' image_cong) |
1016 by (metis (no_types, lifting) diff_conv_add_uminus image_add_atLeastAtMost' image_cong) |
1017 |
1017 |
1018 context linordered_field begin |
1018 context linordered_field |
|
1019 begin |
1019 |
1020 |
1020 lemma image_mult_atLeastAtMost [simp]: |
1021 lemma image_mult_atLeastAtMost [simp]: |
1021 "((*) d ` {a..b}) = {d*a..d*b}" if "d>0" |
1022 "((*) d ` {a..b}) = {d*a..d*b}" if "d>0" |
1022 using that |
1023 using that |
1023 by (auto simp: field_simps mult_le_cancel_right intro: rev_image_eqI [where x="x/d" for x]) |
1024 by (auto simp: field_simps mult_le_cancel_right intro: rev_image_eqI [where x="x/d" for x]) |
|
1025 |
|
1026 lemma image_divide_atLeastAtMost [simp]: |
|
1027 "((\<lambda>c. c / d) ` {a..b}) = {a/d..b/d}" if "d>0" |
|
1028 proof - |
|
1029 from that have "inverse d > 0" |
|
1030 by simp |
|
1031 with image_mult_atLeastAtMost [of "inverse d" a b] |
|
1032 have "(*) (inverse d) ` {a..b} = {inverse d * a..inverse d * b}" |
|
1033 by blast |
|
1034 moreover have "(*) (inverse d) = (\<lambda>c. c / d)" |
|
1035 by (simp add: fun_eq_iff field_simps) |
|
1036 ultimately show ?thesis |
|
1037 by simp |
|
1038 qed |
1024 |
1039 |
1025 lemma image_mult_atLeastAtMost_if: |
1040 lemma image_mult_atLeastAtMost_if: |
1026 "(*) c ` {x .. y} = |
1041 "(*) c ` {x .. y} = |
1027 (if c > 0 then {c * x .. c * y} else if x \<le> y then {c * y .. c * x} else {})" |
1042 (if c > 0 then {c * x .. c * y} else if x \<le> y then {c * y .. c * x} else {})" |
1028 proof - |
1043 proof - |