l3lab/ntp-mathlib huggingface dataset:
theorem coprime_multiset_prod_left_iff {m : Multiset ℕ} {k : ℕ} :
    Coprime m.prod k ↔ ∀ n ∈ m, Coprime n k := by
  

Proof state:
ι : Type u_1
m : Multiset ℕ
k : ℕ
⊢ Coprime (Multiset.prod m) k ↔ ∀ n ∈ m, Coprime n k

Next tactic:
induction m using Quotient.inductionOn
theorem coprime_multiset_prod_left_iff {m : Multiset ℕ} {k : ℕ} :
    Coprime m.prod k ↔ ∀ n ∈ m, Coprime n k := by
  induction m using Quotient.inductionOn; 

Proof state:
case h
ι : Type u_1
k : ℕ
a✝ : List ℕ
⊢ Coprime (Multiset.prod ⟦a✝⟧) k ↔ ∀ n ∈ ⟦a✝⟧, Coprime n k

Next tactic:
simpa using coprime_list_prod_left_iff
theorem coprime_multiset_prod_right_iff {k : ℕ} {m : Multiset ℕ} :
    Coprime k m.prod ↔ ∀ n ∈ m, Coprime k n := by
  

Proof state:
ι : Type u_1
k : ℕ
m : Multiset ℕ
⊢ Coprime k (Multiset.prod m) ↔ ∀ n ∈ m, Coprime k n

Next tactic:
induction m using Quotient.inductionOn
theorem coprime_multiset_prod_right_iff {k : ℕ} {m : Multiset ℕ} :
    Coprime k m.prod ↔ ∀ n ∈ m, Coprime k n := by
  induction m using Quotient.inductionOn; 

Proof state:
case h
ι : Type u_1
k : ℕ
a✝ : List ℕ
⊢ Coprime k (Multiset.prod ⟦a✝⟧) ↔ ∀ n ∈ ⟦a✝⟧, Coprime k n

Next tactic:
simpa using coprime_list_prod_right_iff
theorem coprime_prod_left_iff {t : Finset ι} {s : ι → ℕ} {x : ℕ} :
    Coprime (∏ i in t, s i) x ↔ ∀ i ∈ t, Coprime (s i) x := by
  

Proof state:
ι : Type u_1
t : Finset ι
s : ι → ℕ
x : ℕ
⊢ Coprime (∏ i in t, s i) x ↔ ∀ i ∈ t, Coprime (s i) x

Next tactic:
simpa using coprime_multiset_prod_left_iff (m := t.val.map s)
theorem coprime_prod_right_iff {x : ℕ} {t : Finset ι} {s : ι → ℕ} :
    Coprime x (∏ i in t, s i) ↔ ∀ i ∈ t, Coprime x (s i) := by
  

Proof state:
ι : Type u_1
x : ℕ
t : Finset ι
s : ι → ℕ
⊢ Coprime x (∏ i in t, s i) ↔ ∀ i ∈ t, Coprime x (s i)

Next tactic:
simpa using coprime_multiset_prod_right_iff (m := t.val.map s)
theorem coprime_fintype_prod_left_iff [Fintype ι] {s : ι → ℕ} {x : ℕ} :
    Coprime (∏ i, s i) x ↔ ∀ i, Coprime (s i) x := by
  

Proof state:
ι : Type u_1
inst✝ : Fintype ι
s : ι → ℕ
x : ℕ
⊢ Coprime (∏ i : ι, s i) x ↔ ∀ (i : ι), Coprime (s i) x

Next tactic:
simp [coprime_prod_left_iff]
theorem coprime_fintype_prod_right_iff [Fintype ι] {x : ℕ} {s : ι → ℕ} :
    Coprime x (∏ i, s i) ↔ ∀ i, Coprime x (s i) := by
  

Proof state:
ι : Type u_1
inst✝ : Fintype ι
x : ℕ
s : ι → ℕ
⊢ Coprime x (∏ i : ι, s i) ↔ ∀ (i : ι), Coprime x (s i)

Next tactic:
simp [coprime_prod_right_iff]
/-- A ring satisfies the strong rank condition if and only if, for all `n : ℕ`, any linear map
`(Fin (n + 1) → R) →ₗ[R] (Fin n → R)` is not injective. -/
theorem strongRankCondition_iff_succ :
    StrongRankCondition R ↔
      ∀ (n : ℕ) (f : (Fin (n + 1) → R) →ₗ[R] Fin n → R), ¬Function.Injective f := by
  

Proof state:
R : Type u
inst✝ : Semiring R
⊢ StrongRankCondition R ↔ ∀ (n : ℕ) (f : (Fin (n + 1) → R) →ₗ[R] Fin n → R), ¬Injective ⇑f

Next tactic:
refine' ⟨fun h n => fun f hf => _, fun h => ⟨@fun n m f hf => _⟩⟩
/-- A ring satisfies the strong rank condition if and only if, for all `n : ℕ`, any linear map
`(Fin (n + 1) → R) →ₗ[R] (Fin n → R)` is not injective. -/
theorem strongRankCondition_iff_succ :
    StrongRankCondition R ↔
      ∀ (n : ℕ) (f : (Fin (n + 1) → R) →ₗ[R] Fin n → R), ¬Function.Injective f := by
  refine' ⟨fun h n => fun f hf => _, fun h => ⟨@fun n m f hf => _⟩⟩
  · 

Proof state:
case refine'_1
R : Type u
inst✝ : Semiring R
h : StrongRankCondition R
n : ℕ
f : (Fin (n + 1) → R) →ₗ[R] Fin n → R
hf : Injective ⇑f
⊢ False

Next tactic:
letI : StrongRankCondition R := h
/-- A ring satisfies the strong rank condition if and only if, for all `n : ℕ`, any linear map
`(Fin (n + 1) → R) →ₗ[R] (Fin n → R)` is not injective. -/
theorem strongRankCondition_iff_succ :
    StrongRankCondition R ↔
      ∀ (n : ℕ) (f : (Fin (n + 1) → R) →ₗ[R] Fin n → R), ¬Function.Injective f := by
  refine' ⟨fun h n => fun f hf => _, fun h => ⟨@fun n m f hf => _⟩⟩
  · letI : StrongRankCondition R := h
    

Proof state:
case refine'_1
R : Type u
inst✝ : Semiring R
h : StrongRankCondition R
n : ℕ
f : (Fin (n + 1) → R) →ₗ[R] Fin n → R
hf : Injective ⇑f
this : StrongRankCondition R := h
⊢ False

Next tactic:
exact Nat.not_succ_le_self n (le_of_fin_injective R f hf)
/-- A ring satisfies the strong rank condition if and only if, for all `n : ℕ`, any linear map
`(Fin (n + 1) → R) →ₗ[R] (Fin n → R)` is not injective. -/
theorem strongRankCondition_iff_succ :
    StrongRankCondition R ↔
      ∀ (n : ℕ) (f : (Fin (n + 1) → R) →ₗ[R] Fin n → R), ¬Function.Injective f := by
  refine' ⟨fun h n => fun f hf => _, fun h => ⟨@fun n m f hf => _⟩⟩
  · letI : StrongRankCondition R := h
    exact Nat.not_succ_le_self n (le_of_fin_injective R f hf)
  · 

Proof state:
case refine'_2
R : Type u
inst✝ : Semiring R
h : ∀ (n : ℕ) (f : (Fin (n + 1) → R) →ₗ[R] Fin n → R), ¬Injective ⇑f
n m : ℕ
f : (Fin n → R) →ₗ[R] Fin m → R
hf : Injective ⇑f
⊢ n ≤ m

Next tactic:
by_contra H
/-- A ring satisfies the strong rank condition if and only if, for all `n : ℕ`, any linear map
`(Fin (n + 1) → R) →ₗ[R] (Fin n → R)` is not injective. -/
theorem strongRankCondition_iff_succ :
    StrongRankCondition R ↔
      ∀ (n : ℕ) (f : (Fin (n + 1) → R) →ₗ[R] Fin n → R), ¬Function.Injective f := by
  refine' ⟨fun h n => fun f hf => _, fun h => ⟨@fun n m f hf => _⟩⟩
  · letI : StrongRankCondition R := h
    exact Nat.not_succ_le_self n (le_of_fin_injective R f hf)
  · by_contra H
    

Proof state:
case refine'_2
R : Type u
inst✝ : Semiring R
h : ∀ (n : ℕ) (f : (Fin (n + 1) → R) →ₗ[R] Fin n → R), ¬Injective ⇑f
n m : ℕ
f : (Fin n → R) →ₗ[R] Fin m → R
hf : Injective ⇑f
H : ¬n ≤ m
⊢ False

Next tactic:
exact
      h m (f.comp (Function.ExtendByZero.linearMap R (Fin.castLE (not_le.1 H))))
        (hf.comp (Function.extend_injective (Fin.strictMono_castLE _).injective _))
theorem card_le_of_injective [StrongRankCondition R] {α β : Type*} [Fintype α] [Fintype β]
    (f : (α → R) →ₗ[R] β → R) (i : Injective f) : Fintype.card α ≤ Fintype.card β := by
  

Proof state:
R : Type u
inst✝³ : Semiring R
inst✝² : StrongRankCondition R
α : Type u_1
β : Type u_2
inst✝¹ : Fintype α
inst✝ : Fintype β
f : (α → R) →ₗ[R] β → R
i : Injective ⇑f
⊢ Fintype.card α ≤ Fintype.card β

Next tactic:
let P := LinearEquiv.funCongrLeft R R (Fintype.equivFin α)
theorem card_le_of_injective [StrongRankCondition R] {α β : Type*} [Fintype α] [Fintype β]
    (f : (α → R) →ₗ[R] β → R) (i : Injective f) : Fintype.card α ≤ Fintype.card β := by
  let P := LinearEquiv.funCongrLeft R R (Fintype.equivFin α)
  

Proof state:
R : Type u
inst✝³ : Semiring R
inst✝² : StrongRankCondition R
α : Type u_1
β : Type u_2
inst✝¹ : Fintype α
inst✝ : Fintype β
f : (α → R) →ₗ[R] β → R
i : Injective ⇑f
P : (Fin (Fintype.card α) → R) ≃ₗ[R] α → R := LinearEquiv.funCongrLeft R R (Fintype.equivFin α)
⊢ Fintype.card α ≤ Fintype.card β

Next tactic:
let Q := LinearEquiv.funCongrLeft R R (Fintype.equivFin β)
theorem card_le_of_injective [StrongRankCondition R] {α β : Type*} [Fintype α] [Fintype β]
    (f : (α → R) →ₗ[R] β → R) (i : Injective f) : Fintype.card α ≤ Fintype.card β := by
  let P := LinearEquiv.funCongrLeft R R (Fintype.equivFin α)
  let Q := LinearEquiv.funCongrLeft R R (Fintype.equivFin β)
  

Proof state:
R : Type u
inst✝³ : Semiring R
inst✝² : StrongRankCondition R
α : Type u_1
β : Type u_2
inst✝¹ : Fintype α
inst✝ : Fintype β
f : (α → R) →ₗ[R] β → R
i : Injective ⇑f
P : (Fin (Fintype.card α) → R) ≃ₗ[R] α → R := LinearEquiv.funCongrLeft R R (Fintype.equivFin α)
Q : (Fin (Fintype.card β) → R) ≃ₗ[R] β → R := LinearEquiv.funCongrLeft R R (Fintype.equivFin β)
⊢ Fintype.card α ≤ Fintype.card β

Next tactic:
exact
    le_of_fin_injective R ((Q.symm.toLinearMap.comp f).comp P.toLinearMap)
      (((LinearEquiv.symm Q).injective.comp i).comp (LinearEquiv.injective P))
theorem card_le_of_injective' [StrongRankCondition R] {α β : Type*} [Fintype α] [Fintype β]
    (f : (α →₀ R) →ₗ[R] β →₀ R) (i : Injective f) : Fintype.card α ≤ Fintype.card β := by
  

Proof state:
R : Type u
inst✝³ : Semiring R
inst✝² : StrongRankCondition R
α : Type u_1
β : Type u_2
inst✝¹ : Fintype α
inst✝ : Fintype β
f : (α →₀ R) →ₗ[R] β →₀ R
i : Injective ⇑f
⊢ Fintype.card α ≤ Fintype.card β

Next tactic:
let P := Finsupp.linearEquivFunOnFinite R R β
theorem card_le_of_injective' [StrongRankCondition R] {α β : Type*} [Fintype α] [Fintype β]
    (f : (α →₀ R) →ₗ[R] β →₀ R) (i : Injective f) : Fintype.card α ≤ Fintype.card β := by
  let P := Finsupp.linearEquivFunOnFinite R R β
  

Proof state:
R : Type u
inst✝³ : Semiring R
inst✝² : StrongRankCondition R
α : Type u_1
β : Type u_2
inst✝¹ : Fintype α
inst✝ : Fintype β
f : (α →₀ R) →ₗ[R] β →₀ R
i : Injective ⇑f
P : (β →₀ R) ≃ₗ[R] β → R := Finsupp.linearEquivFunOnFinite R R β
⊢ Fintype.card α ≤ Fintype.card β

Next tactic:
let Q := (Finsupp.linearEquivFunOnFinite R R α).symm
theorem card_le_of_injective' [StrongRankCondition R] {α β : Type*} [Fintype α] [Fintype β]
    (f : (α →₀ R) →ₗ[R] β →₀ R) (i : Injective f) : Fintype.card α ≤ Fintype.card β := by
  let P := Finsupp.linearEquivFunOnFinite R R β
  let Q := (Finsupp.linearEquivFunOnFinite R R α).symm
  

Proof state:
R : Type u
inst✝³ : Semiring R
inst✝² : StrongRankCondition R
α : Type u_1
β : Type u_2
inst✝¹ : Fintype α
inst✝ : Fintype β
f : (α →₀ R) →ₗ[R] β →₀ R
i : Injective ⇑f
P : (β →₀ R) ≃ₗ[R] β → R := Finsupp.linearEquivFunOnFinite R R β
Q : (α → R) ≃ₗ[R] α →₀ R := LinearEquiv.symm (Finsupp.linearEquivFunOnFinite R R α)
⊢ Fintype.card α ≤ Fintype.card β

Next tactic:
exact
    card_le_of_injective R ((P.toLinearMap.comp f).comp Q.toLinearMap)
      ((P.injective.comp i).comp Q.injective)
theorem card_le_of_surjective [RankCondition R] {α β : Type*} [Fintype α] [Fintype β]
    (f : (α → R) →ₗ[R] β → R) (i : Surjective f) : Fintype.card β ≤ Fintype.card α := by
  

Proof state:
R : Type u
inst✝³ : Semiring R
inst✝² : RankCondition R
α : Type u_1
β : Type u_2
inst✝¹ : Fintype α
inst✝ : Fintype β
f : (α → R) →ₗ[R] β → R
i : Surjective ⇑f
⊢ Fintype.card β ≤ Fintype.card α

Next tactic:
let P := LinearEquiv.funCongrLeft R R (Fintype.equivFin α)
theorem card_le_of_surjective [RankCondition R] {α β : Type*} [Fintype α] [Fintype β]
    (f : (α → R) →ₗ[R] β → R) (i : Surjective f) : Fintype.card β ≤ Fintype.card α := by
  let P := LinearEquiv.funCongrLeft R R (Fintype.equivFin α)
  

Proof state:
R : Type u
inst✝³ : Semiring R
inst✝² : RankCondition R
α : Type u_1
β : Type u_2
inst✝¹ : Fintype α
inst✝ : Fintype β
f : (α → R) →ₗ[R] β → R
i : Surjective ⇑f
P : (Fin (Fintype.card α) → R) ≃ₗ[R] α → R := LinearEquiv.funCongrLeft R R (Fintype.equivFin α)
⊢ Fintype.card β ≤ Fintype.card α

Next tactic:
let Q := LinearEquiv.funCongrLeft R R (Fintype.equivFin β)
theorem card_le_of_surjective [RankCondition R] {α β : Type*} [Fintype α] [Fintype β]
    (f : (α → R) →ₗ[R] β → R) (i : Surjective f) : Fintype.card β ≤ Fintype.card α := by
  let P := LinearEquiv.funCongrLeft R R (Fintype.equivFin α)
  let Q := LinearEquiv.funCongrLeft R R (Fintype.equivFin β)
  

Proof state:
R : Type u
inst✝³ : Semiring R
inst✝² : RankCondition R
α : Type u_1
β : Type u_2
inst✝¹ : Fintype α
inst✝ : Fintype β
f : (α → R) →ₗ[R] β → R
i : Surjective ⇑f
P : (Fin (Fintype.card α) → R) ≃ₗ[R] α → R := LinearEquiv.funCongrLeft R R (Fintype.equivFin α)
Q : (Fin (Fintype.card β) → R) ≃ₗ[R] β → R := LinearEquiv.funCongrLeft R R (Fintype.equivFin β)
⊢ Fintype.card β ≤ Fintype.card α

Next tactic:
exact
    le_of_fin_surjective R ((Q.symm.toLinearMap.comp f).comp P.toLinearMap)
      (((LinearEquiv.symm Q).surjective.comp i).comp (LinearEquiv.surjective P))
theorem card_le_of_surjective' [RankCondition R] {α β : Type*} [Fintype α] [Fintype β]
    (f : (α →₀ R) →ₗ[R] β →₀ R) (i : Surjective f) : Fintype.card β ≤ Fintype.card α := by
  

Proof state:
R : Type u
inst✝³ : Semiring R
inst✝² : RankCondition R
α : Type u_1
β : Type u_2
inst✝¹ : Fintype α
inst✝ : Fintype β
f : (α →₀ R) →ₗ[R] β →₀ R
i : Surjective ⇑f
⊢ Fintype.card β ≤ Fintype.card α

Next tactic:
let P := Finsupp.linearEquivFunOnFinite R R β
theorem card_le_of_surjective' [RankCondition R] {α β : Type*} [Fintype α] [Fintype β]
    (f : (α →₀ R) →ₗ[R] β →₀ R) (i : Surjective f) : Fintype.card β ≤ Fintype.card α := by
  let P := Finsupp.linearEquivFunOnFinite R R β
  

Proof state:
R : Type u
inst✝³ : Semiring R
inst✝² : RankCondition R
α : Type u_1
β : Type u_2
inst✝¹ : Fintype α
inst✝ : Fintype β
f : (α →₀ R) →ₗ[R] β →₀ R
i : Surjective ⇑f
P : (β →₀ R) ≃ₗ[R] β → R := Finsupp.linearEquivFunOnFinite R R β
⊢ Fintype.card β ≤ Fintype.card α

Next tactic:
let Q := (Finsupp.linearEquivFunOnFinite R R α).symm
theorem card_le_of_surjective' [RankCondition R] {α β : Type*} [Fintype α] [Fintype β]
    (f : (α →₀ R) →ₗ[R] β →₀ R) (i : Surjective f) : Fintype.card β ≤ Fintype.card α := by
  let P := Finsupp.linearEquivFunOnFinite R R β
  let Q := (Finsupp.linearEquivFunOnFinite R R α).symm
  

Proof state:
R : Type u
inst✝³ : Semiring R
inst✝² : RankCondition R
α : Type u_1
β : Type u_2
inst✝¹ : Fintype α
inst✝ : Fintype β
f : (α →₀ R) →ₗ[R] β →₀ R
i : Surjective ⇑f
P : (β →₀ R) ≃ₗ[R] β → R := Finsupp.linearEquivFunOnFinite R R β
Q : (α → R) ≃ₗ[R] α →₀ R := LinearEquiv.symm (Finsupp.linearEquivFunOnFinite R R α)
⊢ Fintype.card β ≤ Fintype.card α

Next tactic:
exact
    card_le_of_surjective R ((P.toLinearMap.comp f).comp Q.toLinearMap)
      ((P.surjective.comp i).comp Q.surjective)
theorem nontrivial_of_invariantBasisNumber : Nontrivial R := by
  

Proof state:
R : Type u
inst✝¹ : Semiring R
inst✝ : InvariantBasisNumber R
⊢ Nontrivial R

Next tactic:
by_contra h
theorem nontrivial_of_invariantBasisNumber : Nontrivial R := by
  by_contra h
  

Proof state:
R : Type u
inst✝¹ : Semiring R
inst✝ : InvariantBasisNumber R
h : ¬Nontrivial R
⊢ False

Next tactic:
refine' zero_ne_one (eq_of_fin_equiv R _)
theorem nontrivial_of_invariantBasisNumber : Nontrivial R := by
  by_contra h
  refine' zero_ne_one (eq_of_fin_equiv R _)
  

Proof state:
R : Type u
inst✝¹ : Semiring R
inst✝ : InvariantBasisNumber R
h : ¬Nontrivial R
⊢ (Fin 0 → R) ≃ₗ[R] Fin 1 → R

Next tactic:
haveI := not_nontrivial_iff_subsingleton.1 h
theorem nontrivial_of_invariantBasisNumber : Nontrivial R := by
  by_contra h
  refine' zero_ne_one (eq_of_fin_equiv R _)
  haveI := not_nontrivial_iff_subsingleton.1 h
  

Proof state:
R : Type u
inst✝¹ : Semiring R
inst✝ : InvariantBasisNumber R
h : ¬Nontrivial R
this : Subsingleton R
⊢ (Fin 0 → R) ≃ₗ[R] Fin 1 → R

Next tactic:
haveI : Subsingleton (Fin 1 → R) :=
    Subsingleton.intro <| fun a b => funext fun x => Subsingleton.elim _ _
theorem nontrivial_of_invariantBasisNumber : Nontrivial R := by
  by_contra h
  refine' zero_ne_one (eq_of_fin_equiv R _)
  haveI := not_nontrivial_iff_subsingleton.1 h
  haveI : Subsingleton (Fin 1 → R) :=
    Subsingleton.intro <| fun a b => funext fun x => Subsingleton.elim _ _
  

Proof state:
R : Type u
inst✝¹ : Semiring R
inst✝ : InvariantBasisNumber R
h : ¬Nontrivial R
this✝ : Subsingleton R
this : Subsingleton (Fin 1 → R)
⊢ (Fin 0 → R) ≃ₗ[R] Fin 1 → R

Next tactic:
exact
    { toFun := 0
      invFun := 0
      map_add' := by aesop
      map_smul' := by aesop
      left_inv := fun _ => by simp [eq_iff_true_of_subsingleton]
      right_inv := fun _ => by simp [eq_iff_true_of_subsingleton] }
theorem nontrivial_of_invariantBasisNumber : Nontrivial R := by
  by_contra h
  refine' zero_ne_one (eq_of_fin_equiv R _)
  haveI := not_nontrivial_iff_subsingleton.1 h
  haveI : Subsingleton (Fin 1 → R) :=
    Subsingleton.intro <| fun a b => funext fun x => Subsingleton.elim _ _
  exact
    { toFun := 0
      invFun := 0
      map_add' := by 

Proof state:
R : Type u
inst✝¹ : Semiring R
inst✝ : InvariantBasisNumber R
h : ¬Nontrivial R
this✝ : Subsingleton R
this : Subsingleton (Fin 1 → R)
⊢ ∀ (x y : Fin 0 → R), OfNat.ofNat 0 (x + y) = OfNat.ofNat 0 x + OfNat.ofNat 0 y

Next tactic:
aesop
theorem nontrivial_of_invariantBasisNumber : Nontrivial R := by
  by_contra h
  refine' zero_ne_one (eq_of_fin_equiv R _)
  haveI := not_nontrivial_iff_subsingleton.1 h
  haveI : Subsingleton (Fin 1 → R) :=
    Subsingleton.intro <| fun a b => funext fun x => Subsingleton.elim _ _
  exact
    { toFun := 0
      invFun := 0
      map_add' := by aesop
      map_smul' := by 

Proof state:
R : Type u
inst✝¹ : Semiring R
inst✝ : InvariantBasisNumber R
h : ¬Nontrivial R
this✝ : Subsingleton R
this : Subsingleton (Fin 1 → R)
⊢ ∀ (r : R) (x : Fin 0 → R),
    AddHom.toFun { toFun := 0, map_add' := (_ : ∀ (x y : Fin 0 → R), OfNat.ofNat 0 (x + y) = 0 + 0) } (r • x) =
      (RingHom.id R) r •
        AddHom.toFun { toFun := 0, map_add' := (_ : ∀ (x y : Fin 0 → R), OfNat.ofNat 0 (x + y) = 0 + 0) } x

Next tactic:
aesop
theorem nontrivial_of_invariantBasisNumber : Nontrivial R := by
  by_contra h
  refine' zero_ne_one (eq_of_fin_equiv R _)
  haveI := not_nontrivial_iff_subsingleton.1 h
  haveI : Subsingleton (Fin 1 → R) :=
    Subsingleton.intro <| fun a b => funext fun x => Subsingleton.elim _ _
  exact
    { toFun := 0
      invFun := 0
      map_add' := by aesop
      map_smul' := by aesop
      left_inv := fun _ => by 

Proof state:
R : Type u
inst✝¹ : Semiring R
inst✝ : InvariantBasisNumber R
h : ¬Nontrivial R
this✝ : Subsingleton R
this : Subsingleton (Fin 1 → R)
x✝ : Fin 0 → R
⊢ OfNat.ofNat 0
      (AddHom.toFun
        { toAddHom := { toFun := 0, map_add' := (_ : ∀ (x y : Fin 0 → R), OfNat.ofNat 0 (x + y) = 0 + 0) },
            map_smul' := (_ : ∀ (r : R) (x : Fin 0 → R), OfNat.ofNat 0 (r • x) = r • 0) }.toAddHom
        x✝) =
    x✝

Next tactic:
simp [eq_iff_true_of_subsingleton]
theorem nontrivial_of_invariantBasisNumber : Nontrivial R := by
  by_contra h
  refine' zero_ne_one (eq_of_fin_equiv R _)
  haveI := not_nontrivial_iff_subsingleton.1 h
  haveI : Subsingleton (Fin 1 → R) :=
    Subsingleton.intro <| fun a b => funext fun x => Subsingleton.elim _ _
  exact
    { toFun := 0
      invFun := 0
      map_add' := by aesop
      map_smul' := by aesop
      left_inv := fun _ => by simp [eq_iff_true_of_subsingleton]
      right_inv := fun _ => by 

Proof state:
R : Type u
inst✝¹ : Semiring R
inst✝ : InvariantBasisNumber R
h : ¬Nontrivial R
this✝ : Subsingleton R
this : Subsingleton (Fin 1 → R)
x✝ : Fin 1 → R
⊢ AddHom.toFun
      { toAddHom := { toFun := 0, map_add' := (_ : ∀ (x y : Fin 0 → R), OfNat.ofNat 0 (x + y) = 0 + 0) },
          map_smul' := (_ : ∀ (r : R) (x : Fin 0 → R), OfNat.ofNat 0 (r • x) = r • 0) }.toAddHom
      (OfNat.ofNat 0 x✝) =
    x✝

Next tactic:
simp [eq_iff_true_of_subsingleton]
/-- Any nontrivial noetherian ring satisfies the strong rank condition.

An injective map `((Fin n ⊕ Fin (1 + m)) → R) →ₗ[R] (Fin n → R)` for some left-noetherian `R`
would force `Fin (1 + m) → R ≃ₗ PUnit` (via `IsNoetherian.equivPUnitOfProdInjective`),
which is not the case!
-/
instance (priority := 100) IsNoetherianRing.strongRankCondition : StrongRankCondition R := by
  

Proof state:
R : Type u
inst✝² : Ring R
inst✝¹ : Nontrivial R
inst✝ : IsNoetherianRing R
⊢ StrongRankCondition R

Next tactic:
constructor
/-- Any nontrivial noetherian ring satisfies the strong rank condition.

An injective map `((Fin n ⊕ Fin (1 + m)) → R) →ₗ[R] (Fin n → R)` for some left-noetherian `R`
would force `Fin (1 + m) → R ≃ₗ PUnit` (via `IsNoetherian.equivPUnitOfProdInjective`),
which is not the case!
-/
instance (priority := 100) IsNoetherianRing.strongRankCondition : StrongRankCondition R := by
  constructor
  

Proof state:
case le_of_fin_injective
R : Type u
inst✝² : Ring R
inst✝¹ : Nontrivial R
inst✝ : IsNoetherianRing R
⊢ ∀ {n m : ℕ} (f : (Fin n → R) →ₗ[R] Fin m → R), Injective ⇑f → n ≤ m

Next tactic:
intro m n f i
/-- Any nontrivial noetherian ring satisfies the strong rank condition.

An injective map `((Fin n ⊕ Fin (1 + m)) → R) →ₗ[R] (Fin n → R)` for some left-noetherian `R`
would force `Fin (1 + m) → R ≃ₗ PUnit` (via `IsNoetherian.equivPUnitOfProdInjective`),
which is not the case!
-/
instance (priority := 100) IsNoetherianRing.strongRankCondition : StrongRankCondition R := by
  constructor
  intro m n f i
  

Proof state:
case le_of_fin_injective
R : Type u
inst✝² : Ring R
inst✝¹ : Nontrivial R
inst✝ : IsNoetherianRing R
m n : ℕ
f : (Fin m → R) →ₗ[R] Fin n → R
i : Injective ⇑f
⊢ m ≤ n

Next tactic:
by_contra h
/-- Any nontrivial noetherian ring satisfies the strong rank condition.

An injective map `((Fin n ⊕ Fin (1 + m)) → R) →ₗ[R] (Fin n → R)` for some left-noetherian `R`
would force `Fin (1 + m) → R ≃ₗ PUnit` (via `IsNoetherian.equivPUnitOfProdInjective`),
which is not the case!
-/
instance (priority := 100) IsNoetherianRing.strongRankCondition : StrongRankCondition R := by
  constructor
  intro m n f i
  by_contra h
  

Proof state:
case le_of_fin_injective
R : Type u
inst✝² : Ring R
inst✝¹ : Nontrivial R
inst✝ : IsNoetherianRing R
m n : ℕ
f : (Fin m → R) →ₗ[R] Fin n → R
i : Injective ⇑f
h : ¬m ≤ n
⊢ False

Next tactic:
rw [not_le, ← Nat.add_one_le_iff, le_iff_exists_add] at h
/-- Any nontrivial noetherian ring satisfies the strong rank condition.

An injective map `((Fin n ⊕ Fin (1 + m)) → R) →ₗ[R] (Fin n → R)` for some left-noetherian `R`
would force `Fin (1 + m) → R ≃ₗ PUnit` (via `IsNoetherian.equivPUnitOfProdInjective`),
which is not the case!
-/
instance (priority := 100) IsNoetherianRing.strongRankCondition : StrongRankCondition R := by
  constructor
  intro m n f i
  by_contra h
  rw [not_le, ← Nat.add_one_le_iff, le_iff_exists_add] at h
  

Proof state:
case le_of_fin_injective
R : Type u
inst✝² : Ring R
inst✝¹ : Nontrivial R
inst✝ : IsNoetherianRing R
m n : ℕ
f : (Fin m → R) →ₗ[R] Fin n → R
i : Injective ⇑f
h : ∃ c, m = n + 1 + c
⊢ False

Next tactic:
obtain ⟨m, rfl⟩ := h
/-- Any nontrivial noetherian ring satisfies the strong rank condition.

An injective map `((Fin n ⊕ Fin (1 + m)) → R) →ₗ[R] (Fin n → R)` for some left-noetherian `R`
would force `Fin (1 + m) → R ≃ₗ PUnit` (via `IsNoetherian.equivPUnitOfProdInjective`),
which is not the case!
-/
instance (priority := 100) IsNoetherianRing.strongRankCondition : StrongRankCondition R := by
  constructor
  intro m n f i
  by_contra h
  rw [not_le, ← Nat.add_one_le_iff, le_iff_exists_add] at h
  obtain ⟨m, rfl⟩ := h
  

Proof state:
case le_of_fin_injective.intro
R : Type u
inst✝² : Ring R
inst✝¹ : Nontrivial R
inst✝ : IsNoetherianRing R
n m : ℕ
f : (Fin (n + 1 + m) → R) →ₗ[R] Fin n → R
i : Injective ⇑f
⊢ False

Next tactic:
let e : Fin (n + 1 + m) ≃ Sum (Fin n) (Fin (1 + m)) :=
    (finCongr (add_assoc _ _ _)).trans finSumFinEquiv.symm
/-- Any nontrivial noetherian ring satisfies the strong rank condition.

An injective map `((Fin n ⊕ Fin (1 + m)) → R) →ₗ[R] (Fin n → R)` for some left-noetherian `R`
would force `Fin (1 + m) → R ≃ₗ PUnit` (via `IsNoetherian.equivPUnitOfProdInjective`),
which is not the case!
-/
instance (priority := 100) IsNoetherianRing.strongRankCondition : StrongRankCondition R := by
  constructor
  intro m n f i
  by_contra h
  rw [not_le, ← Nat.add_one_le_iff, le_iff_exists_add] at h
  obtain ⟨m, rfl⟩ := h
  let e : Fin (n + 1 + m) ≃ Sum (Fin n) (Fin (1 + m)) :=
    (finCongr (add_assoc _ _ _)).trans finSumFinEquiv.symm
  

Proof state:
case le_of_fin_injective.intro
R : Type u
inst✝² : Ring R
inst✝¹ : Nontrivial R
inst✝ : IsNoetherianRing R
n m : ℕ
f : (Fin (n + 1 + m) → R) →ₗ[R] Fin n → R
i : Injective ⇑f
e : Fin (n + 1 + m) ≃ Fin n ⊕ Fin (1 + m) := (finCongr (_ : n + 1 + m = n + (1 + m))).trans finSumFinEquiv.symm
⊢ False

Next tactic:
let f' :=
    f.comp
      ((LinearEquiv.sumArrowLequivProdArrow _ _ R R).symm.trans
          (LinearEquiv.funCongrLeft R R e)).toLinearMap