@@ -670,16 +670,22 @@ protected theorem nonneg_total : ∀ a : ℤ√d, Nonneg a ∨ Nonneg (-a)
670670 | ⟨(_ + 1 : ℕ), -[_+1 ]⟩ => Nat.le_total _ _
671671 | ⟨-[_+1 ], (_ + 1 : ℕ)⟩ => Nat.le_total _ _
672672
673+ @ [deprecated _root_.le_total (since := "2026-02-19" )]
673674protected theorem le_total (a b : ℤ√d) : a ≤ b ∨ b ≤ a := by
674675 have t := (b - a).nonneg_total
675676 rwa [neg_sub] at t
676677
677678instance preorder : Preorder (ℤ√d) where
678679 le_refl a := show Nonneg (a - a) by simp only [sub_self]; trivial
679680 le_trans a b c hab hbc := by simpa [sub_add_sub_cancel'] using hab.add hbc
680- lt_iff_le_not_ge _ _ := (and_iff_right_of_imp (Zsqrtd.le_total _ _).resolve_left).symm
681+ lt_iff_le_not_ge a b := by
682+ have ht : b ≤ a ∨ a ≤ b := by
683+ have t := (a - b).nonneg_total
684+ rwa [neg_sub] at t
685+ exact (and_iff_right_of_imp ht.resolve_left).symm
681686
682687open Int in
688+ -- TODO add an `Archimedean (ℤ√d)` instance and drop this lemma
683689theorem le_arch (a : ℤ√d) : ∃ n : ℕ, a ≤ n := by
684690 obtain ⟨x, y, (h : a ≤ ⟨x, y⟩)⟩ : ∃ x y : ℕ, Nonneg (⟨x, y⟩ + -a) :=
685691 match -a with
@@ -697,14 +703,11 @@ theorem le_arch (a : ℤ√d) : ∃ n : ℕ, a ≤ n := by
697703 rw [show (x : ℤ) + d * Nat.succ y - x = d * Nat.succ y by simp]
698704 exact h (y + 1 )
699705
706+ @ [deprecated _root_.add_le_add_left (since := "2026-02-19" )]
700707protected theorem add_le_add_left (a b : ℤ√d) (ab : a ≤ b) (c : ℤ√d) : a + c ≤ b + c :=
701708 show Nonneg _ by rwa [add_sub_add_right_eq_sub]
702709
703- protected theorem le_of_add_le_add_left (a b c : ℤ√d) (h : c + a ≤ c + b) : a ≤ b := by
704- simpa using Zsqrtd.add_le_add_left _ _ h (-c)
705710
706- protected theorem add_lt_add_left (a b : ℤ√d) (h : a < b) (c) : c + a < c + b := fun h' =>
707- h (Zsqrtd.le_of_add_le_add_left _ _ _ h')
708711
709712theorem nonneg_smul {a : ℤ√d} {n : ℕ} (ha : Nonneg a) : Nonneg ((n : ℤ√d) * a) := by
710713 rw [← Int.cast_natCast n]
@@ -833,13 +836,16 @@ theorem nonneg_antisymm : ∀ {a : ℤ√d}, Nonneg a → Nonneg (-a) → a = 0
833836 rw [one_mul] at t
834837 exact absurd t (not_divides_sq _ _)
835838
839+ @ [deprecated _root_.le_antisymm (since := "2026-02-19" )]
836840theorem le_antisymm {a b : ℤ√d} (ab : a ≤ b) (ba : b ≤ a) : a = b :=
837841 eq_of_sub_eq_zero <| nonneg_antisymm ba (by rwa [neg_sub])
838842
839843instance linearOrder : LinearOrder (ℤ√d) :=
840844 { Zsqrtd.preorder with
841- le_antisymm := fun _ _ => Zsqrtd.le_antisymm
842- le_total := Zsqrtd.le_total
845+ le_antisymm := fun _ _ ab ba => eq_of_sub_eq_zero <| nonneg_antisymm ba (by rwa [neg_sub])
846+ le_total := fun a b => by
847+ have t := (b - a).nonneg_total
848+ rwa [neg_sub] at t
843849 toDecidableLE := Zsqrtd.decidableLE
844850 toDecidableEq := inferInstance }
845851
@@ -881,14 +887,22 @@ instance : IsDomain (ℤ√d) :=
881887protected theorem mul_pos (a b : ℤ√d) (a0 : 0 < a) (b0 : 0 < b) : 0 < a * b := fun ab =>
882888 Or.elim
883889 (eq_zero_or_eq_zero_of_mul_eq_zero
884- (le_antisymm ab (Zsqrtd.mul_nonneg _ _ (le_of_lt a0) (le_of_lt b0))))
890+ (_root_. le_antisymm ab (Zsqrtd.mul_nonneg _ _ (le_of_lt a0) (le_of_lt b0))))
885891 (fun e => ne_of_gt a0 e) fun e => ne_of_gt b0 e
886892
887893instance : ZeroLEOneClass (ℤ√d) :=
888894 { zero_le_one := by trivial }
889895
890896instance : IsOrderedAddMonoid (ℤ√d) :=
891- { add_le_add_left := Zsqrtd.add_le_add_left }
897+ { add_le_add_left := fun a b ab c => show Nonneg _ by rwa [add_sub_add_right_eq_sub] }
898+
899+ @ [deprecated _root_.le_of_add_le_add_left (since := "2026-02-19" )]
900+ protected theorem le_of_add_le_add_left (a b c : ℤ√d) (h : c + a ≤ c + b) : a ≤ b := by
901+ exact _root_.le_of_add_le_add_left h
902+
903+ @ [deprecated _root_.add_lt_add_left (since := "2026-02-19" )]
904+ protected theorem add_lt_add_left (a b : ℤ√d) (h : a < b) (c) : c + a < c + b := fun h' =>
905+ h (_root_.le_of_add_le_add_left h')
892906
893907instance : IsStrictOrderedRing (ℤ√d) :=
894908 .of_mul_pos Zsqrtd.mul_pos
0 commit comments