feat: missing lemmas about Int order/multiplication (#8346)
This PR adds some missing lemmas about consequences of positivity/non-negativity of `a * b : Int`.
This commit is contained in:
parent
83001213e3
commit
305fba625d
1 changed files with 51 additions and 0 deletions
|
|
@ -166,6 +166,9 @@ protected theorem lt_or_le (a b : Int) : a < b ∨ b ≤ a := by rw [← Int.not
|
|||
protected theorem le_of_not_gt {a b : Int} (h : ¬ a > b) : a ≤ b :=
|
||||
Int.not_lt.mp h
|
||||
|
||||
protected theorem not_lt_of_ge {a b : Int} (h : b ≤ a) : ¬a < b :=
|
||||
Int.not_lt.mpr h
|
||||
|
||||
protected theorem lt_trichotomy (a b : Int) : a < b ∨ a = b ∨ b < a :=
|
||||
if eq : a = b then .inr <| .inl eq else
|
||||
if le : a ≤ b then .inl <| Int.lt_iff_le_and_ne.2 ⟨le, eq⟩ else
|
||||
|
|
@ -1181,6 +1184,54 @@ protected theorem nonpos_of_mul_nonpos_right {a b : Int}
|
|||
(h : a * b ≤ 0) (ha : 0 < a) : b ≤ 0 :=
|
||||
Int.le_of_not_gt fun hb : b > 0 => Int.not_le_of_gt (Int.mul_pos ha hb) h
|
||||
|
||||
protected theorem nonneg_of_mul_nonpos_left {a b : Int}
|
||||
(h : a * b ≤ 0) (hb : b < 0) : 0 ≤ a :=
|
||||
Int.le_of_not_gt fun ha => Int.not_le_of_gt (Int.mul_pos_of_neg_of_neg ha hb) h
|
||||
|
||||
protected theorem nonneg_of_mul_nonpos_right {a b : Int}
|
||||
(h : a * b ≤ 0) (ha : a < 0) : 0 ≤ b :=
|
||||
Int.le_of_not_gt fun hb => Int.not_le_of_gt (Int.mul_pos_of_neg_of_neg ha hb) h
|
||||
|
||||
protected theorem nonpos_of_mul_nonneg_left {a b : Int}
|
||||
(h : 0 ≤ a * b) (hb : b < 0) : a ≤ 0 :=
|
||||
Int.le_of_not_gt fun ha : a > 0 => Int.not_le_of_gt (Int.mul_neg_of_pos_of_neg ha hb) h
|
||||
|
||||
protected theorem nonpos_of_mul_nonneg_right {a b : Int}
|
||||
(h : 0 ≤ a * b) (ha : a < 0) : b ≤ 0 :=
|
||||
Int.le_of_not_gt fun hb : b > 0 => Int.not_le_of_gt (Int.mul_neg_of_neg_of_pos ha hb) h
|
||||
|
||||
protected theorem pos_of_mul_pos_left {a b : Int}
|
||||
(h : 0 < a * b) (hb : 0 < b) : 0 < a :=
|
||||
Int.lt_of_not_ge fun ha => Int.not_lt_of_ge (Int.mul_nonpos_of_nonpos_of_nonneg ha (Int.le_of_lt hb)) h
|
||||
|
||||
protected theorem pos_of_mul_pos_right {a b : Int}
|
||||
(h : 0 < a * b) (ha : 0 < a) : 0 < b :=
|
||||
Int.lt_of_not_ge fun hb => Int.not_lt_of_ge (Int.mul_nonpos_of_nonneg_of_nonpos (Int.le_of_lt ha) hb) h
|
||||
|
||||
protected theorem neg_of_mul_neg_left {a b : Int}
|
||||
(h : a * b < 0) (hb : 0 < b) : a < 0 :=
|
||||
Int.lt_of_not_ge fun ha => Int.not_lt_of_ge (Int.mul_nonneg ha (Int.le_of_lt hb)) h
|
||||
|
||||
protected theorem neg_of_mul_neg_right {a b : Int}
|
||||
(h : a * b < 0) (ha : 0 < a) : b < 0 :=
|
||||
Int.lt_of_not_ge fun hb => Int.not_lt_of_ge (Int.mul_nonneg (Int.le_of_lt ha) hb) h
|
||||
|
||||
protected theorem pos_of_mul_neg_left {a b : Int}
|
||||
(h : a * b < 0) (hb : b < 0) : 0 < a :=
|
||||
Int.lt_of_not_ge fun ha => Int.not_lt_of_ge (Int.mul_nonneg_of_nonpos_of_nonpos ha (Int.le_of_lt hb)) h
|
||||
|
||||
protected theorem pos_of_mul_neg_right {a b : Int}
|
||||
(h : a * b < 0) (ha : a < 0) : 0 < b :=
|
||||
Int.lt_of_not_ge fun hb => Int.not_lt_of_ge (Int.mul_nonneg_of_nonpos_of_nonpos (Int.le_of_lt ha) hb) h
|
||||
|
||||
protected theorem neg_of_mul_pos_left {a b : Int}
|
||||
(h : 0 < a * b) (hb : b < 0) : a < 0 :=
|
||||
Int.lt_of_not_ge fun ha => Int.not_lt_of_ge (Int.mul_nonpos_of_nonneg_of_nonpos ha (Int.le_of_lt hb)) h
|
||||
|
||||
protected theorem neg_of_mul_pos_right {a b : Int}
|
||||
(h : 0 < a * b) (ha : a < 0) : b < 0 :=
|
||||
Int.lt_of_not_ge fun hb => Int.not_lt_of_ge (Int.mul_nonpos_of_nonpos_of_nonneg (Int.le_of_lt ha) hb) h
|
||||
|
||||
/- ## sign -/
|
||||
|
||||
@[simp] theorem sign_zero : sign 0 = 0 := rfl
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue