Interaction between successors and arithmetic #
We define the SuccAddOrder and PredSubOrder typeclasses, for orders satisfying succ x = x + 1
and pred x = x - 1 respectively. This allows us to transfer the API for successors and
predecessors into these common arithmetical forms.
@[simp]
theorem Order.succ_eq_add_one {α : Type u_1} [Preorder α] [Add α] [One α] [SuccAddOrder α] (x : α) :
theorem Order.add_one_le_of_lt {α : Type u_1} {x y : α} [Preorder α] [Add α] [One α] [SuccAddOrder α] (h : x < y) :
@[simp]
theorem Order.add_one_le_iff {α : Type u_1} {x y : α} [Preorder α] [Add α] [One α] [SuccAddOrder α] [NoMaxOrder α] :
@[simp]
@[simp]
theorem Order.covBy_add_one {α : Type u_1} [Preorder α] [Add α] [One α] [SuccAddOrder α] [NoMaxOrder α] (x : α) :
@[simp]
theorem Order.pred_eq_sub_one {α : Type u_1} [Preorder α] [Sub α] [One α] [PredSubOrder α] (x : α) :
theorem Order.le_sub_one_of_lt {α : Type u_1} {x y : α} [Preorder α] [Sub α] [One α] [PredSubOrder α] (h : x < y) :
@[simp]
theorem Order.le_sub_one_iff {α : Type u_1} {x y : α} [Preorder α] [Sub α] [One α] [PredSubOrder α] [NoMinOrder α] :
@[simp]
@[simp]
theorem Order.sub_one_covBy {α : Type u_1} [Preorder α] [Sub α] [One α] [PredSubOrder α] [NoMinOrder α] (x : α) :
@[simp]
theorem Order.succ_iterate {α : Type u_1} [Preorder α] [AddMonoidWithOne α] [SuccAddOrder α] (x : α) (n : ℕ) :
@[simp]
theorem Order.pred_iterate {α : Type u_1} [Preorder α] [AddCommGroupWithOne α] [PredSubOrder α] (x : α) (n : ℕ) :
theorem Order.not_isMax_zero {α : Type u_1} [PartialOrder α] [Zero α] [One α] [ZeroLEOneClass α] [NeZero 1] :
theorem Order.one_le_iff_pos {α : Type u_1} {x : α} [PartialOrder α] [AddMonoidWithOne α] [ZeroLEOneClass α] [NeZero 1] [SuccAddOrder α] :
theorem Order.one_le_iff_ne_zero {α : Type u_1} {x : α} [PartialOrder α] [AddMonoidWithOne α] [NeZero 1] [SuccAddOrder α] [IsBotZeroClass α] :
theorem Order.covBy_iff_add_one_eq {α : Type u_1} {x y : α} [PartialOrder α] [Add α] [One α] [SuccAddOrder α] [NoMaxOrder α] :
theorem Order.covBy_iff_sub_one_eq {α : Type u_1} {x y : α} [PartialOrder α] [Sub α] [One α] [PredSubOrder α] [NoMinOrder α] :
theorem Order.IsSuccPrelimit.add_one_lt {α : Type u_1} {x y : α} [PartialOrder α] [Add α] [One α] [SuccAddOrder α] (hx : IsSuccPrelimit x) (hy : y < x) :
theorem Order.IsPredPrelimit.lt_sub_one {α : Type u_1} {x y : α} [PartialOrder α] [Sub α] [One α] [PredSubOrder α] (hx : IsPredPrelimit x) (hy : x < y) :
theorem Order.IsSuccLimit.add_one_lt {α : Type u_1} {x y : α} [PartialOrder α] [Add α] [One α] [SuccAddOrder α] (hx : IsSuccLimit x) (hy : y < x) :
theorem Order.IsPredLimit.lt_sub_one {α : Type u_1} {x y : α} [PartialOrder α] [Sub α] [One α] [PredSubOrder α] (hx : IsPredLimit x) (hy : x < y) :
theorem Order.IsSuccPrelimit.add_natCast_lt {α : Type u_1} {x y : α} [PartialOrder α] [AddMonoidWithOne α] [SuccAddOrder α] (hx : IsSuccPrelimit x) (hy : y < x) (n : ℕ) :
theorem Order.IsPredPrelimit.lt_sub_natCast {α : Type u_1} {x y : α} [PartialOrder α] [AddCommGroupWithOne α] [PredSubOrder α] (hx : IsPredPrelimit x) (hy : x < y) (n : ℕ) :
theorem Order.IsSuccLimit.add_natCast_lt {α : Type u_1} {x y : α} [PartialOrder α] [AddMonoidWithOne α] [SuccAddOrder α] (hx : IsSuccLimit x) (hy : y < x) (n : ℕ) :
theorem Order.IsPredLimit.lt_sub_natCast {α : Type u_1} {x y : α} [PartialOrder α] [AddCommGroupWithOne α] [PredSubOrder α] (hx : IsPredLimit x) (hy : x < y) (n : ℕ) :
theorem Order.IsSuccLimit.natCast_lt {α : Type u_1} {x : α} [PartialOrder α] [AddMonoidWithOne α] [SuccAddOrder α] [IsBotZeroClass α] (hx : IsSuccLimit x) (n : ℕ) :
theorem Order.not_isSuccLimit_natCast {α : Type u_1} [PartialOrder α] [AddMonoidWithOne α] [SuccAddOrder α] [IsBotZeroClass α] (n : ℕ) :
¬IsSuccLimit ↑n
@[simp]
theorem Order.not_isSuccPrelimit_add_one {α : Type u_1} [PartialOrder α] (a : α) [Add α] [One α] [SuccAddOrder α] [NoMaxOrder α] :
¬IsSuccPrelimit (a + 1)
@[simp]
theorem Order.not_isSuccLimit_add_one {α : Type u_1} [PartialOrder α] (a : α) [Add α] [One α] [SuccAddOrder α] [NoMaxOrder α] :
¬IsSuccLimit (a + 1)
@[simp]
theorem Order.succ_eq_zero {α : Type u_1} [PartialOrder α] [AddZeroClass α] [OrderBot α] [IsBotZeroClass α] [One α] [NoMaxOrder α] [SuccAddOrder α] {a : WithBot α} :
theorem Order.le_of_lt_add_one {α : Type u_1} {x y : α} [LinearOrder α] [Add α] [One α] [SuccAddOrder α] (h : x < y + 1) :
theorem Order.lt_add_one_iff_of_not_isMax {α : Type u_1} {x y : α} [LinearOrder α] [Add α] [One α] [SuccAddOrder α] (hy : ¬IsMax y) :
theorem Order.lt_add_one_iff_of_not_isMax' {α : Type u_1} {x y : α} [LinearOrder α] [Add α] [One α] [SuccAddOrder α] (hx : ¬IsMax x) :
@[simp]
theorem Order.lt_add_one_iff {α : Type u_1} {x y : α} [LinearOrder α] [Add α] [One α] [SuccAddOrder α] [NoMaxOrder α] :
@[simp]
theorem Order.add_one_inj {α : Type u_1} {x y : α} [LinearOrder α] [Add α] [One α] [SuccAddOrder α] [NoMaxOrder α] :
@[simp]
theorem Order.lt_two_iff {α : Type u_1} {x : α} [LinearOrder α] [AddMonoidWithOne α] [SuccAddOrder α] [NoMaxOrder α] :
@[simp]
theorem Order.lt_one_iff {α : Type u_1} {x : α} [LinearOrder α] [AddMonoidWithOne α] [SuccAddOrder α] [IsBotZeroClass α] [NeZero 1] :
theorem Order.le_one_iff {α : Type u_1} {x : α} [LinearOrder α] [AddMonoidWithOne α] [SuccAddOrder α] [IsBotZeroClass α] [NeZero 1] :
@[simp]
theorem Order.Iio_one {α : Type u_1} [LinearOrder α] [AddMonoidWithOne α] [SuccAddOrder α] [IsBotZeroClass α] [NeZero 1] :
theorem Order.Iic_one {α : Type u_1} [LinearOrder α] [AddMonoidWithOne α] [SuccAddOrder α] [IsBotZeroClass α] [NeZero 1] :
theorem Order.le_two_iff {α : Type u_1} {x : α} [LinearOrder α] [AddMonoidWithOne α] [SuccAddOrder α] [IsBotZeroClass α] [NeZero 1] [NoMaxOrder α] :
theorem Order.Iio_two {α : Type u_1} [LinearOrder α] [AddMonoidWithOne α] [SuccAddOrder α] [IsBotZeroClass α] [NeZero 1] [NoMaxOrder α] :
theorem Order.Iic_two {α : Type u_1} [LinearOrder α] [AddMonoidWithOne α] [SuccAddOrder α] [IsBotZeroClass α] [NeZero 1] [NoMaxOrder α] :
theorem Order.le_of_sub_one_lt {α : Type u_1} {x y : α} [LinearOrder α] [Sub α] [One α] [PredSubOrder α] (h : x - 1 < y) :
theorem Order.sub_one_lt_iff_of_not_isMin {α : Type u_1} {x y : α} [LinearOrder α] [Sub α] [One α] [PredSubOrder α] (hx : ¬IsMin x) :
@[simp]
theorem Order.sub_one_lt_iff {α : Type u_1} {x y : α} [LinearOrder α] [Sub α] [One α] [PredSubOrder α] [NoMinOrder α] :
theorem Order.lt_one_iff_nonpos {α : Type u_1} {x : α} [LinearOrder α] [AddMonoidWithOne α] [ZeroLEOneClass α] [NeZero 1] [SuccAddOrder α] :
theorem monotoneOn_of_le_add_one {α : Type u_2} {β : Type u_3} [PartialOrder α] [Preorder β] [Add α] [One α] [SuccAddOrder α] [IsSuccArchimedean α] {s : Set α} {f : α → β} (hs : s.OrdConnected) :
theorem antitoneOn_of_add_one_le {α : Type u_2} {β : Type u_3} [PartialOrder α] [Preorder β] [Add α] [One α] [SuccAddOrder α] [IsSuccArchimedean α] {s : Set α} {f : α → β} (hs : s.OrdConnected) :
theorem strictMonoOn_of_lt_add_one {α : Type u_2} {β : Type u_3} [PartialOrder α] [Preorder β] [Add α] [One α] [SuccAddOrder α] [IsSuccArchimedean α] {s : Set α} {f : α → β} (hs : s.OrdConnected) :
theorem strictAntiOn_of_add_one_lt {α : Type u_2} {β : Type u_3} [PartialOrder α] [Preorder β] [Add α] [One α] [SuccAddOrder α] [IsSuccArchimedean α] {s : Set α} {f : α → β} (hs : s.OrdConnected) :
theorem monotone_of_le_add_one {α : Type u_2} {β : Type u_3} [PartialOrder α] [Preorder β] [Add α] [One α] [SuccAddOrder α] [IsSuccArchimedean α] {f : α → β} :
theorem antitone_of_add_one_le {α : Type u_2} {β : Type u_3} [PartialOrder α] [Preorder β] [Add α] [One α] [SuccAddOrder α] [IsSuccArchimedean α] {f : α → β} :
theorem strictMono_of_lt_add_one {α : Type u_2} {β : Type u_3} [PartialOrder α] [Preorder β] [Add α] [One α] [SuccAddOrder α] [IsSuccArchimedean α] {f : α → β} :
(∀ (a : α), ¬IsMax a → f a < f (a + 1)) → StrictMono f
theorem strictAnti_of_add_one_lt {α : Type u_2} {β : Type u_3} [PartialOrder α] [Preorder β] [Add α] [One α] [SuccAddOrder α] [IsSuccArchimedean α] {f : α → β} :
(∀ (a : α), ¬IsMax a → f (a + 1) < f a) → StrictAnti f
theorem monotoneOn_of_sub_one_le {α : Type u_2} {β : Type u_3} [PartialOrder α] [Preorder β] [Sub α] [One α] [PredSubOrder α] [IsPredArchimedean α] {s : Set α} {f : α → β} (hs : s.OrdConnected) :
theorem antitoneOn_of_le_sub_one {α : Type u_2} {β : Type u_3} [PartialOrder α] [Preorder β] [Sub α] [One α] [PredSubOrder α] [IsPredArchimedean α] {s : Set α} {f : α → β} (hs : s.OrdConnected) :
theorem strictMonoOn_of_sub_one_lt {α : Type u_2} {β : Type u_3} [PartialOrder α] [Preorder β] [Sub α] [One α] [PredSubOrder α] [IsPredArchimedean α] {s : Set α} {f : α → β} (hs : s.OrdConnected) :
theorem strictAntiOn_of_lt_sub_one {α : Type u_2} {β : Type u_3} [PartialOrder α] [Preorder β] [Sub α] [One α] [PredSubOrder α] [IsPredArchimedean α] {s : Set α} {f : α → β} (hs : s.OrdConnected) :
theorem monotone_of_sub_one_le {α : Type u_2} {β : Type u_3} [PartialOrder α] [Preorder β] [Sub α] [One α] [PredSubOrder α] [IsPredArchimedean α] {f : α → β} :
theorem antitone_of_le_sub_one {α : Type u_2} {β : Type u_3} [PartialOrder α] [Preorder β] [Sub α] [One α] [PredSubOrder α] [IsPredArchimedean α] {f : α → β} :
theorem strictMono_of_sub_one_lt {α : Type u_2} {β : Type u_3} [PartialOrder α] [Preorder β] [Sub α] [One α] [PredSubOrder α] [IsPredArchimedean α] {f : α → β} :
(∀ (a : α), ¬IsMin a → f (a - 1) < f a) → StrictMono f
theorem strictAnti_of_lt_sub_one {α : Type u_2} {β : Type u_3} [PartialOrder α] [Preorder β] [Sub α] [One α] [PredSubOrder α] [IsPredArchimedean α] {f : α → β} :
(∀ (a : α), ¬IsMin a → f a < f (a - 1)) → StrictAnti f