Theorem: IsArtinian.finite_of_linearIndependent
File: Mathlib/RingTheory/Artinian.lean

tactic: refine' by_contradiction fun hf => (RelEmbedding.wellFounded_iff_no_descending_seq.1
  (wellFounded_submodule_lt (R := R) (M := M))).elim' _
state_before: R : Type u_1
M : Type u_2
inst✝⁴ : Ring R
inst✝³ : AddCommGroup M
inst✝² : Module R M
inst✝¹ : Nontrivial R
inst✝ : IsArtinian R M
s : Set M
hs : LinearIndependent R Subtype.val
⊢ Set.Finite s

tactic: have f : ℕ ↪ s := Set.Infinite.natEmbedding s hf
state_before: R : Type u_1
M : Type u_2
inst✝⁴ : Ring R
inst✝³ : AddCommGroup M
inst✝² : Module R M
inst✝¹ : Nontrivial R
inst✝ : IsArtinian R M
s : Set M
hs : LinearIndependent R Subtype.val
hf : ¬Set.Finite s
⊢ (fun x x_1 => x > x_1) ↪r fun x x_1 => x < x_1

tactic: have : ∀ n, (↑) ∘ f '' { m | n ≤ m } ⊆ s := by
  rintro n x ⟨y, _, rfl⟩
  exact (f y).2
state_before: R : Type u_1
M : Type u_2
inst✝⁴ : Ring R
inst✝³ : AddCommGroup M
inst✝² : Module R M
inst✝¹ : Nontrivial R
inst✝ : IsArtinian R M
s : Set M
hs : LinearIndependent R Subtype.val
hf : ¬Set.Finite s
f : ℕ ↪ ↑s
⊢ (fun x x_1 => x > x_1) ↪r fun x x_1 => x < x_1

tactic: have : ∀ a b : ℕ, a ≤ b ↔
    span R (Subtype.val ∘ f '' { m | b ≤ m }) ≤ span R (Subtype.val ∘ f '' { m | a ≤ m }) := by
  intro a b
  rw [span_le_span_iff hs (this b) (this a),
    Set.image_subset_image_iff (Subtype.coe_injective.comp f.injective), Set.subset_def]
  simp only [Set.mem_setOf_eq]
  exact ⟨fun hab x => le_trans hab, fun h => h _ le_rfl⟩
state_before: R : Type u_1
M : Type u_2
inst✝⁴ : Ring R
inst✝³ : AddCommGroup M
inst✝² : Module R M
inst✝¹ : Nontrivial R
inst✝ : IsArtinian R M
s : Set M
hs : LinearIndependent R Subtype.val
hf : ¬Set.Finite s
f : ℕ ↪ ↑s
this : ∀ (n : ℕ), Subtype.val ∘ ↑f '' {m | n ≤ m} ⊆ s
⊢ (fun x x_1 => x > x_1) ↪r fun x x_1 => x < x_1

tactic: exact ⟨⟨fun n => span R (Subtype.val ∘ f '' { m | n ≤ m }), fun x y => by
  rw [le_antisymm_iff, ← this y x, ← this x y]
  exact fun ⟨h₁, h₂⟩ => le_antisymm_iff.2 ⟨h₂, h₁⟩⟩, by
  intro a b
  conv_rhs => rw [GT.gt, lt_iff_le_not_le, this, this, ← lt_iff_le_not_le]⟩
state_before: R : Type u_1
M : Type u_2
inst✝⁴ : Ring R
inst✝³ : AddCommGroup M
inst✝² : Module R M
inst✝¹ : Nontrivial R
inst✝ : IsArtinian R M
s : Set M
hs : LinearIndependent R Subtype.val
hf : ¬Set.Finite s
f : ℕ ↪ ↑s
this✝ : ∀ (n : ℕ), Subtype.val ∘ ↑f '' {m | n ≤ m} ⊆ s
this : ∀ (a b : ℕ), a ≤ b ↔ span R (Subtype.val ∘ ↑f '' {m | b ≤ m}) ≤ span R (Subtype.val ∘ ↑f '' {m | a ≤ m})
⊢ (fun x x_1 => x > x_1) ↪r fun x x_1 => x < x_1

tactic: rintro n x ⟨y, _, rfl⟩
state_before: R : Type u_1
M : Type u_2
inst✝⁴ : Ring R
inst✝³ : AddCommGroup M
inst✝² : Module R M
inst✝¹ : Nontrivial R
inst✝ : IsArtinian R M
s : Set M
hs : LinearIndependent R Subtype.val
hf : ¬Set.Finite s
f : ℕ ↪ ↑s
⊢ ∀ (n : ℕ), Subtype.val ∘ ↑f '' {m | n ≤ m} ⊆ s

tactic: exact (f y).2
state_before: case intro.intro
R : Type u_1
M : Type u_2
inst✝⁴ : Ring R
inst✝³ : AddCommGroup M
inst✝² : Module R M
inst✝¹ : Nontrivial R
inst✝ : IsArtinian R M
s : Set M
hs : LinearIndependent R Subtype.val
hf : ¬Set.Finite s
f : ℕ ↪ ↑s
n y : ℕ
left✝ : y ∈ {m | n ≤ m}
⊢ (Subtype.val ∘ ↑f) y ∈ s

tactic: intro a b
state_before: R : Type u_1
M : Type u_2
inst✝⁴ : Ring R
inst✝³ : AddCommGroup M
inst✝² : Module R M
inst✝¹ : Nontrivial R
inst✝ : IsArtinian R M
s : Set M
hs : LinearIndependent R Subtype.val
hf : ¬Set.Finite s
f : ℕ ↪ ↑s
this : ∀ (n : ℕ), Subtype.val ∘ ↑f '' {m | n ≤ m} ⊆ s
⊢ ∀ (a b : ℕ), a ≤ b ↔ span R (Subtype.val ∘ ↑f '' {m | b ≤ m}) ≤ span R (Subtype.val ∘ ↑f '' {m | a ≤ m})

tactic: rw [span_le_span_iff hs (this b) (this a),
  Set.image_subset_image_iff (Subtype.coe_injective.comp f.injective), Set.subset_def]
state_before: R : Type u_1
M : Type u_2
inst✝⁴ : Ring R
inst✝³ : AddCommGroup M
inst✝² : Module R M
inst✝¹ : Nontrivial R
inst✝ : IsArtinian R M
s : Set M
hs : LinearIndependent R Subtype.val
hf : ¬Set.Finite s
f : ℕ ↪ ↑s
this : ∀ (n : ℕ), Subtype.val ∘ ↑f '' {m | n ≤ m} ⊆ s
a b : ℕ
⊢ a ≤ b ↔ span R (Subtype.val ∘ ↑f '' {m | b ≤ m}) ≤ span R (Subtype.val ∘ ↑f '' {m | a ≤ m})

tactic: simp only [Set.mem_setOf_eq]
state_before: R : Type u_1
M : Type u_2
inst✝⁴ : Ring R
inst✝³ : AddCommGroup M
inst✝² : Module R M
inst✝¹ : Nontrivial R
inst✝ : IsArtinian R M
s : Set M
hs : LinearIndependent R Subtype.val
hf : ¬Set.Finite s
f : ℕ ↪ ↑s
this : ∀ (n : ℕ), Subtype.val ∘ ↑f '' {m | n ≤ m} ⊆ s
a b : ℕ
⊢ a ≤ b ↔ ∀ (x : ℕ), x ∈ {m | b ≤ m} → x ∈ {m | a ≤ m}

tactic: exact ⟨fun hab x => le_trans hab, fun h => h _ le_rfl⟩
state_before: R : Type u_1
M : Type u_2
inst✝⁴ : Ring R
inst✝³ : AddCommGroup M
inst✝² : Module R M
inst✝¹ : Nontrivial R
inst✝ : IsArtinian R M
s : Set M
hs : LinearIndependent R Subtype.val
hf : ¬Set.Finite s
f : ℕ ↪ ↑s
this : ∀ (n : ℕ), Subtype.val ∘ ↑f '' {m | n ≤ m} ⊆ s
a b : ℕ
⊢ a ≤ b ↔ ∀ (x : ℕ), b ≤ x → a ≤ x

tactic: rw [le_antisymm_iff, ← this y x, ← this x y]
state_before: R : Type u_1
M : Type u_2
inst✝⁴ : Ring R
inst✝³ : AddCommGroup M
inst✝² : Module R M
inst✝¹ : Nontrivial R
inst✝ : IsArtinian R M
s : Set M
hs : LinearIndependent R Subtype.val
hf : ¬Set.Finite s
f : ℕ ↪ ↑s
this✝ : ∀ (n : ℕ), Subtype.val ∘ ↑f '' {m | n ≤ m} ⊆ s
this : ∀ (a b : ℕ), a ≤ b ↔ span R (Subtype.val ∘ ↑f '' {m | b ≤ m}) ≤ span R (Subtype.val ∘ ↑f '' {m | a ≤ m})
x y : ℕ
⊢ (fun n => span R (Subtype.val ∘ ↑f '' {m | n ≤ m})) x = (fun n => span R (Subtype.val ∘ ↑f '' {m | n ≤ m})) y → x = y

tactic: exact fun ⟨h₁, h₂⟩ => le_antisymm_iff.2 ⟨h₂, h₁⟩
state_before: R : Type u_1
M : Type u_2
inst✝⁴ : Ring R
inst✝³ : AddCommGroup M
inst✝² : Module R M
inst✝¹ : Nontrivial R
inst✝ : IsArtinian R M
s : Set M
hs : LinearIndependent R Subtype.val
hf : ¬Set.Finite s
f : ℕ ↪ ↑s
this✝ : ∀ (n : ℕ), Subtype.val ∘ ↑f '' {m | n ≤ m} ⊆ s
this : ∀ (a b : ℕ), a ≤ b ↔ span R (Subtype.val ∘ ↑f '' {m | b ≤ m}) ≤ span R (Subtype.val ∘ ↑f '' {m | a ≤ m})
x y : ℕ
⊢ y ≤ x ∧ x ≤ y → x = y

tactic: intro a b
state_before: R : Type u_1
M : Type u_2
inst✝⁴ : Ring R
inst✝³ : AddCommGroup M
inst✝² : Module R M
inst✝¹ : Nontrivial R
inst✝ : IsArtinian R M
s : Set M
hs : LinearIndependent R Subtype.val
hf : ¬Set.Finite s
f : ℕ ↪ ↑s
this✝ : ∀ (n : ℕ), Subtype.val ∘ ↑f '' {m | n ≤ m} ⊆ s
this : ∀ (a b : ℕ), a ≤ b ↔ span R (Subtype.val ∘ ↑f '' {m | b ≤ m}) ≤ span R (Subtype.val ∘ ↑f '' {m | a ≤ m})
⊢ ∀ {a b : ℕ},
    ↑{ toFun := fun n => span R (Subtype.val ∘ ↑f '' {m | n ≤ m}),
              inj' :=
                (_ :
                  ∀ (x y : ℕ),
                    (fun n => span R (Subtype.val ∘ ↑f '' {m | n ≤ m})) x =
                        (fun n => span R (Subtype.val ∘ ↑f '' {m | n ≤ m})) y →
                      x = y) }
          a <
        ↑{ toFun := fun n => span R (Subtype.val ∘ ↑f '' {m | n ≤ m}),
              inj' :=
                (_ :
                  ∀ (x y : ℕ),
                    (fun n => span R (Subtype.val ∘ ↑f '' {m | n ≤ m})) x =
                        (fun n => span R (Subtype.val ∘ ↑f '' {m | n ≤ m})) y →
                      x = y) }
          b ↔
      a > b

tactic: conv_rhs => rw [GT.gt, lt_iff_le_not_le, this, this, ← lt_iff_le_not_le]
state_before: R : Type u_1
M : Type u_2
inst✝⁴ : Ring R
inst✝³ : AddCommGroup M
inst✝² : Module R M
inst✝¹ : Nontrivial R
inst✝ : IsArtinian R M
s : Set M
hs : LinearIndependent R Subtype.val
hf : ¬Set.Finite s
f : ℕ ↪ ↑s
this✝ : ∀ (n : ℕ), Subtype.val ∘ ↑f '' {m | n ≤ m} ⊆ s
this : ∀ (a b : ℕ), a ≤ b ↔ span R (Subtype.val ∘ ↑f '' {m | b ≤ m}) ≤ span R (Subtype.val ∘ ↑f '' {m | a ≤ m})
a b : ℕ
⊢ ↑{ toFun := fun n => span R (Subtype.val ∘ ↑f '' {m | n ≤ m}),
            inj' :=
              (_ :
                ∀ (x y : ℕ),
                  (fun n => span R (Subtype.val ∘ ↑f '' {m | n ≤ m})) x =
                      (fun n => span R (Subtype.val ∘ ↑f '' {m | n ≤ m})) y →
                    x = y) }
        a <
      ↑{ toFun := fun n => span R (Subtype.val ∘ ↑f '' {m | n ≤ m}),
            inj' :=
              (_ :
                ∀ (x y : ℕ),
                  (fun n => span R (Subtype.val ∘ ↑f '' {m | n ≤ m})) x =
                      (fun n => span R (Subtype.val ∘ ↑f '' {m | n ≤ m})) y →
                    x = y) }
        b ↔
    a > b