Built with
doc-gen4 , running Lean4.
Bubbles (
) indicate interactive fragments: hover for details, tap to reveal contents.
Use
Ctrl+β Ctrl+β to navigate,
Ctrl+π±οΈ to focus.
On Mac, use
Cmd instead of
Ctrl .
/-
Copyright (c) 2016 Jeremy Avigad. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Jeremy Avigad
-/
import Mathlib.Init.Algebra.Order
import Mathlib.Init.Data.Int.Basic
/-! # The order relation on the integers -/
open Nat
namespace Int
#align int.nonneg Int.NonNeg
#align int.le Int.le
#align int.lt Int.lt
export private decNonneg from Init.Data.Int.Basic
#align int.decidable_nonneg Int.decNonneg
#align int.decidable_le Int.decLe
#align int.decidable_lt Int.decLt
theorem le.elim : β {a b : β€ }, a β€ b β β {P : Prop }, (β (n : β ), a + βn = b β P ) β P le.elim { a b : β€ } ( h : a β€ b ) { P : Prop } ( h' : β (n : β ), a + βn = b β P h' : β n : β , a + β n = b β P ) : P :=
Exists.elim : β {Ξ± : Sort ?u.111} {p : Ξ± β Prop } {b : Prop }, (β x , p x ) β (β (a : Ξ± ), p a β b ) β b Exists.elim ( le.dest : β {a b : β€ }, a β€ b β β n , a + βn = b le.dest h ) h' : β (n : β ), a + βn = b β P h'
#align int.le.elim Int.le.elim : β {a b : β€ }, a β€ b β β {P : Prop }, (β (n : β ), a + βn = b β P ) β P Int.le.elim
alias ofNat_le β le_of_ofNat_le_ofNat : β {m n : β }, βm β€ βn β m β€ n le_of_ofNat_le_ofNat ofNat_le_ofNat_of_le : β {m n : β }, m β€ n β βm β€ βn ofNat_le_ofNat_of_le
#align int.coe_nat_le_coe_nat_of_le Int.ofNat_le_ofNat_of_le : β {m n : β }, m β€ n β βm β€ βn Int.ofNat_le_ofNat_of_le
#align int.le_of_coe_nat_le_coe_nat Int.le_of_ofNat_le_ofNat : β {m n : β }, βm β€ βn β m β€ n Int.le_of_ofNat_le_ofNat
#align int.coe_nat_le_coe_nat_iff Int.ofNat_le
#align int.coe_zero_le Int.ofNat_zero_le : β (n : β ), 0 β€ βn Int.ofNat_zero_le
#align int.eq_coe_of_zero_le Int.eq_ofNat_of_zero_le : β {a : β€ }, 0 β€ a β β n , a = βn Int.eq_ofNat_of_zero_le
theorem lt.elim : β {a b : β€ }, a < b β β {P : Prop }, (β (n : β ), a + β(succ n ) = b β P ) β P lt.elim { a b : β€ } ( h : a < b ) { P : Prop } ( h' : β n : β , a + β( Nat.succ n ) = b β P ) : P :=
Exists.elim : β {Ξ± : Sort ?u.253} {p : Ξ± β Prop } {b : Prop }, (β x , p x ) β (β (a : Ξ± ), p a β b ) β b Exists.elim ( lt.dest : β {a b : β€ }, a < b β β n , a + β(succ n ) = b lt.dest h ) h'
#align int.lt.elim Int.lt.elim : β {a b : β€ }, a < b β β {P : Prop }, (β (n : β ), a + β(succ n ) = b β P ) β P Int.lt.elim
alias ofNat_lt β lt_of_ofNat_lt_ofNat : β {n m : β }, βn < βm β n < m lt_of_ofNat_lt_ofNat ofNat_lt_ofNat_of_lt : β {n m : β }, n < m β βn < βm ofNat_lt_ofNat_of_lt
#align int.coe_nat_lt_coe_nat_iff Int.ofNat_lt
#align int.lt_of_coe_nat_lt_coe_nat Int.lt_of_ofNat_lt_ofNat : β {n m : β }, βn < βm β n < m Int.lt_of_ofNat_lt_ofNat
#align int.coe_nat_lt_coe_nat_of_lt Int.ofNat_lt_ofNat_of_lt : β {n m : β }, n < m β βn < βm Int.ofNat_lt_ofNat_of_lt
instance : LinearOrder : Type ?u.295 β Type ?u.295 LinearOrder β€ where
le := (Β·β€Β·)
le_refl := Int.le_refl : β (a : β€ ), a β€ a Int.le_refl
le_trans := @ Int.le_trans : β {a b c : β€ }, a β€ b β b β€ c β a β€ c Int.le_trans
le_antisymm := @ Int.le_antisymm : β {a b : β€ }, a β€ b β b β€ a β a = b Int.le_antisymm
lt := (Β·<Β·)
lt_iff_le_not_le := @ Int.lt_iff_le_not_le
le_total := Int.le_total
decidableEq := by infer_instance
decidableLE := by infer_instance
decidableLT := by infer_instance
#align int.eq_nat_abs_of_zero_le Int.eq_natAbs_of_zero_le : β {a : β€ }, 0 β€ a β a = β(natAbs a ) Int.eq_natAbs_of_zero_le
#align int.le_nat_abs Int.le_natAbs
#align int.neg_succ_lt_zero Int.negSucc_lt_zero
#align int.eq_neg_succ_of_lt_zero Int.eq_negSucc_of_lt_zero : β {a : β€ }, a < 0 β β n , a = -[ n +1] Int.eq_negSucc_of_lt_zero
#align int.sub_eq_zero_iff_eq Int.sub_eq_zero : β {a b : β€ }, a - b = 0 β a = b Int.sub_eq_zero
theorem neg_mul_eq_neg_mul_symm : β (a b : β€ ), - a * b = - (a * b ) neg_mul_eq_neg_mul_symm ( a b : β€ ) : - a * b = -( a * b ) := ( Int.neg_mul_eq_neg_mul : β (a b : β€ ), - (a * b ) = - a * b Int.neg_mul_eq_neg_mul a b ). symm : β {Ξ± : Sort ?u.1054} {a b : Ξ± }, a = b β b = a symm
#align int.neg_mul_eq_neg_mul_symm Int.neg_mul_eq_neg_mul_symm : β (a b : β€ ), - a * b = - (a * b ) Int.neg_mul_eq_neg_mul_symm
theorem mul_neg_eq_neg_mul_symm : β (a b : β€ ), a * - b = - (a * b ) mul_neg_eq_neg_mul_symm ( a b : β€ ) : a * - b = -( a * b ) := ( Int.neg_mul_eq_mul_neg : β (a b : β€ ), - (a * b ) = a * - b Int.neg_mul_eq_mul_neg a b ). symm : β {Ξ± : Sort ?u.1140} {a b : Ξ± }, a = b β b = a symm
#align int.mul_neg_eq_neg_mul_symm Int.mul_neg_eq_neg_mul_symm : β (a b : β€ ), a * - b = - (a * b ) Int.mul_neg_eq_neg_mul_symm
#align int.of_nat_nonneg Int.ofNat_nonneg : β (n : β ), 0 β€ βn Int.ofNat_nonneg
#align int.coe_succ_pos Int.ofNat_succ_pos : β (n : β ), 0 < β(succ n ) Int.ofNat_succ_pos
#align int.exists_eq_neg_of_nat Int.exists_eq_neg_ofNat : β {a : β€ }, a β€ 0 β β n , a = - βn Int.exists_eq_neg_ofNat
#align int.nat_abs_of_nonneg Int.natAbs_of_nonneg : β {a : β€ }, 0 β€ a β β(natAbs a ) = a Int.natAbs_of_nonneg
#align int.of_nat_nat_abs_of_nonpos Int.ofNat_natAbs_of_nonpos : β {a : β€ }, a β€ 0 β β(natAbs a ) = - a Int.ofNat_natAbs_of_nonpos
protected theorem eq_zero_or_eq_zero_of_mul_eq_zero : β {a b : β€ }, a * b = 0 β a = 0 β¨ b = 0 eq_zero_or_eq_zero_of_mul_eq_zero { a b : β€ } ( h : a * b = 0 ) : a = 0 β¨ b = 0 :=
match lt_trichotomy 0 a with
| Or.inl : β {a b : Prop }, a β a β¨ b Or.inl hltβ =>
match lt_trichotomy 0 b with
| Or.inl : β {a b : Prop }, a β a β¨ b Or.inl hltβ => by
have : 0 < a * b := Int.mul_pos : β {a b : β€ }, 0 < a β 0 < b β 0 < a * b Int.mul_pos hltβ hltβ
rw [ h ] at this
exact absurd : β {a : Prop } {b : Sort ?u.1907}, a β Β¬ a β b absurd this ( lt_irrefl _ )
| Or.inr : β {a b : Prop }, b β a β¨ b Or.inr ( Or.inl : β {a b : Prop }, a β a β¨ b Or.inl heqβ ) => Or.inr : β {a b : Prop }, b β a β¨ b Or.inr heqβ . symm : β {Ξ± : Sort ?u.1338} {a b : Ξ± }, a = b β b = a symm
| Or.inr : β {a b : Prop }, b β a β¨ b Or.inr ( Or.inr : β {a b : Prop }, b β a β¨ b Or.inr hgtβ ) => by
have : 0 > a * b := Int.mul_neg_of_pos_of_neg : β {a b : β€ }, 0 < a β b < 0 β a * b < 0 Int.mul_neg_of_pos_of_neg hltβ hgtβ
rw [ h ] at this
exact absurd : β {a : Prop } {b : Sort ?u.2014}, a β Β¬ a β b absurd this ( lt_irrefl _ )
| Or.inr : β {a b : Prop }, b β a β¨ b Or.inr ( Or.inl : β {a b : Prop }, a β a β¨ b Or.inl heqβ ) => Or.inl : β {a b : Prop }, a β a β¨ b Or.inl heqβ . symm : β {Ξ± : Sort ?u.1502} {a b : Ξ± }, a = b β b = a symm
| Or.inr : β {a b : Prop }, b β a β¨ b Or.inr ( Or.inr : β {a b : Prop }, b β a β¨ b Or.inr hgtβ ) =>
match lt_trichotomy 0 b with
| Or.inl : β {a b : Prop }, a β a β¨ b Or.inl hltβ => by
have : 0 > a * b := Int.mul_neg_of_neg_of_pos : β {a b : β€ }, a < 0 β 0 < b β a * b < 0 Int.mul_neg_of_neg_of_pos hgtβ hltβ
rw [ h ] at this
exact absurd : β {a : Prop } {b : Sort ?u.2100}, a β Β¬ a β b absurd this ( lt_irrefl _ )
| Or.inr : β {a b : Prop }, b β a β¨ b Or.inr ( Or.inl : β {a b : Prop }, a β a β¨ b Or.inl heqβ ) => Or.inr : β {a b : Prop }, b β a β¨ b Or.inr heqβ . symm : β {Ξ± : Sort ?u.1586} {a b : Ξ± }, a = b β b = a symm
| Or.inr : β {a b : Prop }, b β a β¨ b Or.inr ( Or.inr : β {a b : Prop }, b β a β¨ b Or.inr hgtβ ) => by
have : 0 < a * b := Int.mul_pos_of_neg_of_neg : β {a b : β€ }, a < 0 β b < 0 β 0 < a * b Int.mul_pos_of_neg_of_neg hgtβ hgtβ
rw [ h ] at this
exact absurd : β {a : Prop } {b : Sort ?u.2186}, a β Β¬ a β b absurd this ( lt_irrefl _ )
#align int.eq_zero_or_eq_zero_of_mul_eq_zero Int.eq_zero_or_eq_zero_of_mul_eq_zero : β {a b : β€ }, a * b = 0 β a = 0 β¨ b = 0 Int.eq_zero_or_eq_zero_of_mul_eq_zero