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

Proof steps:
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 (ι := { x // x ∈ s }) R Subtype.val
⊢ s.Finite
state_after: 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 (ι := { x // x ∈ s }) R Subtype.val
hf : ¬s.Finite
⊢ (fun x x_1 => x > x_1) ↪r fun x x_1 => x < x_1
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 (ι := { x // x ∈ s }) R Subtype.val
hf : ¬s.Finite
⊢ (fun x x_1 => x > x_1) ↪r fun x x_1 => x < x_1
state_after: 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 (ι := { x // x ∈ s }) R Subtype.val
hf : ¬s.Finite
f : ℕ ↪ ↑s
⊢ (fun x x_1 => x > x_1) ↪r fun x x_1 => x < x_1
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 (ι := { x // x ∈ s }) R Subtype.val
hf : ¬s.Finite
f : ℕ ↪ ↑s
⊢ (fun x x_1 => x > x_1) ↪r fun x x_1 => x < x_1
state_after: 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 (ι := { x // x ∈ s }) R Subtype.val
hf : ¬s.Finite
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: 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 (ι := { x // x ∈ s }) R Subtype.val
hf : ¬s.Finite
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
state_after: 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 (ι := { x // x ∈ s }) R Subtype.val
hf : ¬s.Finite
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: 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 (ι := { x // x ∈ s }) R Subtype.val
hf : ¬s.Finite
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
state_after: no goals
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]
    rfl⟩