l3lab/ntp-mathlib huggingface dataset:
lemma comp [L₁.IsLocalization W₁] [L₂.IsLocalization W₂]
    (W₃ : MorphismProperty C₁) (hW₃ : W₃.IsInvertedBy (L₁ ⋙ L₂))
    (hW₁₃ : W₁ ⊆ W₃) (hW₂₃ : W₂ ⊆ W₃.map L₁) :
    (L₁ ⋙ L₂).IsLocalization W₃ := by
  -- The proof proceeds by reducing to the case of the constructed
  -- localized categories, which satisfy the strict universal property
  -- of the localization. In order to do this, we introduce
  -- an equivalence of categories `E₂ : C₂ ≅ W₁.Localization`. Via
  -- this equivalence, we introduce `W₂' : MorphismProperty W₁.Localization`
  -- which corresponds to `W₂` via the equivalence `E₂`.
  -- Then, we have a localizer morphism `Φ : LocalizerMorphism W₂ W₂'` which
  -- is a localized equivalence (because `E₂` is an equivalence).
  let E₂ := Localization.uniq L₁ W₁.Q W₁
  let W₂' := W₂.map E₂.functor
  let Φ : LocalizerMorphism W₂ W₂' :=
    { functor := E₂.functor
      map := by
        have eq := W₂.isoClosure.inverseImage_map_eq_of_isEquivalence
          W₂.isoClosure_respectsIso E₂.functor
        rw [MorphismProperty.map_isoClosure] at eq
        rw [eq]
        apply W₂.subset_isoClosure }
  have := LocalizerMorphism.IsLocalizedEquivalence.of_equivalence Φ (by rfl)
  -- The fact that `Φ` is a localized equivalence allows to consider
  -- the induced equivalence of categories `E₃ : C₃ ≅ W₂'.Localization`, and
  -- the isomorphism `iso : (W₁.Q ⋙ W₂'.Q) ⋙ E₃.inverse ≅ L₁ ⋙ L₂`
  let E₃ := (Φ.localizedFunctor L₂ W₂'.Q).asEquivalence
  

Proof state:
C₁ : Type u₁
C₂ : Type u₂
C₃ : Type u₃
E : Type u₄
inst✝⁵ : Category.{v₁, u₁} C₁
inst✝⁴ : Category.{v₂, u₂} C₂
inst✝³ : Category.{v₃, u₃} C₃
inst✝² : Category.{v₄, u₄} E
L₁ : C₁ ⥤ C₂
L₂ : C₂ ⥤ C₃
W₁ : MorphismProperty C₁
W₂ : MorphismProperty C₂
inst✝¹ : IsLocalization L₁ W₁
inst✝ : IsLocalization L₂ W₂
W₃ : MorphismProperty C₁
hW₃ : MorphismProperty.IsInvertedBy W₃ (L₁ ⋙ L₂)
hW₁₃ : W₁ ⊆ W₃
hW₂₃ : W₂ ⊆ MorphismProperty.map W₃ L₁
E₂ : C₂ ≌ MorphismProperty.Localization W₁ := uniq L₁ (MorphismProperty.Q W₁) W₁
W₂' : MorphismProperty (MorphismProperty.Localization W₁) := MorphismProperty.map W₂ E₂.functor
Φ : LocalizerMorphism W₂ W₂' :=
  { functor := E₂.functor, map := (_ : W₂ ⊆ MorphismProperty.inverseImage W₂' E₂.functor) }
this : LocalizerMorphism.IsLocalizedEquivalence Φ
E₃ : C₃ ≌ MorphismProperty.Localization W₂' :=
  asEquivalence (LocalizerMorphism.localizedFunctor Φ L₂ (MorphismProperty.Q W₂'))
⊢ IsLocalization (L₁ ⋙ L₂) W₃

Next tactic:
let iso : (W₁.Q ⋙ W₂'.Q) ⋙ E₃.inverse ≅ L₁ ⋙ L₂ := by
    calc
      _ ≅ L₁ ⋙ E₂.functor ⋙ W₂'.Q ⋙ E₃.inverse :=
          Functor.associator _ _ _ ≪≫ isoWhiskerRight (compUniqFunctor L₁ W₁.Q W₁).symm _ ≪≫
            Functor.associator _ _ _
      _ ≅ L₁ ⋙ L₂ ⋙ E₃.functor ⋙ E₃.inverse :=
          isoWhiskerLeft _ ((Functor.associator _ _ _).symm ≪≫
            isoWhiskerRight (Φ.catCommSq L₂ W₂'.Q).iso E₃.inverse ≪≫ Functor.associator _ _ _)
      _ ≅ L₁ ⋙ L₂ := isoWhiskerLeft _ (isoWhiskerLeft _ E₃.unitIso.symm ≪≫ L₂.rightUnitor)
lemma comp [L₁.IsLocalization W₁] [L₂.IsLocalization W₂]
    (W₃ : MorphismProperty C₁) (hW₃ : W₃.IsInvertedBy (L₁ ⋙ L₂))
    (hW₁₃ : W₁ ⊆ W₃) (hW₂₃ : W₂ ⊆ W₃.map L₁) :
    (L₁ ⋙ L₂).IsLocalization W₃ := by
  -- The proof proceeds by reducing to the case of the constructed
  -- localized categories, which satisfy the strict universal property
  -- of the localization. In order to do this, we introduce
  -- an equivalence of categories `E₂ : C₂ ≅ W₁.Localization`. Via
  -- this equivalence, we introduce `W₂' : MorphismProperty W₁.Localization`
  -- which corresponds to `W₂` via the equivalence `E₂`.
  -- Then, we have a localizer morphism `Φ : LocalizerMorphism W₂ W₂'` which
  -- is a localized equivalence (because `E₂` is an equivalence).
  let E₂ := Localization.uniq L₁ W₁.Q W₁
  let W₂' := W₂.map E₂.functor
  let Φ : LocalizerMorphism W₂ W₂' :=
    { functor := E₂.functor
      map := by
        have eq := W₂.isoClosure.inverseImage_map_eq_of_isEquivalence
          W₂.isoClosure_respectsIso E₂.functor
        rw [MorphismProperty.map_isoClosure] at eq
        rw [eq]
        apply W₂.subset_isoClosure }
  have := LocalizerMorphism.IsLocalizedEquivalence.of_equivalence Φ (by rfl)
  -- The fact that `Φ` is a localized equivalence allows to consider
  -- the induced equivalence of categories `E₃ : C₃ ≅ W₂'.Localization`, and
  -- the isomorphism `iso : (W₁.Q ⋙ W₂'.Q) ⋙ E₃.inverse ≅ L₁ ⋙ L₂`
  let E₃ := (Φ.localizedFunctor L₂ W₂'.Q).asEquivalence
  let iso : (W₁.Q ⋙ W₂'.Q) ⋙ E₃.inverse ≅ L₁ ⋙ L₂ := by
    

Proof state:
C₁ : Type u₁
C₂ : Type u₂
C₃ : Type u₃
E : Type u₄
inst✝⁵ : Category.{v₁, u₁} C₁
inst✝⁴ : Category.{v₂, u₂} C₂
inst✝³ : Category.{v₃, u₃} C₃
inst✝² : Category.{v₄, u₄} E
L₁ : C₁ ⥤ C₂
L₂ : C₂ ⥤ C₃
W₁ : MorphismProperty C₁
W₂ : MorphismProperty C₂
inst✝¹ : IsLocalization L₁ W₁
inst✝ : IsLocalization L₂ W₂
W₃ : MorphismProperty C₁
hW₃ : MorphismProperty.IsInvertedBy W₃ (L₁ ⋙ L₂)
hW₁₃ : W₁ ⊆ W₃
hW₂₃ : W₂ ⊆ MorphismProperty.map W₃ L₁
E₂ : C₂ ≌ MorphismProperty.Localization W₁ := uniq L₁ (MorphismProperty.Q W₁) W₁
W₂' : MorphismProperty (MorphismProperty.Localization W₁) := MorphismProperty.map W₂ E₂.functor
Φ : LocalizerMorphism W₂ W₂' :=
  { functor := E₂.functor, map := (_ : W₂ ⊆ MorphismProperty.inverseImage W₂' E₂.functor) }
this : LocalizerMorphism.IsLocalizedEquivalence Φ
E₃ : C₃ ≌ MorphismProperty.Localization W₂' :=
  asEquivalence (LocalizerMorphism.localizedFunctor Φ L₂ (MorphismProperty.Q W₂'))
⊢ (MorphismProperty.Q W₁ ⋙ MorphismProperty.Q W₂') ⋙ E₃.inverse ≅ L₁ ⋙ L₂

Next tactic:
calc
      _ ≅ L₁ ⋙ E₂.functor ⋙ W₂'.Q ⋙ E₃.inverse :=
          Functor.associator _ _ _ ≪≫ isoWhiskerRight (compUniqFunctor L₁ W₁.Q W₁).symm _ ≪≫
            Functor.associator _ _ _
      _ ≅ L₁ ⋙ L₂ ⋙ E₃.functor ⋙ E₃.inverse :=
          isoWhiskerLeft _ ((Functor.associator _ _ _).symm ≪≫
            isoWhiskerRight (Φ.catCommSq L₂ W₂'.Q).iso E₃.inverse ≪≫ Functor.associator _ _ _)
      _ ≅ L₁ ⋙ L₂ := isoWhiskerLeft _ (isoWhiskerLeft _ E₃.unitIso.symm ≪≫ L₂.rightUnitor)
lemma of_comp (W₃ : MorphismProperty C₁)
    [L₁.IsLocalization W₁] [(L₁ ⋙ L₂).IsLocalization W₃]
    (hW₁₃ : W₁ ⊆ W₃) (hW₂₃ : W₂ = W₃.map L₁) :
    L₂.IsLocalization W₂ := by
    

Proof state:
C₁ : Type u₁
C₂ : Type u₂
C₃ : Type u₃
E : Type u₄
inst✝⁵ : Category.{v₁, u₁} C₁
inst✝⁴ : Category.{v₂, u₂} C₂
inst✝³ : Category.{v₃, u₃} C₃
inst✝² : Category.{v₄, u₄} E
L₁ : C₁ ⥤ C₂
L₂ : C₂ ⥤ C₃
W₁ : MorphismProperty C₁
W₂ : MorphismProperty C₂
W₃ : MorphismProperty C₁
inst✝¹ : IsLocalization L₁ W₁
inst✝ : IsLocalization (L₁ ⋙ L₂) W₃
hW₁₃ : W₁ ⊆ W₃
hW₂₃ : W₂ = MorphismProperty.map W₃ L₁
⊢ IsLocalization L₂ W₂

Next tactic:
have : (L₁ ⋙ W₂.Q).IsLocalization W₃ :=
      comp L₁ W₂.Q W₁ W₂ W₃ (fun X Y f hf => Localization.inverts W₂.Q W₂ _
        (by simpa only [hW₂₃] using W₃.map_mem_map _ _ hf)) hW₁₃
        (by rw [hW₂₃, MorphismProperty.subset_iff_le])
lemma of_comp (W₃ : MorphismProperty C₁)
    [L₁.IsLocalization W₁] [(L₁ ⋙ L₂).IsLocalization W₃]
    (hW₁₃ : W₁ ⊆ W₃) (hW₂₃ : W₂ = W₃.map L₁) :
    L₂.IsLocalization W₂ := by
    have : (L₁ ⋙ W₂.Q).IsLocalization W₃ :=
      comp L₁ W₂.Q W₁ W₂ W₃ (fun X Y f hf => Localization.inverts W₂.Q W₂ _
        (by 

Proof state:
C₁ : Type u₁
C₂ : Type u₂
C₃ : Type u₃
E : Type u₄
inst✝⁵ : Category.{v₁, u₁} C₁
inst✝⁴ : Category.{v₂, u₂} C₂
inst✝³ : Category.{v₃, u₃} C₃
inst✝² : Category.{v₄, u₄} E
L₁ : C₁ ⥤ C₂
L₂ : C₂ ⥤ C₃
W₁ : MorphismProperty C₁
W₂ : MorphismProperty C₂
W₃ : MorphismProperty C₁
inst✝¹ : IsLocalization L₁ W₁
inst✝ : IsLocalization (L₁ ⋙ L₂) W₃
hW₁₃ : W₁ ⊆ W₃
hW₂₃ : W₂ = MorphismProperty.map W₃ L₁
X Y : C₁
f : X ⟶ Y
hf : W₃ f
⊢ W₂ (L₁.map f)

Next tactic:
simpa only [hW₂₃] using W₃.map_mem_map _ _ hf
lemma of_comp (W₃ : MorphismProperty C₁)
    [L₁.IsLocalization W₁] [(L₁ ⋙ L₂).IsLocalization W₃]
    (hW₁₃ : W₁ ⊆ W₃) (hW₂₃ : W₂ = W₃.map L₁) :
    L₂.IsLocalization W₂ := by
    have : (L₁ ⋙ W₂.Q).IsLocalization W₃ :=
      comp L₁ W₂.Q W₁ W₂ W₃ (fun X Y f hf => Localization.inverts W₂.Q W₂ _
        (by simpa only [hW₂₃] using W₃.map_mem_map _ _ hf)) hW₁₃
        (by 

Proof state:
C₁ : Type u₁
C₂ : Type u₂
C₃ : Type u₃
E : Type u₄
inst✝⁵ : Category.{v₁, u₁} C₁
inst✝⁴ : Category.{v₂, u₂} C₂
inst✝³ : Category.{v₃, u₃} C₃
inst✝² : Category.{v₄, u₄} E
L₁ : C₁ ⥤ C₂
L₂ : C₂ ⥤ C₃
W₁ : MorphismProperty C₁
W₂ : MorphismProperty C₂
W₃ : MorphismProperty C₁
inst✝¹ : IsLocalization L₁ W₁
inst✝ : IsLocalization (L₁ ⋙ L₂) W₃
hW₁₃ : W₁ ⊆ W₃
hW₂₃ : W₂ = MorphismProperty.map W₃ L₁
⊢ W₂ ⊆ MorphismProperty.map W₃ L₁

Next tactic:
rw [hW₂₃, MorphismProperty.subset_iff_le]
lemma of_comp (W₃ : MorphismProperty C₁)
    [L₁.IsLocalization W₁] [(L₁ ⋙ L₂).IsLocalization W₃]
    (hW₁₃ : W₁ ⊆ W₃) (hW₂₃ : W₂ = W₃.map L₁) :
    L₂.IsLocalization W₂ := by
    have : (L₁ ⋙ W₂.Q).IsLocalization W₃ :=
      comp L₁ W₂.Q W₁ W₂ W₃ (fun X Y f hf => Localization.inverts W₂.Q W₂ _
        (by simpa only [hW₂₃] using W₃.map_mem_map _ _ hf)) hW₁₃
        (by rw [hW₂₃, MorphismProperty.subset_iff_le])
    

Proof state:
C₁ : Type u₁
C₂ : Type u₂
C₃ : Type u₃
E : Type u₄
inst✝⁵ : Category.{v₁, u₁} C₁
inst✝⁴ : Category.{v₂, u₂} C₂
inst✝³ : Category.{v₃, u₃} C₃
inst✝² : Category.{v₄, u₄} E
L₁ : C₁ ⥤ C₂
L₂ : C₂ ⥤ C₃
W₁ : MorphismProperty C₁
W₂ : MorphismProperty C₂
W₃ : MorphismProperty C₁
inst✝¹ : IsLocalization L₁ W₁
inst✝ : IsLocalization (L₁ ⋙ L₂) W₃
hW₁₃ : W₁ ⊆ W₃
hW₂₃ : W₂ = MorphismProperty.map W₃ L₁
this : IsLocalization (L₁ ⋙ MorphismProperty.Q W₂) W₃
⊢ IsLocalization L₂ W₂

Next tactic:
exact IsLocalization.of_equivalence_target W₂.Q W₂ L₂
      (Localization.uniq (L₁ ⋙ W₂.Q) (L₁ ⋙ L₂) W₃)
      (liftNatIso L₁ W₁ _ _ _ _
        ((Functor.associator _ _ _).symm ≪≫
          Localization.compUniqFunctor (L₁ ⋙ W₂.Q) (L₁ ⋙ L₂) W₃))
instance Nat.orderedSMul [LinearOrderedCancelAddCommMonoid M] : OrderedSMul ℕ M :=
  OrderedSMul.mk'' fun n hn a b hab => by
    

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
𝕜 : Type u_5
R : Type u_6
M : Type u_7
N : Type u_8
inst✝ : LinearOrderedCancelAddCommMonoid M
n : ℕ
hn : 0 < n
a b : M
hab : a < b
⊢ (fun a => n • a) a < (fun a => n • a) b

Next tactic:
cases n with
    | zero => cases hn
    | succ n =>
      induction n with
      | zero => dsimp; rwa [one_nsmul, one_nsmul]
      | succ n ih => simp only [succ_nsmul _ n.succ, _root_.add_lt_add hab (ih n.succ_pos)]
instance Nat.orderedSMul [LinearOrderedCancelAddCommMonoid M] : OrderedSMul ℕ M :=
  OrderedSMul.mk'' fun n hn a b hab => by
    cases n with
    

Proof state:
case zero
ι : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
𝕜 : Type u_5
R : Type u_6
M : Type u_7
N : Type u_8
inst✝ : LinearOrderedCancelAddCommMonoid M
a b : M
hab : a < b
hn : 0 < zero
⊢ (fun a => zero • a) a < (fun a => zero • a) b

Next tactic:
| zero => cases hn
instance Nat.orderedSMul [LinearOrderedCancelAddCommMonoid M] : OrderedSMul ℕ M :=
  OrderedSMul.mk'' fun n hn a b hab => by
    cases n with
    | zero => 

Proof state:
case zero
ι : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
𝕜 : Type u_5
R : Type u_6
M : Type u_7
N : Type u_8
inst✝ : LinearOrderedCancelAddCommMonoid M
a b : M
hab : a < b
hn : 0 < zero
⊢ (fun a => zero • a) a < (fun a => zero • a) b

Next tactic:
cases hn
instance Nat.orderedSMul [LinearOrderedCancelAddCommMonoid M] : OrderedSMul ℕ M :=
  OrderedSMul.mk'' fun n hn a b hab => by
    cases n with
    | zero => cases hn
    

Proof state:
case succ
ι : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
𝕜 : Type u_5
R : Type u_6
M : Type u_7
N : Type u_8
inst✝ : LinearOrderedCancelAddCommMonoid M
a b : M
hab : a < b
n : ℕ
hn : 0 < succ n
⊢ (fun a => succ n • a) a < (fun a => succ n • a) b

Next tactic:
| succ n =>
      induction n with
      | zero => dsimp; rwa [one_nsmul, one_nsmul]
      | succ n ih => simp only [succ_nsmul _ n.succ, _root_.add_lt_add hab (ih n.succ_pos)]
instance Nat.orderedSMul [LinearOrderedCancelAddCommMonoid M] : OrderedSMul ℕ M :=
  OrderedSMul.mk'' fun n hn a b hab => by
    cases n with
    | zero => cases hn
    | succ n =>
      

Proof state:
case succ
ι : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
𝕜 : Type u_5
R : Type u_6
M : Type u_7
N : Type u_8
inst✝ : LinearOrderedCancelAddCommMonoid M
a b : M
hab : a < b
n : ℕ
hn : 0 < succ n
⊢ (fun a => succ n • a) a < (fun a => succ n • a) b

Next tactic:
induction n with
      | zero => dsimp; rwa [one_nsmul, one_nsmul]
      | succ n ih => simp only [succ_nsmul _ n.succ, _root_.add_lt_add hab (ih n.succ_pos)]
instance Nat.orderedSMul [LinearOrderedCancelAddCommMonoid M] : OrderedSMul ℕ M :=
  OrderedSMul.mk'' fun n hn a b hab => by
    cases n with
    | zero => cases hn
    | succ n =>
      induction n with
      

Proof state:
case succ.zero
ι : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
𝕜 : Type u_5
R : Type u_6
M : Type u_7
N : Type u_8
inst✝ : LinearOrderedCancelAddCommMonoid M
a b : M
hab : a < b
hn : 0 < succ zero
⊢ (fun a => succ zero • a) a < (fun a => succ zero • a) b

Next tactic:
| zero => dsimp; rwa [one_nsmul, one_nsmul]
instance Nat.orderedSMul [LinearOrderedCancelAddCommMonoid M] : OrderedSMul ℕ M :=
  OrderedSMul.mk'' fun n hn a b hab => by
    cases n with
    | zero => cases hn
    | succ n =>
      induction n with
      | zero => 

Proof state:
case succ.zero
ι : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
𝕜 : Type u_5
R : Type u_6
M : Type u_7
N : Type u_8
inst✝ : LinearOrderedCancelAddCommMonoid M
a b : M
hab : a < b
hn : 0 < succ zero
⊢ (fun a => succ zero • a) a < (fun a => succ zero • a) b

Next tactic:
dsimp
instance Nat.orderedSMul [LinearOrderedCancelAddCommMonoid M] : OrderedSMul ℕ M :=
  OrderedSMul.mk'' fun n hn a b hab => by
    cases n with
    | zero => cases hn
    | succ n =>
      induction n with
      | zero => dsimp; 

Proof state:
case succ.zero
ι : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
𝕜 : Type u_5
R : Type u_6
M : Type u_7
N : Type u_8
inst✝ : LinearOrderedCancelAddCommMonoid M
a b : M
hab : a < b
hn : 0 < succ zero
⊢ succ 0 • a < succ 0 • b

Next tactic:
rwa [one_nsmul, one_nsmul]
instance Nat.orderedSMul [LinearOrderedCancelAddCommMonoid M] : OrderedSMul ℕ M :=
  OrderedSMul.mk'' fun n hn a b hab => by
    cases n with
    | zero => cases hn
    | succ n =>
      induction n with
      | zero => dsimp; rwa [one_nsmul, one_nsmul]
      

Proof state:
case succ.succ
ι : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
𝕜 : Type u_5
R : Type u_6
M : Type u_7
N : Type u_8
inst✝ : LinearOrderedCancelAddCommMonoid M
a b : M
hab : a < b
n : ℕ
ih : 0 < succ n → (fun a => succ n • a) a < (fun a => succ n • a) b
hn : 0 < succ (succ n)
⊢ (fun a => succ (succ n) • a) a < (fun a => succ (succ n) • a) b

Next tactic:
| succ n ih => simp only [succ_nsmul _ n.succ, _root_.add_lt_add hab (ih n.succ_pos)]
instance Nat.orderedSMul [LinearOrderedCancelAddCommMonoid M] : OrderedSMul ℕ M :=
  OrderedSMul.mk'' fun n hn a b hab => by
    cases n with
    | zero => cases hn
    | succ n =>
      induction n with
      | zero => dsimp; rwa [one_nsmul, one_nsmul]
      | succ n ih => 

Proof state:
case succ.succ
ι : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
𝕜 : Type u_5
R : Type u_6
M : Type u_7
N : Type u_8
inst✝ : LinearOrderedCancelAddCommMonoid M
a b : M
hab : a < b
n : ℕ
ih : 0 < succ n → (fun a => succ n • a) a < (fun a => succ n • a) b
hn : 0 < succ (succ n)
⊢ (fun a => succ (succ n) • a) a < (fun a => succ (succ n) • a) b

Next tactic:
simp only [succ_nsmul _ n.succ, _root_.add_lt_add hab (ih n.succ_pos)]
instance Int.orderedSMul [LinearOrderedAddCommGroup M] : OrderedSMul ℤ M :=
  OrderedSMul.mk'' fun n hn => by
    

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
𝕜 : Type u_5
R : Type u_6
M : Type u_7
N : Type u_8
inst✝ : LinearOrderedAddCommGroup M
n : ℤ
hn : 0 < n
⊢ StrictMono fun a => n • a

Next tactic:
cases n
instance Int.orderedSMul [LinearOrderedAddCommGroup M] : OrderedSMul ℤ M :=
  OrderedSMul.mk'' fun n hn => by
    cases n
    · 

Proof state:
case ofNat
ι : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
𝕜 : Type u_5
R : Type u_6
M : Type u_7
N : Type u_8
inst✝ : LinearOrderedAddCommGroup M
a✝ : ℕ
hn : 0 < ofNat a✝
⊢ StrictMono fun a => ofNat a✝ • a

Next tactic:
simp only [Int.ofNat_eq_coe, Int.coe_nat_pos, coe_nat_zsmul] at hn ⊢
instance Int.orderedSMul [LinearOrderedAddCommGroup M] : OrderedSMul ℤ M :=
  OrderedSMul.mk'' fun n hn => by
    cases n
    · simp only [Int.ofNat_eq_coe, Int.coe_nat_pos, coe_nat_zsmul] at hn ⊢
      

Proof state:
case ofNat
ι : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
𝕜 : Type u_5
R : Type u_6
M : Type u_7
N : Type u_8
inst✝ : LinearOrderedAddCommGroup M
a✝ : ℕ
hn : 0 < a✝
⊢ StrictMono fun a => a✝ • a

Next tactic:
exact strictMono_smul_left hn
instance Int.orderedSMul [LinearOrderedAddCommGroup M] : OrderedSMul ℤ M :=
  OrderedSMul.mk'' fun n hn => by
    cases n
    · simp only [Int.ofNat_eq_coe, Int.coe_nat_pos, coe_nat_zsmul] at hn ⊢
      exact strictMono_smul_left hn
    · 

Proof state:
case negSucc
ι : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
𝕜 : Type u_5
R : Type u_6
M : Type u_7
N : Type u_8
inst✝ : LinearOrderedAddCommGroup M
a✝ : ℕ
hn : 0 < -[a✝+1]
⊢ StrictMono fun a => -[a✝+1] • a

Next tactic:
cases (Int.negSucc_not_pos _).1 hn
/-- To prove that a vector space over a linear ordered field is ordered, it suffices to verify only
the first axiom of `OrderedSMul`. -/
theorem OrderedSMul.mk' (h : ∀ ⦃a b : M⦄ ⦃c : 𝕜⦄, a < b → 0 < c → c • a ≤ c • b) :
    OrderedSMul 𝕜 M := by
  

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
𝕜 : Type u_5
R : Type u_6
M : Type u_7
N : Type u_8
inst✝⁴ : LinearOrderedSemifield 𝕜
inst✝³ : OrderedAddCommMonoid M
inst✝² : OrderedAddCommMonoid N
inst✝¹ : MulActionWithZero 𝕜 M
inst✝ : MulActionWithZero 𝕜 N
h : ∀ ⦃a b : M⦄ ⦃c : 𝕜⦄, a < b → 0 < c → c • a ≤ c • b
⊢ OrderedSMul 𝕜 M

Next tactic:
have hlt' : ∀ (a b : M) (c : 𝕜), a < b → 0 < c → c • a < c • b := by
    refine' fun a b c hab hc => (h hab hc).lt_of_ne _
    rw [Ne.def, hc.ne'.isUnit.smul_left_cancel]
    exact hab.ne
/-- To prove that a vector space over a linear ordered field is ordered, it suffices to verify only
the first axiom of `OrderedSMul`. -/
theorem OrderedSMul.mk' (h : ∀ ⦃a b : M⦄ ⦃c : 𝕜⦄, a < b → 0 < c → c • a ≤ c • b) :
    OrderedSMul 𝕜 M := by
  have hlt' : ∀ (a b : M) (c : 𝕜), a < b → 0 < c → c • a < c • b := by
    

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
𝕜 : Type u_5
R : Type u_6
M : Type u_7
N : Type u_8
inst✝⁴ : LinearOrderedSemifield 𝕜
inst✝³ : OrderedAddCommMonoid M
inst✝² : OrderedAddCommMonoid N
inst✝¹ : MulActionWithZero 𝕜 M
inst✝ : MulActionWithZero 𝕜 N
h : ∀ ⦃a b : M⦄ ⦃c : 𝕜⦄, a < b → 0 < c → c • a ≤ c • b
⊢ ∀ (a b : M) (c : 𝕜), a < b → 0 < c → c • a < c • b

Next tactic:
refine' fun a b c hab hc => (h hab hc).lt_of_ne _
/-- To prove that a vector space over a linear ordered field is ordered, it suffices to verify only
the first axiom of `OrderedSMul`. -/
theorem OrderedSMul.mk' (h : ∀ ⦃a b : M⦄ ⦃c : 𝕜⦄, a < b → 0 < c → c • a ≤ c • b) :
    OrderedSMul 𝕜 M := by
  have hlt' : ∀ (a b : M) (c : 𝕜), a < b → 0 < c → c • a < c • b := by
    refine' fun a b c hab hc => (h hab hc).lt_of_ne _
    

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
𝕜 : Type u_5
R : Type u_6
M : Type u_7
N : Type u_8
inst✝⁴ : LinearOrderedSemifield 𝕜
inst✝³ : OrderedAddCommMonoid M
inst✝² : OrderedAddCommMonoid N
inst✝¹ : MulActionWithZero 𝕜 M
inst✝ : MulActionWithZero 𝕜 N
h : ∀ ⦃a b : M⦄ ⦃c : 𝕜⦄, a < b → 0 < c → c • a ≤ c • b
a b : M
c : 𝕜
hab : a < b
hc : 0 < c
⊢ c • a ≠ c • b

Next tactic:
rw [Ne.def, hc.ne'.isUnit.smul_left_cancel]
/-- To prove that a vector space over a linear ordered field is ordered, it suffices to verify only
the first axiom of `OrderedSMul`. -/
theorem OrderedSMul.mk' (h : ∀ ⦃a b : M⦄ ⦃c : 𝕜⦄, a < b → 0 < c → c • a ≤ c • b) :
    OrderedSMul 𝕜 M := by
  have hlt' : ∀ (a b : M) (c : 𝕜), a < b → 0 < c → c • a < c • b := by
    refine' fun a b c hab hc => (h hab hc).lt_of_ne _
    rw [Ne.def, hc.ne'.isUnit.smul_left_cancel]
    

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
𝕜 : Type u_5
R : Type u_6
M : Type u_7
N : Type u_8
inst✝⁴ : LinearOrderedSemifield 𝕜
inst✝³ : OrderedAddCommMonoid M
inst✝² : OrderedAddCommMonoid N
inst✝¹ : MulActionWithZero 𝕜 M
inst✝ : MulActionWithZero 𝕜 N
h : ∀ ⦃a b : M⦄ ⦃c : 𝕜⦄, a < b → 0 < c → c • a ≤ c • b
a b : M
c : 𝕜
hab : a < b
hc : 0 < c
⊢ ¬a = b

Next tactic:
exact hab.ne
/-- To prove that a vector space over a linear ordered field is ordered, it suffices to verify only
the first axiom of `OrderedSMul`. -/
theorem OrderedSMul.mk' (h : ∀ ⦃a b : M⦄ ⦃c : 𝕜⦄, a < b → 0 < c → c • a ≤ c • b) :
    OrderedSMul 𝕜 M := by
  have hlt' : ∀ (a b : M) (c : 𝕜), a < b → 0 < c → c • a < c • b := by
    refine' fun a b c hab hc => (h hab hc).lt_of_ne _
    rw [Ne.def, hc.ne'.isUnit.smul_left_cancel]
    exact hab.ne
  

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
𝕜 : Type u_5
R : Type u_6
M : Type u_7
N : Type u_8
inst✝⁴ : LinearOrderedSemifield 𝕜
inst✝³ : OrderedAddCommMonoid M
inst✝² : OrderedAddCommMonoid N
inst✝¹ : MulActionWithZero 𝕜 M
inst✝ : MulActionWithZero 𝕜 N
h : ∀ ⦃a b : M⦄ ⦃c : 𝕜⦄, a < b → 0 < c → c • a ≤ c • b
hlt' : ∀ (a b : M) (c : 𝕜), a < b → 0 < c → c • a < c • b
⊢ OrderedSMul 𝕜 M

Next tactic:
refine' { smul_lt_smul_of_pos := fun {a b c} => hlt' a b c..}
/-- To prove that a vector space over a linear ordered field is ordered, it suffices to verify only
the first axiom of `OrderedSMul`. -/
theorem OrderedSMul.mk' (h : ∀ ⦃a b : M⦄ ⦃c : 𝕜⦄, a < b → 0 < c → c • a ≤ c • b) :
    OrderedSMul 𝕜 M := by
  have hlt' : ∀ (a b : M) (c : 𝕜), a < b → 0 < c → c • a < c • b := by
    refine' fun a b c hab hc => (h hab hc).lt_of_ne _
    rw [Ne.def, hc.ne'.isUnit.smul_left_cancel]
    exact hab.ne
  refine' { smul_lt_smul_of_pos := fun {a b c} => hlt' a b c..}
  

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
𝕜 : Type u_5
R : Type u_6
M : Type u_7
N : Type u_8
inst✝⁴ : LinearOrderedSemifield 𝕜
inst✝³ : OrderedAddCommMonoid M
inst✝² : OrderedAddCommMonoid N
inst✝¹ : MulActionWithZero 𝕜 M
inst✝ : MulActionWithZero 𝕜 N
h : ∀ ⦃a b : M⦄ ⦃c : 𝕜⦄, a < b → 0 < c → c • a ≤ c • b
hlt' : ∀ (a b : M) (c : 𝕜), a < b → 0 < c → c • a < c • b
⊢ ∀ {a b : M} {c : 𝕜}, c • a < c • b → 0 < c → a < b

Next tactic:
intro a b c hab hc
/-- To prove that a vector space over a linear ordered field is ordered, it suffices to verify only
the first axiom of `OrderedSMul`. -/
theorem OrderedSMul.mk' (h : ∀ ⦃a b : M⦄ ⦃c : 𝕜⦄, a < b → 0 < c → c • a ≤ c • b) :
    OrderedSMul 𝕜 M := by
  have hlt' : ∀ (a b : M) (c : 𝕜), a < b → 0 < c → c • a < c • b := by
    refine' fun a b c hab hc => (h hab hc).lt_of_ne _
    rw [Ne.def, hc.ne'.isUnit.smul_left_cancel]
    exact hab.ne
  refine' { smul_lt_smul_of_pos := fun {a b c} => hlt' a b c..}
  intro a b c hab hc
  

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
𝕜 : Type u_5
R : Type u_6
M : Type u_7
N : Type u_8
inst✝⁴ : LinearOrderedSemifield 𝕜
inst✝³ : OrderedAddCommMonoid M
inst✝² : OrderedAddCommMonoid N
inst✝¹ : MulActionWithZero 𝕜 M
inst✝ : MulActionWithZero 𝕜 N
h : ∀ ⦃a b : M⦄ ⦃c : 𝕜⦄, a < b → 0 < c → c • a ≤ c • b
hlt' : ∀ (a b : M) (c : 𝕜), a < b → 0 < c → c • a < c • b
a b : M
c : 𝕜
hab : c • a < c • b
hc : 0 < c
⊢ a < b

Next tactic:
obtain ⟨c, rfl⟩ := hc.ne'.isUnit
/-- To prove that a vector space over a linear ordered field is ordered, it suffices to verify only
the first axiom of `OrderedSMul`. -/
theorem OrderedSMul.mk' (h : ∀ ⦃a b : M⦄ ⦃c : 𝕜⦄, a < b → 0 < c → c • a ≤ c • b) :
    OrderedSMul 𝕜 M := by
  have hlt' : ∀ (a b : M) (c : 𝕜), a < b → 0 < c → c • a < c • b := by
    refine' fun a b c hab hc => (h hab hc).lt_of_ne _
    rw [Ne.def, hc.ne'.isUnit.smul_left_cancel]
    exact hab.ne
  refine' { smul_lt_smul_of_pos := fun {a b c} => hlt' a b c..}
  intro a b c hab hc
  obtain ⟨c, rfl⟩ := hc.ne'.isUnit
  

Proof state:
case intro
ι : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
𝕜 : Type u_5
R : Type u_6
M : Type u_7
N : Type u_8
inst✝⁴ : LinearOrderedSemifield 𝕜
inst✝³ : OrderedAddCommMonoid M
inst✝² : OrderedAddCommMonoid N
inst✝¹ : MulActionWithZero 𝕜 M
inst✝ : MulActionWithZero 𝕜 N
h : ∀ ⦃a b : M⦄ ⦃c : 𝕜⦄, a < b → 0 < c → c • a ≤ c • b
hlt' : ∀ (a b : M) (c : 𝕜), a < b → 0 < c → c • a < c • b
a b : M
c : 𝕜ˣ
hab : ↑c • a < ↑c • b
hc : 0 < ↑c
⊢ a < b

Next tactic:
rw [← inv_smul_smul c a, ← inv_smul_smul c b]