Context stringlengths 57 6.04k | file_name stringlengths 21 79 | start int64 14 1.49k | end int64 18 1.5k | theorem stringlengths 25 1.55k | proof stringlengths 5 7.36k | rank int64 0 2.4k |
|---|---|---|---|---|---|---|
import Mathlib.LinearAlgebra.Span
import Mathlib.RingTheory.Ideal.IsPrimary
import Mathlib.RingTheory.Ideal.QuotientOperations
import Mathlib.RingTheory.Noetherian
#align_import ring_theory.ideal.associated_prime from "leanprover-community/mathlib"@"f0c8bf9245297a541f468be517f1bde6195105e9"
variable {R : Type*} [CommRing R] (I J : Ideal R) (M : Type*) [AddCommGroup M] [Module R M]
def IsAssociatedPrime : Prop :=
I.IsPrime ∧ ∃ x : M, I = (R ∙ x).annihilator
#align is_associated_prime IsAssociatedPrime
variable (R)
def associatedPrimes : Set (Ideal R) :=
{ I | IsAssociatedPrime I M }
#align associated_primes associatedPrimes
variable {I J M R}
variable {M' : Type*} [AddCommGroup M'] [Module R M'] (f : M →ₗ[R] M')
theorem AssociatePrimes.mem_iff : I ∈ associatedPrimes R M ↔ IsAssociatedPrime I M := Iff.rfl
#align associate_primes.mem_iff AssociatePrimes.mem_iff
theorem IsAssociatedPrime.isPrime (h : IsAssociatedPrime I M) : I.IsPrime := h.1
#align is_associated_prime.is_prime IsAssociatedPrime.isPrime
theorem IsAssociatedPrime.map_of_injective (h : IsAssociatedPrime I M) (hf : Function.Injective f) :
IsAssociatedPrime I M' := by
obtain ⟨x, rfl⟩ := h.2
refine ⟨h.1, ⟨f x, ?_⟩⟩
ext r
rw [Submodule.mem_annihilator_span_singleton, Submodule.mem_annihilator_span_singleton, ←
map_smul, ← f.map_zero, hf.eq_iff]
#align is_associated_prime.map_of_injective IsAssociatedPrime.map_of_injective
theorem LinearEquiv.isAssociatedPrime_iff (l : M ≃ₗ[R] M') :
IsAssociatedPrime I M ↔ IsAssociatedPrime I M' :=
⟨fun h => h.map_of_injective l l.injective,
fun h => h.map_of_injective l.symm l.symm.injective⟩
#align linear_equiv.is_associated_prime_iff LinearEquiv.isAssociatedPrime_iff
theorem not_isAssociatedPrime_of_subsingleton [Subsingleton M] : ¬IsAssociatedPrime I M := by
rintro ⟨hI, x, hx⟩
apply hI.ne_top
rwa [Subsingleton.elim x 0, Submodule.span_singleton_eq_bot.mpr rfl, Submodule.annihilator_bot]
at hx
#align not_is_associated_prime_of_subsingleton not_isAssociatedPrime_of_subsingleton
variable (R)
| Mathlib/RingTheory/Ideal/AssociatedPrime.lean | 83 | 103 | theorem exists_le_isAssociatedPrime_of_isNoetherianRing [H : IsNoetherianRing R] (x : M)
(hx : x ≠ 0) : ∃ P : Ideal R, IsAssociatedPrime P M ∧ (R ∙ x).annihilator ≤ P := by |
have : (R ∙ x).annihilator ≠ ⊤ := by
rwa [Ne, Ideal.eq_top_iff_one, Submodule.mem_annihilator_span_singleton, one_smul]
obtain ⟨P, ⟨l, h₁, y, rfl⟩, h₃⟩ :=
set_has_maximal_iff_noetherian.mpr H
{ P | (R ∙ x).annihilator ≤ P ∧ P ≠ ⊤ ∧ ∃ y : M, P = (R ∙ y).annihilator }
⟨(R ∙ x).annihilator, rfl.le, this, x, rfl⟩
refine ⟨_, ⟨⟨h₁, ?_⟩, y, rfl⟩, l⟩
intro a b hab
rw [or_iff_not_imp_left]
intro ha
rw [Submodule.mem_annihilator_span_singleton] at ha hab
have H₁ : (R ∙ y).annihilator ≤ (R ∙ a • y).annihilator := by
intro c hc
rw [Submodule.mem_annihilator_span_singleton] at hc ⊢
rw [smul_comm, hc, smul_zero]
have H₂ : (Submodule.span R {a • y}).annihilator ≠ ⊤ := by
rwa [Ne, Submodule.annihilator_eq_top_iff, Submodule.span_singleton_eq_bot]
rwa [H₁.eq_of_not_lt (h₃ (R ∙ a • y).annihilator ⟨l.trans H₁, H₂, _, rfl⟩),
Submodule.mem_annihilator_span_singleton, smul_comm, smul_smul]
| 1,713 |
import Mathlib.LinearAlgebra.Span
import Mathlib.RingTheory.Ideal.IsPrimary
import Mathlib.RingTheory.Ideal.QuotientOperations
import Mathlib.RingTheory.Noetherian
#align_import ring_theory.ideal.associated_prime from "leanprover-community/mathlib"@"f0c8bf9245297a541f468be517f1bde6195105e9"
variable {R : Type*} [CommRing R] (I J : Ideal R) (M : Type*) [AddCommGroup M] [Module R M]
def IsAssociatedPrime : Prop :=
I.IsPrime ∧ ∃ x : M, I = (R ∙ x).annihilator
#align is_associated_prime IsAssociatedPrime
variable (R)
def associatedPrimes : Set (Ideal R) :=
{ I | IsAssociatedPrime I M }
#align associated_primes associatedPrimes
variable {I J M R}
variable {M' : Type*} [AddCommGroup M'] [Module R M'] (f : M →ₗ[R] M')
theorem AssociatePrimes.mem_iff : I ∈ associatedPrimes R M ↔ IsAssociatedPrime I M := Iff.rfl
#align associate_primes.mem_iff AssociatePrimes.mem_iff
theorem IsAssociatedPrime.isPrime (h : IsAssociatedPrime I M) : I.IsPrime := h.1
#align is_associated_prime.is_prime IsAssociatedPrime.isPrime
theorem IsAssociatedPrime.map_of_injective (h : IsAssociatedPrime I M) (hf : Function.Injective f) :
IsAssociatedPrime I M' := by
obtain ⟨x, rfl⟩ := h.2
refine ⟨h.1, ⟨f x, ?_⟩⟩
ext r
rw [Submodule.mem_annihilator_span_singleton, Submodule.mem_annihilator_span_singleton, ←
map_smul, ← f.map_zero, hf.eq_iff]
#align is_associated_prime.map_of_injective IsAssociatedPrime.map_of_injective
theorem LinearEquiv.isAssociatedPrime_iff (l : M ≃ₗ[R] M') :
IsAssociatedPrime I M ↔ IsAssociatedPrime I M' :=
⟨fun h => h.map_of_injective l l.injective,
fun h => h.map_of_injective l.symm l.symm.injective⟩
#align linear_equiv.is_associated_prime_iff LinearEquiv.isAssociatedPrime_iff
theorem not_isAssociatedPrime_of_subsingleton [Subsingleton M] : ¬IsAssociatedPrime I M := by
rintro ⟨hI, x, hx⟩
apply hI.ne_top
rwa [Subsingleton.elim x 0, Submodule.span_singleton_eq_bot.mpr rfl, Submodule.annihilator_bot]
at hx
#align not_is_associated_prime_of_subsingleton not_isAssociatedPrime_of_subsingleton
variable (R)
theorem exists_le_isAssociatedPrime_of_isNoetherianRing [H : IsNoetherianRing R] (x : M)
(hx : x ≠ 0) : ∃ P : Ideal R, IsAssociatedPrime P M ∧ (R ∙ x).annihilator ≤ P := by
have : (R ∙ x).annihilator ≠ ⊤ := by
rwa [Ne, Ideal.eq_top_iff_one, Submodule.mem_annihilator_span_singleton, one_smul]
obtain ⟨P, ⟨l, h₁, y, rfl⟩, h₃⟩ :=
set_has_maximal_iff_noetherian.mpr H
{ P | (R ∙ x).annihilator ≤ P ∧ P ≠ ⊤ ∧ ∃ y : M, P = (R ∙ y).annihilator }
⟨(R ∙ x).annihilator, rfl.le, this, x, rfl⟩
refine ⟨_, ⟨⟨h₁, ?_⟩, y, rfl⟩, l⟩
intro a b hab
rw [or_iff_not_imp_left]
intro ha
rw [Submodule.mem_annihilator_span_singleton] at ha hab
have H₁ : (R ∙ y).annihilator ≤ (R ∙ a • y).annihilator := by
intro c hc
rw [Submodule.mem_annihilator_span_singleton] at hc ⊢
rw [smul_comm, hc, smul_zero]
have H₂ : (Submodule.span R {a • y}).annihilator ≠ ⊤ := by
rwa [Ne, Submodule.annihilator_eq_top_iff, Submodule.span_singleton_eq_bot]
rwa [H₁.eq_of_not_lt (h₃ (R ∙ a • y).annihilator ⟨l.trans H₁, H₂, _, rfl⟩),
Submodule.mem_annihilator_span_singleton, smul_comm, smul_smul]
#align exists_le_is_associated_prime_of_is_noetherian_ring exists_le_isAssociatedPrime_of_isNoetherianRing
variable {R}
theorem associatedPrimes.subset_of_injective (hf : Function.Injective f) :
associatedPrimes R M ⊆ associatedPrimes R M' := fun _I h => h.map_of_injective f hf
#align associated_primes.subset_of_injective associatedPrimes.subset_of_injective
theorem LinearEquiv.AssociatedPrimes.eq (l : M ≃ₗ[R] M') :
associatedPrimes R M = associatedPrimes R M' :=
le_antisymm (associatedPrimes.subset_of_injective l l.injective)
(associatedPrimes.subset_of_injective l.symm l.symm.injective)
#align linear_equiv.associated_primes.eq LinearEquiv.AssociatedPrimes.eq
| Mathlib/RingTheory/Ideal/AssociatedPrime.lean | 118 | 120 | theorem associatedPrimes.eq_empty_of_subsingleton [Subsingleton M] : associatedPrimes R M = ∅ := by |
ext; simp only [Set.mem_empty_iff_false, iff_false_iff];
apply not_isAssociatedPrime_of_subsingleton
| 1,713 |
import Mathlib.LinearAlgebra.Span
import Mathlib.RingTheory.Ideal.IsPrimary
import Mathlib.RingTheory.Ideal.QuotientOperations
import Mathlib.RingTheory.Noetherian
#align_import ring_theory.ideal.associated_prime from "leanprover-community/mathlib"@"f0c8bf9245297a541f468be517f1bde6195105e9"
variable {R : Type*} [CommRing R] (I J : Ideal R) (M : Type*) [AddCommGroup M] [Module R M]
def IsAssociatedPrime : Prop :=
I.IsPrime ∧ ∃ x : M, I = (R ∙ x).annihilator
#align is_associated_prime IsAssociatedPrime
variable (R)
def associatedPrimes : Set (Ideal R) :=
{ I | IsAssociatedPrime I M }
#align associated_primes associatedPrimes
variable {I J M R}
variable {M' : Type*} [AddCommGroup M'] [Module R M'] (f : M →ₗ[R] M')
theorem AssociatePrimes.mem_iff : I ∈ associatedPrimes R M ↔ IsAssociatedPrime I M := Iff.rfl
#align associate_primes.mem_iff AssociatePrimes.mem_iff
theorem IsAssociatedPrime.isPrime (h : IsAssociatedPrime I M) : I.IsPrime := h.1
#align is_associated_prime.is_prime IsAssociatedPrime.isPrime
theorem IsAssociatedPrime.map_of_injective (h : IsAssociatedPrime I M) (hf : Function.Injective f) :
IsAssociatedPrime I M' := by
obtain ⟨x, rfl⟩ := h.2
refine ⟨h.1, ⟨f x, ?_⟩⟩
ext r
rw [Submodule.mem_annihilator_span_singleton, Submodule.mem_annihilator_span_singleton, ←
map_smul, ← f.map_zero, hf.eq_iff]
#align is_associated_prime.map_of_injective IsAssociatedPrime.map_of_injective
theorem LinearEquiv.isAssociatedPrime_iff (l : M ≃ₗ[R] M') :
IsAssociatedPrime I M ↔ IsAssociatedPrime I M' :=
⟨fun h => h.map_of_injective l l.injective,
fun h => h.map_of_injective l.symm l.symm.injective⟩
#align linear_equiv.is_associated_prime_iff LinearEquiv.isAssociatedPrime_iff
theorem not_isAssociatedPrime_of_subsingleton [Subsingleton M] : ¬IsAssociatedPrime I M := by
rintro ⟨hI, x, hx⟩
apply hI.ne_top
rwa [Subsingleton.elim x 0, Submodule.span_singleton_eq_bot.mpr rfl, Submodule.annihilator_bot]
at hx
#align not_is_associated_prime_of_subsingleton not_isAssociatedPrime_of_subsingleton
variable (R)
theorem exists_le_isAssociatedPrime_of_isNoetherianRing [H : IsNoetherianRing R] (x : M)
(hx : x ≠ 0) : ∃ P : Ideal R, IsAssociatedPrime P M ∧ (R ∙ x).annihilator ≤ P := by
have : (R ∙ x).annihilator ≠ ⊤ := by
rwa [Ne, Ideal.eq_top_iff_one, Submodule.mem_annihilator_span_singleton, one_smul]
obtain ⟨P, ⟨l, h₁, y, rfl⟩, h₃⟩ :=
set_has_maximal_iff_noetherian.mpr H
{ P | (R ∙ x).annihilator ≤ P ∧ P ≠ ⊤ ∧ ∃ y : M, P = (R ∙ y).annihilator }
⟨(R ∙ x).annihilator, rfl.le, this, x, rfl⟩
refine ⟨_, ⟨⟨h₁, ?_⟩, y, rfl⟩, l⟩
intro a b hab
rw [or_iff_not_imp_left]
intro ha
rw [Submodule.mem_annihilator_span_singleton] at ha hab
have H₁ : (R ∙ y).annihilator ≤ (R ∙ a • y).annihilator := by
intro c hc
rw [Submodule.mem_annihilator_span_singleton] at hc ⊢
rw [smul_comm, hc, smul_zero]
have H₂ : (Submodule.span R {a • y}).annihilator ≠ ⊤ := by
rwa [Ne, Submodule.annihilator_eq_top_iff, Submodule.span_singleton_eq_bot]
rwa [H₁.eq_of_not_lt (h₃ (R ∙ a • y).annihilator ⟨l.trans H₁, H₂, _, rfl⟩),
Submodule.mem_annihilator_span_singleton, smul_comm, smul_smul]
#align exists_le_is_associated_prime_of_is_noetherian_ring exists_le_isAssociatedPrime_of_isNoetherianRing
variable {R}
theorem associatedPrimes.subset_of_injective (hf : Function.Injective f) :
associatedPrimes R M ⊆ associatedPrimes R M' := fun _I h => h.map_of_injective f hf
#align associated_primes.subset_of_injective associatedPrimes.subset_of_injective
theorem LinearEquiv.AssociatedPrimes.eq (l : M ≃ₗ[R] M') :
associatedPrimes R M = associatedPrimes R M' :=
le_antisymm (associatedPrimes.subset_of_injective l l.injective)
(associatedPrimes.subset_of_injective l.symm l.symm.injective)
#align linear_equiv.associated_primes.eq LinearEquiv.AssociatedPrimes.eq
theorem associatedPrimes.eq_empty_of_subsingleton [Subsingleton M] : associatedPrimes R M = ∅ := by
ext; simp only [Set.mem_empty_iff_false, iff_false_iff];
apply not_isAssociatedPrime_of_subsingleton
#align associated_primes.eq_empty_of_subsingleton associatedPrimes.eq_empty_of_subsingleton
variable (R M)
| Mathlib/RingTheory/Ideal/AssociatedPrime.lean | 125 | 129 | theorem associatedPrimes.nonempty [IsNoetherianRing R] [Nontrivial M] :
(associatedPrimes R M).Nonempty := by |
obtain ⟨x, hx⟩ := exists_ne (0 : M)
obtain ⟨P, hP, _⟩ := exists_le_isAssociatedPrime_of_isNoetherianRing R x hx
exact ⟨P, hP⟩
| 1,713 |
import Mathlib.LinearAlgebra.Span
import Mathlib.RingTheory.Ideal.IsPrimary
import Mathlib.RingTheory.Ideal.QuotientOperations
import Mathlib.RingTheory.Noetherian
#align_import ring_theory.ideal.associated_prime from "leanprover-community/mathlib"@"f0c8bf9245297a541f468be517f1bde6195105e9"
variable {R : Type*} [CommRing R] (I J : Ideal R) (M : Type*) [AddCommGroup M] [Module R M]
def IsAssociatedPrime : Prop :=
I.IsPrime ∧ ∃ x : M, I = (R ∙ x).annihilator
#align is_associated_prime IsAssociatedPrime
variable (R)
def associatedPrimes : Set (Ideal R) :=
{ I | IsAssociatedPrime I M }
#align associated_primes associatedPrimes
variable {I J M R}
variable {M' : Type*} [AddCommGroup M'] [Module R M'] (f : M →ₗ[R] M')
theorem AssociatePrimes.mem_iff : I ∈ associatedPrimes R M ↔ IsAssociatedPrime I M := Iff.rfl
#align associate_primes.mem_iff AssociatePrimes.mem_iff
theorem IsAssociatedPrime.isPrime (h : IsAssociatedPrime I M) : I.IsPrime := h.1
#align is_associated_prime.is_prime IsAssociatedPrime.isPrime
theorem IsAssociatedPrime.map_of_injective (h : IsAssociatedPrime I M) (hf : Function.Injective f) :
IsAssociatedPrime I M' := by
obtain ⟨x, rfl⟩ := h.2
refine ⟨h.1, ⟨f x, ?_⟩⟩
ext r
rw [Submodule.mem_annihilator_span_singleton, Submodule.mem_annihilator_span_singleton, ←
map_smul, ← f.map_zero, hf.eq_iff]
#align is_associated_prime.map_of_injective IsAssociatedPrime.map_of_injective
theorem LinearEquiv.isAssociatedPrime_iff (l : M ≃ₗ[R] M') :
IsAssociatedPrime I M ↔ IsAssociatedPrime I M' :=
⟨fun h => h.map_of_injective l l.injective,
fun h => h.map_of_injective l.symm l.symm.injective⟩
#align linear_equiv.is_associated_prime_iff LinearEquiv.isAssociatedPrime_iff
theorem not_isAssociatedPrime_of_subsingleton [Subsingleton M] : ¬IsAssociatedPrime I M := by
rintro ⟨hI, x, hx⟩
apply hI.ne_top
rwa [Subsingleton.elim x 0, Submodule.span_singleton_eq_bot.mpr rfl, Submodule.annihilator_bot]
at hx
#align not_is_associated_prime_of_subsingleton not_isAssociatedPrime_of_subsingleton
variable (R)
theorem exists_le_isAssociatedPrime_of_isNoetherianRing [H : IsNoetherianRing R] (x : M)
(hx : x ≠ 0) : ∃ P : Ideal R, IsAssociatedPrime P M ∧ (R ∙ x).annihilator ≤ P := by
have : (R ∙ x).annihilator ≠ ⊤ := by
rwa [Ne, Ideal.eq_top_iff_one, Submodule.mem_annihilator_span_singleton, one_smul]
obtain ⟨P, ⟨l, h₁, y, rfl⟩, h₃⟩ :=
set_has_maximal_iff_noetherian.mpr H
{ P | (R ∙ x).annihilator ≤ P ∧ P ≠ ⊤ ∧ ∃ y : M, P = (R ∙ y).annihilator }
⟨(R ∙ x).annihilator, rfl.le, this, x, rfl⟩
refine ⟨_, ⟨⟨h₁, ?_⟩, y, rfl⟩, l⟩
intro a b hab
rw [or_iff_not_imp_left]
intro ha
rw [Submodule.mem_annihilator_span_singleton] at ha hab
have H₁ : (R ∙ y).annihilator ≤ (R ∙ a • y).annihilator := by
intro c hc
rw [Submodule.mem_annihilator_span_singleton] at hc ⊢
rw [smul_comm, hc, smul_zero]
have H₂ : (Submodule.span R {a • y}).annihilator ≠ ⊤ := by
rwa [Ne, Submodule.annihilator_eq_top_iff, Submodule.span_singleton_eq_bot]
rwa [H₁.eq_of_not_lt (h₃ (R ∙ a • y).annihilator ⟨l.trans H₁, H₂, _, rfl⟩),
Submodule.mem_annihilator_span_singleton, smul_comm, smul_smul]
#align exists_le_is_associated_prime_of_is_noetherian_ring exists_le_isAssociatedPrime_of_isNoetherianRing
variable {R}
theorem associatedPrimes.subset_of_injective (hf : Function.Injective f) :
associatedPrimes R M ⊆ associatedPrimes R M' := fun _I h => h.map_of_injective f hf
#align associated_primes.subset_of_injective associatedPrimes.subset_of_injective
theorem LinearEquiv.AssociatedPrimes.eq (l : M ≃ₗ[R] M') :
associatedPrimes R M = associatedPrimes R M' :=
le_antisymm (associatedPrimes.subset_of_injective l l.injective)
(associatedPrimes.subset_of_injective l.symm l.symm.injective)
#align linear_equiv.associated_primes.eq LinearEquiv.AssociatedPrimes.eq
theorem associatedPrimes.eq_empty_of_subsingleton [Subsingleton M] : associatedPrimes R M = ∅ := by
ext; simp only [Set.mem_empty_iff_false, iff_false_iff];
apply not_isAssociatedPrime_of_subsingleton
#align associated_primes.eq_empty_of_subsingleton associatedPrimes.eq_empty_of_subsingleton
variable (R M)
theorem associatedPrimes.nonempty [IsNoetherianRing R] [Nontrivial M] :
(associatedPrimes R M).Nonempty := by
obtain ⟨x, hx⟩ := exists_ne (0 : M)
obtain ⟨P, hP, _⟩ := exists_le_isAssociatedPrime_of_isNoetherianRing R x hx
exact ⟨P, hP⟩
#align associated_primes.nonempty associatedPrimes.nonempty
| Mathlib/RingTheory/Ideal/AssociatedPrime.lean | 132 | 142 | theorem biUnion_associatedPrimes_eq_zero_divisors [IsNoetherianRing R] :
⋃ p ∈ associatedPrimes R M, p = { r : R | ∃ x : M, x ≠ 0 ∧ r • x = 0 } := by |
simp_rw [← Submodule.mem_annihilator_span_singleton]
refine subset_antisymm (Set.iUnion₂_subset ?_) ?_
· rintro _ ⟨h, x, ⟨⟩⟩ r h'
refine ⟨x, ne_of_eq_of_ne (one_smul R x).symm ?_, h'⟩
refine mt (Submodule.mem_annihilator_span_singleton _ _).mpr ?_
exact (Ideal.ne_top_iff_one _).mp h.ne_top
· intro r ⟨x, h, h'⟩
obtain ⟨P, hP, hx⟩ := exists_le_isAssociatedPrime_of_isNoetherianRing R x h
exact Set.mem_biUnion hP (hx h')
| 1,713 |
import Mathlib.RingTheory.Noetherian
import Mathlib.Algebra.DirectSum.Module
import Mathlib.Algebra.DirectSum.Finsupp
import Mathlib.Algebra.Module.Projective
import Mathlib.Algebra.Module.Injective
import Mathlib.Algebra.Module.CharacterModule
import Mathlib.LinearAlgebra.DirectSum.TensorProduct
import Mathlib.LinearAlgebra.FreeModule.Basic
import Mathlib.Algebra.Module.Projective
#align_import ring_theory.flat from "leanprover-community/mathlib"@"62c0a4ef1441edb463095ea02a06e87f3dfe135c"
universe u v w
namespace Module
open Function (Surjective)
open LinearMap Submodule TensorProduct DirectSum
variable (R : Type u) (M : Type v) [CommRing R] [AddCommGroup M] [Module R M]
@[mk_iff] class Flat : Prop where
out : ∀ ⦃I : Ideal R⦄ (_ : I.FG),
Function.Injective (TensorProduct.lift ((lsmul R M).comp I.subtype))
#align module.flat Module.Flat
namespace Flat
instance self (R : Type u) [CommRing R] : Flat R R :=
⟨by
intro I _
rw [← Equiv.injective_comp (TensorProduct.rid R I).symm.toEquiv]
convert Subtype.coe_injective using 1
ext x
simp only [Function.comp_apply, LinearEquiv.coe_toEquiv, rid_symm_apply, comp_apply, mul_one,
lift.tmul, Submodule.subtype_apply, Algebra.id.smul_eq_mul, lsmul_apply]⟩
#align module.flat.self Module.Flat.self
lemma iff_rTensor_injective :
Flat R M ↔ ∀ ⦃I : Ideal R⦄ (_ : I.FG), Function.Injective (rTensor M I.subtype) := by
simp [flat_iff, ← lid_comp_rTensor]
| Mathlib/RingTheory/Flat/Basic.lean | 98 | 106 | theorem iff_rTensor_injective' :
Flat R M ↔ ∀ I : Ideal R, Function.Injective (rTensor M I.subtype) := by |
rewrite [Flat.iff_rTensor_injective]
refine ⟨fun h I => ?_, fun h I _ => h I⟩
rewrite [injective_iff_map_eq_zero]
intro x hx₀
obtain ⟨J, hfg, hle, y, rfl⟩ := Submodule.exists_fg_le_eq_rTensor_inclusion x
rewrite [← rTensor_comp_apply] at hx₀
rw [(injective_iff_map_eq_zero _).mp (h hfg) y hx₀, LinearMap.map_zero]
| 1,714 |
import Mathlib.RingTheory.Noetherian
import Mathlib.Algebra.DirectSum.Module
import Mathlib.Algebra.DirectSum.Finsupp
import Mathlib.Algebra.Module.Projective
import Mathlib.Algebra.Module.Injective
import Mathlib.Algebra.Module.CharacterModule
import Mathlib.LinearAlgebra.DirectSum.TensorProduct
import Mathlib.LinearAlgebra.FreeModule.Basic
import Mathlib.Algebra.Module.Projective
#align_import ring_theory.flat from "leanprover-community/mathlib"@"62c0a4ef1441edb463095ea02a06e87f3dfe135c"
universe u v w
namespace Module
open Function (Surjective)
open LinearMap Submodule TensorProduct DirectSum
variable (R : Type u) (M : Type v) [CommRing R] [AddCommGroup M] [Module R M]
@[mk_iff] class Flat : Prop where
out : ∀ ⦃I : Ideal R⦄ (_ : I.FG),
Function.Injective (TensorProduct.lift ((lsmul R M).comp I.subtype))
#align module.flat Module.Flat
namespace Flat
instance self (R : Type u) [CommRing R] : Flat R R :=
⟨by
intro I _
rw [← Equiv.injective_comp (TensorProduct.rid R I).symm.toEquiv]
convert Subtype.coe_injective using 1
ext x
simp only [Function.comp_apply, LinearEquiv.coe_toEquiv, rid_symm_apply, comp_apply, mul_one,
lift.tmul, Submodule.subtype_apply, Algebra.id.smul_eq_mul, lsmul_apply]⟩
#align module.flat.self Module.Flat.self
lemma iff_rTensor_injective :
Flat R M ↔ ∀ ⦃I : Ideal R⦄ (_ : I.FG), Function.Injective (rTensor M I.subtype) := by
simp [flat_iff, ← lid_comp_rTensor]
theorem iff_rTensor_injective' :
Flat R M ↔ ∀ I : Ideal R, Function.Injective (rTensor M I.subtype) := by
rewrite [Flat.iff_rTensor_injective]
refine ⟨fun h I => ?_, fun h I _ => h I⟩
rewrite [injective_iff_map_eq_zero]
intro x hx₀
obtain ⟨J, hfg, hle, y, rfl⟩ := Submodule.exists_fg_le_eq_rTensor_inclusion x
rewrite [← rTensor_comp_apply] at hx₀
rw [(injective_iff_map_eq_zero _).mp (h hfg) y hx₀, LinearMap.map_zero]
@[deprecated (since := "2024-03-29")]
alias lTensor_inj_iff_rTensor_inj := LinearMap.lTensor_inj_iff_rTensor_inj
| Mathlib/RingTheory/Flat/Basic.lean | 112 | 114 | theorem iff_lTensor_injective :
Module.Flat R M ↔ ∀ ⦃I : Ideal R⦄ (_ : I.FG), Function.Injective (lTensor M I.subtype) := by |
simpa [← comm_comp_rTensor_comp_comm_eq] using Module.Flat.iff_rTensor_injective R M
| 1,714 |
import Mathlib.RingTheory.Noetherian
import Mathlib.Algebra.DirectSum.Module
import Mathlib.Algebra.DirectSum.Finsupp
import Mathlib.Algebra.Module.Projective
import Mathlib.Algebra.Module.Injective
import Mathlib.Algebra.Module.CharacterModule
import Mathlib.LinearAlgebra.DirectSum.TensorProduct
import Mathlib.LinearAlgebra.FreeModule.Basic
import Mathlib.Algebra.Module.Projective
#align_import ring_theory.flat from "leanprover-community/mathlib"@"62c0a4ef1441edb463095ea02a06e87f3dfe135c"
universe u v w
namespace Module
open Function (Surjective)
open LinearMap Submodule TensorProduct DirectSum
variable (R : Type u) (M : Type v) [CommRing R] [AddCommGroup M] [Module R M]
@[mk_iff] class Flat : Prop where
out : ∀ ⦃I : Ideal R⦄ (_ : I.FG),
Function.Injective (TensorProduct.lift ((lsmul R M).comp I.subtype))
#align module.flat Module.Flat
namespace Flat
instance self (R : Type u) [CommRing R] : Flat R R :=
⟨by
intro I _
rw [← Equiv.injective_comp (TensorProduct.rid R I).symm.toEquiv]
convert Subtype.coe_injective using 1
ext x
simp only [Function.comp_apply, LinearEquiv.coe_toEquiv, rid_symm_apply, comp_apply, mul_one,
lift.tmul, Submodule.subtype_apply, Algebra.id.smul_eq_mul, lsmul_apply]⟩
#align module.flat.self Module.Flat.self
lemma iff_rTensor_injective :
Flat R M ↔ ∀ ⦃I : Ideal R⦄ (_ : I.FG), Function.Injective (rTensor M I.subtype) := by
simp [flat_iff, ← lid_comp_rTensor]
theorem iff_rTensor_injective' :
Flat R M ↔ ∀ I : Ideal R, Function.Injective (rTensor M I.subtype) := by
rewrite [Flat.iff_rTensor_injective]
refine ⟨fun h I => ?_, fun h I _ => h I⟩
rewrite [injective_iff_map_eq_zero]
intro x hx₀
obtain ⟨J, hfg, hle, y, rfl⟩ := Submodule.exists_fg_le_eq_rTensor_inclusion x
rewrite [← rTensor_comp_apply] at hx₀
rw [(injective_iff_map_eq_zero _).mp (h hfg) y hx₀, LinearMap.map_zero]
@[deprecated (since := "2024-03-29")]
alias lTensor_inj_iff_rTensor_inj := LinearMap.lTensor_inj_iff_rTensor_inj
theorem iff_lTensor_injective :
Module.Flat R M ↔ ∀ ⦃I : Ideal R⦄ (_ : I.FG), Function.Injective (lTensor M I.subtype) := by
simpa [← comm_comp_rTensor_comp_comm_eq] using Module.Flat.iff_rTensor_injective R M
| Mathlib/RingTheory/Flat/Basic.lean | 117 | 119 | theorem iff_lTensor_injective' :
Module.Flat R M ↔ ∀ (I : Ideal R), Function.Injective (lTensor M I.subtype) := by |
simpa [← comm_comp_rTensor_comp_comm_eq] using Module.Flat.iff_rTensor_injective' R M
| 1,714 |
import Mathlib.RingTheory.Localization.FractionRing
import Mathlib.RingTheory.Localization.Ideal
import Mathlib.RingTheory.Noetherian
#align_import ring_theory.localization.submodule from "leanprover-community/mathlib"@"1ebb20602a8caef435ce47f6373e1aa40851a177"
variable {R : Type*} [CommRing R] (M : Submonoid R) (S : Type*) [CommRing S]
variable [Algebra R S] {P : Type*} [CommRing P]
namespace IsLocalization
-- This was previously a `hasCoe` instance, but if `S = R` then this will loop.
-- It could be a `hasCoeT` instance, but we keep it explicit here to avoid slowing down
-- the rest of the library.
def coeSubmodule (I : Ideal R) : Submodule R S :=
Submodule.map (Algebra.linearMap R S) I
#align is_localization.coe_submodule IsLocalization.coeSubmodule
theorem mem_coeSubmodule (I : Ideal R) {x : S} :
x ∈ coeSubmodule S I ↔ ∃ y : R, y ∈ I ∧ algebraMap R S y = x :=
Iff.rfl
#align is_localization.mem_coe_submodule IsLocalization.mem_coeSubmodule
theorem coeSubmodule_mono {I J : Ideal R} (h : I ≤ J) : coeSubmodule S I ≤ coeSubmodule S J :=
Submodule.map_mono h
#align is_localization.coe_submodule_mono IsLocalization.coeSubmodule_mono
@[simp]
| Mathlib/RingTheory/Localization/Submodule.lean | 48 | 49 | theorem coeSubmodule_bot : coeSubmodule S (⊥ : Ideal R) = ⊥ := by |
rw [coeSubmodule, Submodule.map_bot]
| 1,715 |
import Mathlib.RingTheory.Localization.FractionRing
import Mathlib.RingTheory.Localization.Ideal
import Mathlib.RingTheory.Noetherian
#align_import ring_theory.localization.submodule from "leanprover-community/mathlib"@"1ebb20602a8caef435ce47f6373e1aa40851a177"
variable {R : Type*} [CommRing R] (M : Submonoid R) (S : Type*) [CommRing S]
variable [Algebra R S] {P : Type*} [CommRing P]
namespace IsLocalization
-- This was previously a `hasCoe` instance, but if `S = R` then this will loop.
-- It could be a `hasCoeT` instance, but we keep it explicit here to avoid slowing down
-- the rest of the library.
def coeSubmodule (I : Ideal R) : Submodule R S :=
Submodule.map (Algebra.linearMap R S) I
#align is_localization.coe_submodule IsLocalization.coeSubmodule
theorem mem_coeSubmodule (I : Ideal R) {x : S} :
x ∈ coeSubmodule S I ↔ ∃ y : R, y ∈ I ∧ algebraMap R S y = x :=
Iff.rfl
#align is_localization.mem_coe_submodule IsLocalization.mem_coeSubmodule
theorem coeSubmodule_mono {I J : Ideal R} (h : I ≤ J) : coeSubmodule S I ≤ coeSubmodule S J :=
Submodule.map_mono h
#align is_localization.coe_submodule_mono IsLocalization.coeSubmodule_mono
@[simp]
theorem coeSubmodule_bot : coeSubmodule S (⊥ : Ideal R) = ⊥ := by
rw [coeSubmodule, Submodule.map_bot]
#align is_localization.coe_submodule_bot IsLocalization.coeSubmodule_bot
@[simp]
| Mathlib/RingTheory/Localization/Submodule.lean | 53 | 54 | theorem coeSubmodule_top : coeSubmodule S (⊤ : Ideal R) = 1 := by |
rw [coeSubmodule, Submodule.map_top, Submodule.one_eq_range]
| 1,715 |
import Mathlib.RingTheory.Localization.FractionRing
import Mathlib.RingTheory.Localization.Ideal
import Mathlib.RingTheory.Noetherian
#align_import ring_theory.localization.submodule from "leanprover-community/mathlib"@"1ebb20602a8caef435ce47f6373e1aa40851a177"
variable {R : Type*} [CommRing R] (M : Submonoid R) (S : Type*) [CommRing S]
variable [Algebra R S] {P : Type*} [CommRing P]
namespace IsLocalization
-- This was previously a `hasCoe` instance, but if `S = R` then this will loop.
-- It could be a `hasCoeT` instance, but we keep it explicit here to avoid slowing down
-- the rest of the library.
def coeSubmodule (I : Ideal R) : Submodule R S :=
Submodule.map (Algebra.linearMap R S) I
#align is_localization.coe_submodule IsLocalization.coeSubmodule
theorem mem_coeSubmodule (I : Ideal R) {x : S} :
x ∈ coeSubmodule S I ↔ ∃ y : R, y ∈ I ∧ algebraMap R S y = x :=
Iff.rfl
#align is_localization.mem_coe_submodule IsLocalization.mem_coeSubmodule
theorem coeSubmodule_mono {I J : Ideal R} (h : I ≤ J) : coeSubmodule S I ≤ coeSubmodule S J :=
Submodule.map_mono h
#align is_localization.coe_submodule_mono IsLocalization.coeSubmodule_mono
@[simp]
theorem coeSubmodule_bot : coeSubmodule S (⊥ : Ideal R) = ⊥ := by
rw [coeSubmodule, Submodule.map_bot]
#align is_localization.coe_submodule_bot IsLocalization.coeSubmodule_bot
@[simp]
theorem coeSubmodule_top : coeSubmodule S (⊤ : Ideal R) = 1 := by
rw [coeSubmodule, Submodule.map_top, Submodule.one_eq_range]
#align is_localization.coe_submodule_top IsLocalization.coeSubmodule_top
@[simp]
theorem coeSubmodule_sup (I J : Ideal R) :
coeSubmodule S (I ⊔ J) = coeSubmodule S I ⊔ coeSubmodule S J :=
Submodule.map_sup _ _ _
#align is_localization.coe_submodule_sup IsLocalization.coeSubmodule_sup
@[simp]
theorem coeSubmodule_mul (I J : Ideal R) :
coeSubmodule S (I * J) = coeSubmodule S I * coeSubmodule S J :=
Submodule.map_mul _ _ (Algebra.ofId R S)
#align is_localization.coe_submodule_mul IsLocalization.coeSubmodule_mul
theorem coeSubmodule_fg (hS : Function.Injective (algebraMap R S)) (I : Ideal R) :
Submodule.FG (coeSubmodule S I) ↔ Submodule.FG I :=
⟨Submodule.fg_of_fg_map _ (LinearMap.ker_eq_bot.mpr hS), Submodule.FG.map _⟩
#align is_localization.coe_submodule_fg IsLocalization.coeSubmodule_fg
@[simp]
| Mathlib/RingTheory/Localization/Submodule.lean | 75 | 78 | theorem coeSubmodule_span (s : Set R) :
coeSubmodule S (Ideal.span s) = Submodule.span R (algebraMap R S '' s) := by |
rw [IsLocalization.coeSubmodule, Ideal.span, Submodule.map_span]
rfl
| 1,715 |
import Mathlib.RingTheory.Localization.FractionRing
import Mathlib.RingTheory.Localization.Ideal
import Mathlib.RingTheory.Noetherian
#align_import ring_theory.localization.submodule from "leanprover-community/mathlib"@"1ebb20602a8caef435ce47f6373e1aa40851a177"
variable {R : Type*} [CommRing R] (M : Submonoid R) (S : Type*) [CommRing S]
variable [Algebra R S] {P : Type*} [CommRing P]
namespace IsLocalization
-- This was previously a `hasCoe` instance, but if `S = R` then this will loop.
-- It could be a `hasCoeT` instance, but we keep it explicit here to avoid slowing down
-- the rest of the library.
def coeSubmodule (I : Ideal R) : Submodule R S :=
Submodule.map (Algebra.linearMap R S) I
#align is_localization.coe_submodule IsLocalization.coeSubmodule
theorem mem_coeSubmodule (I : Ideal R) {x : S} :
x ∈ coeSubmodule S I ↔ ∃ y : R, y ∈ I ∧ algebraMap R S y = x :=
Iff.rfl
#align is_localization.mem_coe_submodule IsLocalization.mem_coeSubmodule
theorem coeSubmodule_mono {I J : Ideal R} (h : I ≤ J) : coeSubmodule S I ≤ coeSubmodule S J :=
Submodule.map_mono h
#align is_localization.coe_submodule_mono IsLocalization.coeSubmodule_mono
@[simp]
theorem coeSubmodule_bot : coeSubmodule S (⊥ : Ideal R) = ⊥ := by
rw [coeSubmodule, Submodule.map_bot]
#align is_localization.coe_submodule_bot IsLocalization.coeSubmodule_bot
@[simp]
theorem coeSubmodule_top : coeSubmodule S (⊤ : Ideal R) = 1 := by
rw [coeSubmodule, Submodule.map_top, Submodule.one_eq_range]
#align is_localization.coe_submodule_top IsLocalization.coeSubmodule_top
@[simp]
theorem coeSubmodule_sup (I J : Ideal R) :
coeSubmodule S (I ⊔ J) = coeSubmodule S I ⊔ coeSubmodule S J :=
Submodule.map_sup _ _ _
#align is_localization.coe_submodule_sup IsLocalization.coeSubmodule_sup
@[simp]
theorem coeSubmodule_mul (I J : Ideal R) :
coeSubmodule S (I * J) = coeSubmodule S I * coeSubmodule S J :=
Submodule.map_mul _ _ (Algebra.ofId R S)
#align is_localization.coe_submodule_mul IsLocalization.coeSubmodule_mul
theorem coeSubmodule_fg (hS : Function.Injective (algebraMap R S)) (I : Ideal R) :
Submodule.FG (coeSubmodule S I) ↔ Submodule.FG I :=
⟨Submodule.fg_of_fg_map _ (LinearMap.ker_eq_bot.mpr hS), Submodule.FG.map _⟩
#align is_localization.coe_submodule_fg IsLocalization.coeSubmodule_fg
@[simp]
theorem coeSubmodule_span (s : Set R) :
coeSubmodule S (Ideal.span s) = Submodule.span R (algebraMap R S '' s) := by
rw [IsLocalization.coeSubmodule, Ideal.span, Submodule.map_span]
rfl
#align is_localization.coe_submodule_span IsLocalization.coeSubmodule_span
-- @[simp] -- Porting note (#10618): simp can prove this
| Mathlib/RingTheory/Localization/Submodule.lean | 82 | 84 | theorem coeSubmodule_span_singleton (x : R) :
coeSubmodule S (Ideal.span {x}) = Submodule.span R {(algebraMap R S) x} := by |
rw [coeSubmodule_span, Set.image_singleton]
| 1,715 |
import Mathlib.RingTheory.Localization.FractionRing
import Mathlib.RingTheory.Localization.Ideal
import Mathlib.RingTheory.Noetherian
#align_import ring_theory.localization.submodule from "leanprover-community/mathlib"@"1ebb20602a8caef435ce47f6373e1aa40851a177"
variable {R : Type*} [CommRing R] (M : Submonoid R) (S : Type*) [CommRing S]
variable [Algebra R S] {P : Type*} [CommRing P]
namespace IsLocalization
-- This was previously a `hasCoe` instance, but if `S = R` then this will loop.
-- It could be a `hasCoeT` instance, but we keep it explicit here to avoid slowing down
-- the rest of the library.
def coeSubmodule (I : Ideal R) : Submodule R S :=
Submodule.map (Algebra.linearMap R S) I
#align is_localization.coe_submodule IsLocalization.coeSubmodule
theorem mem_coeSubmodule (I : Ideal R) {x : S} :
x ∈ coeSubmodule S I ↔ ∃ y : R, y ∈ I ∧ algebraMap R S y = x :=
Iff.rfl
#align is_localization.mem_coe_submodule IsLocalization.mem_coeSubmodule
theorem coeSubmodule_mono {I J : Ideal R} (h : I ≤ J) : coeSubmodule S I ≤ coeSubmodule S J :=
Submodule.map_mono h
#align is_localization.coe_submodule_mono IsLocalization.coeSubmodule_mono
@[simp]
theorem coeSubmodule_bot : coeSubmodule S (⊥ : Ideal R) = ⊥ := by
rw [coeSubmodule, Submodule.map_bot]
#align is_localization.coe_submodule_bot IsLocalization.coeSubmodule_bot
@[simp]
theorem coeSubmodule_top : coeSubmodule S (⊤ : Ideal R) = 1 := by
rw [coeSubmodule, Submodule.map_top, Submodule.one_eq_range]
#align is_localization.coe_submodule_top IsLocalization.coeSubmodule_top
@[simp]
theorem coeSubmodule_sup (I J : Ideal R) :
coeSubmodule S (I ⊔ J) = coeSubmodule S I ⊔ coeSubmodule S J :=
Submodule.map_sup _ _ _
#align is_localization.coe_submodule_sup IsLocalization.coeSubmodule_sup
@[simp]
theorem coeSubmodule_mul (I J : Ideal R) :
coeSubmodule S (I * J) = coeSubmodule S I * coeSubmodule S J :=
Submodule.map_mul _ _ (Algebra.ofId R S)
#align is_localization.coe_submodule_mul IsLocalization.coeSubmodule_mul
theorem coeSubmodule_fg (hS : Function.Injective (algebraMap R S)) (I : Ideal R) :
Submodule.FG (coeSubmodule S I) ↔ Submodule.FG I :=
⟨Submodule.fg_of_fg_map _ (LinearMap.ker_eq_bot.mpr hS), Submodule.FG.map _⟩
#align is_localization.coe_submodule_fg IsLocalization.coeSubmodule_fg
@[simp]
theorem coeSubmodule_span (s : Set R) :
coeSubmodule S (Ideal.span s) = Submodule.span R (algebraMap R S '' s) := by
rw [IsLocalization.coeSubmodule, Ideal.span, Submodule.map_span]
rfl
#align is_localization.coe_submodule_span IsLocalization.coeSubmodule_span
-- @[simp] -- Porting note (#10618): simp can prove this
theorem coeSubmodule_span_singleton (x : R) :
coeSubmodule S (Ideal.span {x}) = Submodule.span R {(algebraMap R S) x} := by
rw [coeSubmodule_span, Set.image_singleton]
#align is_localization.coe_submodule_span_singleton IsLocalization.coeSubmodule_span_singleton
variable {g : R →+* P}
variable {T : Submonoid P} (hy : M ≤ T.comap g) {Q : Type*} [CommRing Q]
variable [Algebra P Q] [IsLocalization T Q]
variable [IsLocalization M S]
section
| Mathlib/RingTheory/Localization/Submodule.lean | 94 | 96 | theorem isNoetherianRing (h : IsNoetherianRing R) : IsNoetherianRing S := by |
rw [isNoetherianRing_iff, isNoetherian_iff_wellFounded] at h ⊢
exact OrderEmbedding.wellFounded (IsLocalization.orderEmbedding M S).dual h
| 1,715 |
import Mathlib.RingTheory.Localization.FractionRing
import Mathlib.RingTheory.Localization.Ideal
import Mathlib.RingTheory.Noetherian
#align_import ring_theory.localization.submodule from "leanprover-community/mathlib"@"1ebb20602a8caef435ce47f6373e1aa40851a177"
variable {R : Type*} [CommRing R] (M : Submonoid R) (S : Type*) [CommRing S]
variable [Algebra R S] {P : Type*} [CommRing P]
namespace IsLocalization
-- This was previously a `hasCoe` instance, but if `S = R` then this will loop.
-- It could be a `hasCoeT` instance, but we keep it explicit here to avoid slowing down
-- the rest of the library.
def coeSubmodule (I : Ideal R) : Submodule R S :=
Submodule.map (Algebra.linearMap R S) I
#align is_localization.coe_submodule IsLocalization.coeSubmodule
theorem mem_coeSubmodule (I : Ideal R) {x : S} :
x ∈ coeSubmodule S I ↔ ∃ y : R, y ∈ I ∧ algebraMap R S y = x :=
Iff.rfl
#align is_localization.mem_coe_submodule IsLocalization.mem_coeSubmodule
theorem coeSubmodule_mono {I J : Ideal R} (h : I ≤ J) : coeSubmodule S I ≤ coeSubmodule S J :=
Submodule.map_mono h
#align is_localization.coe_submodule_mono IsLocalization.coeSubmodule_mono
@[simp]
theorem coeSubmodule_bot : coeSubmodule S (⊥ : Ideal R) = ⊥ := by
rw [coeSubmodule, Submodule.map_bot]
#align is_localization.coe_submodule_bot IsLocalization.coeSubmodule_bot
@[simp]
theorem coeSubmodule_top : coeSubmodule S (⊤ : Ideal R) = 1 := by
rw [coeSubmodule, Submodule.map_top, Submodule.one_eq_range]
#align is_localization.coe_submodule_top IsLocalization.coeSubmodule_top
@[simp]
theorem coeSubmodule_sup (I J : Ideal R) :
coeSubmodule S (I ⊔ J) = coeSubmodule S I ⊔ coeSubmodule S J :=
Submodule.map_sup _ _ _
#align is_localization.coe_submodule_sup IsLocalization.coeSubmodule_sup
@[simp]
theorem coeSubmodule_mul (I J : Ideal R) :
coeSubmodule S (I * J) = coeSubmodule S I * coeSubmodule S J :=
Submodule.map_mul _ _ (Algebra.ofId R S)
#align is_localization.coe_submodule_mul IsLocalization.coeSubmodule_mul
theorem coeSubmodule_fg (hS : Function.Injective (algebraMap R S)) (I : Ideal R) :
Submodule.FG (coeSubmodule S I) ↔ Submodule.FG I :=
⟨Submodule.fg_of_fg_map _ (LinearMap.ker_eq_bot.mpr hS), Submodule.FG.map _⟩
#align is_localization.coe_submodule_fg IsLocalization.coeSubmodule_fg
@[simp]
theorem coeSubmodule_span (s : Set R) :
coeSubmodule S (Ideal.span s) = Submodule.span R (algebraMap R S '' s) := by
rw [IsLocalization.coeSubmodule, Ideal.span, Submodule.map_span]
rfl
#align is_localization.coe_submodule_span IsLocalization.coeSubmodule_span
-- @[simp] -- Porting note (#10618): simp can prove this
theorem coeSubmodule_span_singleton (x : R) :
coeSubmodule S (Ideal.span {x}) = Submodule.span R {(algebraMap R S) x} := by
rw [coeSubmodule_span, Set.image_singleton]
#align is_localization.coe_submodule_span_singleton IsLocalization.coeSubmodule_span_singleton
variable {g : R →+* P}
variable {T : Submonoid P} (hy : M ≤ T.comap g) {Q : Type*} [CommRing Q]
variable [Algebra P Q] [IsLocalization T Q]
variable [IsLocalization M S]
section
theorem isNoetherianRing (h : IsNoetherianRing R) : IsNoetherianRing S := by
rw [isNoetherianRing_iff, isNoetherian_iff_wellFounded] at h ⊢
exact OrderEmbedding.wellFounded (IsLocalization.orderEmbedding M S).dual h
#align is_localization.is_noetherian_ring IsLocalization.isNoetherianRing
end
variable {S M}
@[mono]
theorem coeSubmodule_le_coeSubmodule (h : M ≤ nonZeroDivisors R) {I J : Ideal R} :
coeSubmodule S I ≤ coeSubmodule S J ↔ I ≤ J :=
-- Note: #8386 had to specify the value of `f` here:
Submodule.map_le_map_iff_of_injective (f := Algebra.linearMap R S) (IsLocalization.injective _ h)
_ _
#align is_localization.coe_submodule_le_coe_submodule IsLocalization.coeSubmodule_le_coeSubmodule
@[mono]
theorem coeSubmodule_strictMono (h : M ≤ nonZeroDivisors R) :
StrictMono (coeSubmodule S : Ideal R → Submodule R S) :=
strictMono_of_le_iff_le fun _ _ => (coeSubmodule_le_coeSubmodule h).symm
#align is_localization.coe_submodule_strict_mono IsLocalization.coeSubmodule_strictMono
variable (S)
theorem coeSubmodule_injective (h : M ≤ nonZeroDivisors R) :
Function.Injective (coeSubmodule S : Ideal R → Submodule R S) :=
injective_of_le_imp_le _ fun hl => (coeSubmodule_le_coeSubmodule h).mp hl
#align is_localization.coe_submodule_injective IsLocalization.coeSubmodule_injective
| Mathlib/RingTheory/Localization/Submodule.lean | 125 | 133 | theorem coeSubmodule_isPrincipal {I : Ideal R} (h : M ≤ nonZeroDivisors R) :
(coeSubmodule S I).IsPrincipal ↔ I.IsPrincipal := by |
constructor <;> rintro ⟨⟨x, hx⟩⟩
· have x_mem : x ∈ coeSubmodule S I := hx.symm ▸ Submodule.mem_span_singleton_self x
obtain ⟨x, _, rfl⟩ := (mem_coeSubmodule _ _).mp x_mem
refine ⟨⟨x, coeSubmodule_injective S h ?_⟩⟩
rw [Ideal.submodule_span_eq, hx, coeSubmodule_span_singleton]
· refine ⟨⟨algebraMap R S x, ?_⟩⟩
rw [hx, Ideal.submodule_span_eq, coeSubmodule_span_singleton]
| 1,715 |
import Mathlib.RingTheory.Localization.FractionRing
import Mathlib.RingTheory.Localization.Ideal
import Mathlib.RingTheory.Noetherian
#align_import ring_theory.localization.submodule from "leanprover-community/mathlib"@"1ebb20602a8caef435ce47f6373e1aa40851a177"
variable {R : Type*} [CommRing R] (M : Submonoid R) (S : Type*) [CommRing S]
variable [Algebra R S] {P : Type*} [CommRing P]
namespace IsLocalization
-- This was previously a `hasCoe` instance, but if `S = R` then this will loop.
-- It could be a `hasCoeT` instance, but we keep it explicit here to avoid slowing down
-- the rest of the library.
def coeSubmodule (I : Ideal R) : Submodule R S :=
Submodule.map (Algebra.linearMap R S) I
#align is_localization.coe_submodule IsLocalization.coeSubmodule
theorem mem_coeSubmodule (I : Ideal R) {x : S} :
x ∈ coeSubmodule S I ↔ ∃ y : R, y ∈ I ∧ algebraMap R S y = x :=
Iff.rfl
#align is_localization.mem_coe_submodule IsLocalization.mem_coeSubmodule
theorem coeSubmodule_mono {I J : Ideal R} (h : I ≤ J) : coeSubmodule S I ≤ coeSubmodule S J :=
Submodule.map_mono h
#align is_localization.coe_submodule_mono IsLocalization.coeSubmodule_mono
@[simp]
theorem coeSubmodule_bot : coeSubmodule S (⊥ : Ideal R) = ⊥ := by
rw [coeSubmodule, Submodule.map_bot]
#align is_localization.coe_submodule_bot IsLocalization.coeSubmodule_bot
@[simp]
theorem coeSubmodule_top : coeSubmodule S (⊤ : Ideal R) = 1 := by
rw [coeSubmodule, Submodule.map_top, Submodule.one_eq_range]
#align is_localization.coe_submodule_top IsLocalization.coeSubmodule_top
@[simp]
theorem coeSubmodule_sup (I J : Ideal R) :
coeSubmodule S (I ⊔ J) = coeSubmodule S I ⊔ coeSubmodule S J :=
Submodule.map_sup _ _ _
#align is_localization.coe_submodule_sup IsLocalization.coeSubmodule_sup
@[simp]
theorem coeSubmodule_mul (I J : Ideal R) :
coeSubmodule S (I * J) = coeSubmodule S I * coeSubmodule S J :=
Submodule.map_mul _ _ (Algebra.ofId R S)
#align is_localization.coe_submodule_mul IsLocalization.coeSubmodule_mul
theorem coeSubmodule_fg (hS : Function.Injective (algebraMap R S)) (I : Ideal R) :
Submodule.FG (coeSubmodule S I) ↔ Submodule.FG I :=
⟨Submodule.fg_of_fg_map _ (LinearMap.ker_eq_bot.mpr hS), Submodule.FG.map _⟩
#align is_localization.coe_submodule_fg IsLocalization.coeSubmodule_fg
@[simp]
theorem coeSubmodule_span (s : Set R) :
coeSubmodule S (Ideal.span s) = Submodule.span R (algebraMap R S '' s) := by
rw [IsLocalization.coeSubmodule, Ideal.span, Submodule.map_span]
rfl
#align is_localization.coe_submodule_span IsLocalization.coeSubmodule_span
-- @[simp] -- Porting note (#10618): simp can prove this
theorem coeSubmodule_span_singleton (x : R) :
coeSubmodule S (Ideal.span {x}) = Submodule.span R {(algebraMap R S) x} := by
rw [coeSubmodule_span, Set.image_singleton]
#align is_localization.coe_submodule_span_singleton IsLocalization.coeSubmodule_span_singleton
variable {g : R →+* P}
variable {T : Submonoid P} (hy : M ≤ T.comap g) {Q : Type*} [CommRing Q]
variable [Algebra P Q] [IsLocalization T Q]
variable [IsLocalization M S]
section
theorem isNoetherianRing (h : IsNoetherianRing R) : IsNoetherianRing S := by
rw [isNoetherianRing_iff, isNoetherian_iff_wellFounded] at h ⊢
exact OrderEmbedding.wellFounded (IsLocalization.orderEmbedding M S).dual h
#align is_localization.is_noetherian_ring IsLocalization.isNoetherianRing
end
variable {S M}
@[mono]
theorem coeSubmodule_le_coeSubmodule (h : M ≤ nonZeroDivisors R) {I J : Ideal R} :
coeSubmodule S I ≤ coeSubmodule S J ↔ I ≤ J :=
-- Note: #8386 had to specify the value of `f` here:
Submodule.map_le_map_iff_of_injective (f := Algebra.linearMap R S) (IsLocalization.injective _ h)
_ _
#align is_localization.coe_submodule_le_coe_submodule IsLocalization.coeSubmodule_le_coeSubmodule
@[mono]
theorem coeSubmodule_strictMono (h : M ≤ nonZeroDivisors R) :
StrictMono (coeSubmodule S : Ideal R → Submodule R S) :=
strictMono_of_le_iff_le fun _ _ => (coeSubmodule_le_coeSubmodule h).symm
#align is_localization.coe_submodule_strict_mono IsLocalization.coeSubmodule_strictMono
variable (S)
theorem coeSubmodule_injective (h : M ≤ nonZeroDivisors R) :
Function.Injective (coeSubmodule S : Ideal R → Submodule R S) :=
injective_of_le_imp_le _ fun hl => (coeSubmodule_le_coeSubmodule h).mp hl
#align is_localization.coe_submodule_injective IsLocalization.coeSubmodule_injective
theorem coeSubmodule_isPrincipal {I : Ideal R} (h : M ≤ nonZeroDivisors R) :
(coeSubmodule S I).IsPrincipal ↔ I.IsPrincipal := by
constructor <;> rintro ⟨⟨x, hx⟩⟩
· have x_mem : x ∈ coeSubmodule S I := hx.symm ▸ Submodule.mem_span_singleton_self x
obtain ⟨x, _, rfl⟩ := (mem_coeSubmodule _ _).mp x_mem
refine ⟨⟨x, coeSubmodule_injective S h ?_⟩⟩
rw [Ideal.submodule_span_eq, hx, coeSubmodule_span_singleton]
· refine ⟨⟨algebraMap R S x, ?_⟩⟩
rw [hx, Ideal.submodule_span_eq, coeSubmodule_span_singleton]
#align is_localization.coe_submodule_is_principal IsLocalization.coeSubmodule_isPrincipal
variable {S} (M)
| Mathlib/RingTheory/Localization/Submodule.lean | 138 | 162 | theorem mem_span_iff {N : Type*} [AddCommGroup N] [Module R N] [Module S N] [IsScalarTower R S N]
{x : N} {a : Set N} :
x ∈ Submodule.span S a ↔ ∃ y ∈ Submodule.span R a, ∃ z : M, x = mk' S 1 z • y := by |
constructor
· intro h
refine Submodule.span_induction h ?_ ?_ ?_ ?_
· rintro x hx
exact ⟨x, Submodule.subset_span hx, 1, by rw [mk'_one, _root_.map_one, one_smul]⟩
· exact ⟨0, Submodule.zero_mem _, 1, by rw [mk'_one, _root_.map_one, one_smul]⟩
· rintro _ _ ⟨y, hy, z, rfl⟩ ⟨y', hy', z', rfl⟩
refine
⟨(z' : R) • y + (z : R) • y',
Submodule.add_mem _ (Submodule.smul_mem _ _ hy) (Submodule.smul_mem _ _ hy'), z * z', ?_⟩
rw [smul_add, ← IsScalarTower.algebraMap_smul S (z : R), ←
IsScalarTower.algebraMap_smul S (z' : R), smul_smul, smul_smul]
congr 1
· rw [← mul_one (1 : R), mk'_mul, mul_assoc, mk'_spec, _root_.map_one, mul_one, mul_one]
· rw [← mul_one (1 : R), mk'_mul, mul_right_comm, mk'_spec, _root_.map_one, mul_one, one_mul]
· rintro a _ ⟨y, hy, z, rfl⟩
obtain ⟨y', z', rfl⟩ := mk'_surjective M a
refine ⟨y' • y, Submodule.smul_mem _ _ hy, z' * z, ?_⟩
rw [← IsScalarTower.algebraMap_smul S y', smul_smul, ← mk'_mul, smul_smul,
mul_comm (mk' S _ _), mul_mk'_eq_mk'_of_mul]
· rintro ⟨y, hy, z, rfl⟩
exact Submodule.smul_mem _ _ (Submodule.span_subset_span R S _ hy)
| 1,715 |
import Mathlib.RingTheory.Nilpotent.Lemmas
import Mathlib.RingTheory.Ideal.QuotientOperations
#align_import ring_theory.quotient_nilpotent from "leanprover-community/mathlib"@"da420a8c6dd5bdfb85c4ced85c34388f633bc6ff"
| Mathlib/RingTheory/QuotientNilpotent.lean | 15 | 18 | theorem Ideal.isRadical_iff_quotient_reduced {R : Type*} [CommRing R] (I : Ideal R) :
I.IsRadical ↔ IsReduced (R ⧸ I) := by |
conv_lhs => rw [← @Ideal.mk_ker R _ I]
exact RingHom.ker_isRadical_iff_reduced_of_surjective (@Ideal.Quotient.mk_surjective R _ I)
| 1,716 |
import Mathlib.RingTheory.Nilpotent.Lemmas
import Mathlib.RingTheory.Ideal.QuotientOperations
#align_import ring_theory.quotient_nilpotent from "leanprover-community/mathlib"@"da420a8c6dd5bdfb85c4ced85c34388f633bc6ff"
theorem Ideal.isRadical_iff_quotient_reduced {R : Type*} [CommRing R] (I : Ideal R) :
I.IsRadical ↔ IsReduced (R ⧸ I) := by
conv_lhs => rw [← @Ideal.mk_ker R _ I]
exact RingHom.ker_isRadical_iff_reduced_of_surjective (@Ideal.Quotient.mk_surjective R _ I)
#align ideal.is_radical_iff_quotient_reduced Ideal.isRadical_iff_quotient_reduced
variable {R S : Type*} [CommSemiring R] [CommRing S] [Algebra R S] (I : Ideal S)
| Mathlib/RingTheory/QuotientNilpotent.lean | 26 | 51 | theorem Ideal.IsNilpotent.induction_on (hI : IsNilpotent I)
{P : ∀ ⦃S : Type _⦄ [CommRing S], Ideal S → Prop}
(h₁ : ∀ ⦃S : Type _⦄ [CommRing S], ∀ I : Ideal S, I ^ 2 = ⊥ → P I)
(h₂ : ∀ ⦃S : Type _⦄ [CommRing S], ∀ I J : Ideal S, I ≤ J → P I →
P (J.map (Ideal.Quotient.mk I)) → P J) :
P I := by |
obtain ⟨n, hI : I ^ n = ⊥⟩ := hI
induction' n using Nat.strong_induction_on with n H generalizing S
by_cases hI' : I = ⊥
· subst hI'
apply h₁
rw [← Ideal.zero_eq_bot, zero_pow two_ne_zero]
cases' n with n
· rw [pow_zero, Ideal.one_eq_top] at hI
haveI := subsingleton_of_bot_eq_top hI.symm
exact (hI' (Subsingleton.elim _ _)).elim
cases' n with n
· rw [pow_one] at hI
exact (hI' hI).elim
apply h₂ (I ^ 2) _ (Ideal.pow_le_self two_ne_zero)
· apply H n.succ _ (I ^ 2)
· rw [← pow_mul, eq_bot_iff, ← hI, Nat.succ_eq_add_one]
apply Ideal.pow_le_pow_right (by omega)
· exact n.succ.lt_succ_self
· apply h₁
rw [← Ideal.map_pow, Ideal.map_quotient_self]
| 1,716 |
import Mathlib.RingTheory.Nilpotent.Lemmas
import Mathlib.RingTheory.Ideal.QuotientOperations
#align_import ring_theory.quotient_nilpotent from "leanprover-community/mathlib"@"da420a8c6dd5bdfb85c4ced85c34388f633bc6ff"
theorem Ideal.isRadical_iff_quotient_reduced {R : Type*} [CommRing R] (I : Ideal R) :
I.IsRadical ↔ IsReduced (R ⧸ I) := by
conv_lhs => rw [← @Ideal.mk_ker R _ I]
exact RingHom.ker_isRadical_iff_reduced_of_surjective (@Ideal.Quotient.mk_surjective R _ I)
#align ideal.is_radical_iff_quotient_reduced Ideal.isRadical_iff_quotient_reduced
variable {R S : Type*} [CommSemiring R] [CommRing S] [Algebra R S] (I : Ideal S)
theorem Ideal.IsNilpotent.induction_on (hI : IsNilpotent I)
{P : ∀ ⦃S : Type _⦄ [CommRing S], Ideal S → Prop}
(h₁ : ∀ ⦃S : Type _⦄ [CommRing S], ∀ I : Ideal S, I ^ 2 = ⊥ → P I)
(h₂ : ∀ ⦃S : Type _⦄ [CommRing S], ∀ I J : Ideal S, I ≤ J → P I →
P (J.map (Ideal.Quotient.mk I)) → P J) :
P I := by
obtain ⟨n, hI : I ^ n = ⊥⟩ := hI
induction' n using Nat.strong_induction_on with n H generalizing S
by_cases hI' : I = ⊥
· subst hI'
apply h₁
rw [← Ideal.zero_eq_bot, zero_pow two_ne_zero]
cases' n with n
· rw [pow_zero, Ideal.one_eq_top] at hI
haveI := subsingleton_of_bot_eq_top hI.symm
exact (hI' (Subsingleton.elim _ _)).elim
cases' n with n
· rw [pow_one] at hI
exact (hI' hI).elim
apply h₂ (I ^ 2) _ (Ideal.pow_le_self two_ne_zero)
· apply H n.succ _ (I ^ 2)
· rw [← pow_mul, eq_bot_iff, ← hI, Nat.succ_eq_add_one]
apply Ideal.pow_le_pow_right (by omega)
· exact n.succ.lt_succ_self
· apply h₁
rw [← Ideal.map_pow, Ideal.map_quotient_self]
#align ideal.is_nilpotent.induction_on Ideal.IsNilpotent.induction_on
| Mathlib/RingTheory/QuotientNilpotent.lean | 54 | 78 | theorem IsNilpotent.isUnit_quotient_mk_iff {R : Type*} [CommRing R] {I : Ideal R}
(hI : IsNilpotent I) {x : R} : IsUnit (Ideal.Quotient.mk I x) ↔ IsUnit x := by |
refine ⟨?_, fun h => h.map <| Ideal.Quotient.mk I⟩
revert x
apply Ideal.IsNilpotent.induction_on (R := R) (S := R) I hI <;> clear hI I
swap
· introv e h₁ h₂ h₃
apply h₁
apply h₂
exact
h₃.map
((DoubleQuot.quotQuotEquivQuotSup I J).trans
(Ideal.quotEquivOfEq (sup_eq_right.mpr e))).symm.toRingHom
· introv e H
obtain ⟨y, hy⟩ := Ideal.Quotient.mk_surjective (↑H.unit⁻¹ : S ⧸ I)
have : Ideal.Quotient.mk I (x * y) = Ideal.Quotient.mk I 1 := by
rw [map_one, _root_.map_mul, hy, IsUnit.mul_val_inv]
rw [Ideal.Quotient.eq] at this
have : (x * y - 1) ^ 2 = 0 := by
rw [← Ideal.mem_bot, ← e]
exact Ideal.pow_mem_pow this _
have : x * (y * (2 - x * y)) = 1 := by
rw [eq_comm, ← sub_eq_zero, ← this]
ring
exact isUnit_of_mul_eq_one _ _ this
| 1,716 |
import Mathlib.LinearAlgebra.Matrix.Reindex
import Mathlib.LinearAlgebra.Matrix.ToLin
#align_import linear_algebra.matrix.basis from "leanprover-community/mathlib"@"6c263e4bfc2e6714de30f22178b4d0ca4d149a76"
noncomputable section
open LinearMap Matrix Set Submodule
open Matrix
section BasisToMatrix
variable {ι ι' κ κ' : Type*}
variable {R M : Type*} [CommSemiring R] [AddCommMonoid M] [Module R M]
variable {R₂ M₂ : Type*} [CommRing R₂] [AddCommGroup M₂] [Module R₂ M₂]
open Function Matrix
def Basis.toMatrix (e : Basis ι R M) (v : ι' → M) : Matrix ι ι' R := fun i j => e.repr (v j) i
#align basis.to_matrix Basis.toMatrix
variable (e : Basis ι R M) (v : ι' → M) (i : ι) (j : ι')
namespace Basis
theorem toMatrix_apply : e.toMatrix v i j = e.repr (v j) i :=
rfl
#align basis.to_matrix_apply Basis.toMatrix_apply
theorem toMatrix_transpose_apply : (e.toMatrix v)ᵀ j = e.repr (v j) :=
funext fun _ => rfl
#align basis.to_matrix_transpose_apply Basis.toMatrix_transpose_apply
| Mathlib/LinearAlgebra/Matrix/Basis.lean | 66 | 69 | theorem toMatrix_eq_toMatrix_constr [Fintype ι] [DecidableEq ι] (v : ι → M) :
e.toMatrix v = LinearMap.toMatrix e e (e.constr ℕ v) := by |
ext
rw [Basis.toMatrix_apply, LinearMap.toMatrix_apply, Basis.constr_basis]
| 1,717 |
import Mathlib.LinearAlgebra.Matrix.Reindex
import Mathlib.LinearAlgebra.Matrix.ToLin
#align_import linear_algebra.matrix.basis from "leanprover-community/mathlib"@"6c263e4bfc2e6714de30f22178b4d0ca4d149a76"
noncomputable section
open LinearMap Matrix Set Submodule
open Matrix
section BasisToMatrix
variable {ι ι' κ κ' : Type*}
variable {R M : Type*} [CommSemiring R] [AddCommMonoid M] [Module R M]
variable {R₂ M₂ : Type*} [CommRing R₂] [AddCommGroup M₂] [Module R₂ M₂]
open Function Matrix
def Basis.toMatrix (e : Basis ι R M) (v : ι' → M) : Matrix ι ι' R := fun i j => e.repr (v j) i
#align basis.to_matrix Basis.toMatrix
variable (e : Basis ι R M) (v : ι' → M) (i : ι) (j : ι')
namespace Basis
theorem toMatrix_apply : e.toMatrix v i j = e.repr (v j) i :=
rfl
#align basis.to_matrix_apply Basis.toMatrix_apply
theorem toMatrix_transpose_apply : (e.toMatrix v)ᵀ j = e.repr (v j) :=
funext fun _ => rfl
#align basis.to_matrix_transpose_apply Basis.toMatrix_transpose_apply
theorem toMatrix_eq_toMatrix_constr [Fintype ι] [DecidableEq ι] (v : ι → M) :
e.toMatrix v = LinearMap.toMatrix e e (e.constr ℕ v) := by
ext
rw [Basis.toMatrix_apply, LinearMap.toMatrix_apply, Basis.constr_basis]
#align basis.to_matrix_eq_to_matrix_constr Basis.toMatrix_eq_toMatrix_constr
-- TODO (maybe) Adjust the definition of `Basis.toMatrix` to eliminate the transpose.
| Mathlib/LinearAlgebra/Matrix/Basis.lean | 73 | 76 | theorem coePiBasisFun.toMatrix_eq_transpose [Finite ι] :
((Pi.basisFun R ι).toMatrix : Matrix ι ι R → Matrix ι ι R) = Matrix.transpose := by |
ext M i j
rfl
| 1,717 |
import Mathlib.LinearAlgebra.Matrix.Reindex
import Mathlib.LinearAlgebra.Matrix.ToLin
#align_import linear_algebra.matrix.basis from "leanprover-community/mathlib"@"6c263e4bfc2e6714de30f22178b4d0ca4d149a76"
noncomputable section
open LinearMap Matrix Set Submodule
open Matrix
section BasisToMatrix
variable {ι ι' κ κ' : Type*}
variable {R M : Type*} [CommSemiring R] [AddCommMonoid M] [Module R M]
variable {R₂ M₂ : Type*} [CommRing R₂] [AddCommGroup M₂] [Module R₂ M₂]
open Function Matrix
def Basis.toMatrix (e : Basis ι R M) (v : ι' → M) : Matrix ι ι' R := fun i j => e.repr (v j) i
#align basis.to_matrix Basis.toMatrix
variable (e : Basis ι R M) (v : ι' → M) (i : ι) (j : ι')
namespace Basis
theorem toMatrix_apply : e.toMatrix v i j = e.repr (v j) i :=
rfl
#align basis.to_matrix_apply Basis.toMatrix_apply
theorem toMatrix_transpose_apply : (e.toMatrix v)ᵀ j = e.repr (v j) :=
funext fun _ => rfl
#align basis.to_matrix_transpose_apply Basis.toMatrix_transpose_apply
theorem toMatrix_eq_toMatrix_constr [Fintype ι] [DecidableEq ι] (v : ι → M) :
e.toMatrix v = LinearMap.toMatrix e e (e.constr ℕ v) := by
ext
rw [Basis.toMatrix_apply, LinearMap.toMatrix_apply, Basis.constr_basis]
#align basis.to_matrix_eq_to_matrix_constr Basis.toMatrix_eq_toMatrix_constr
-- TODO (maybe) Adjust the definition of `Basis.toMatrix` to eliminate the transpose.
theorem coePiBasisFun.toMatrix_eq_transpose [Finite ι] :
((Pi.basisFun R ι).toMatrix : Matrix ι ι R → Matrix ι ι R) = Matrix.transpose := by
ext M i j
rfl
#align basis.coe_pi_basis_fun.to_matrix_eq_transpose Basis.coePiBasisFun.toMatrix_eq_transpose
@[simp]
| Mathlib/LinearAlgebra/Matrix/Basis.lean | 80 | 83 | theorem toMatrix_self [DecidableEq ι] : e.toMatrix e = 1 := by |
unfold Basis.toMatrix
ext i j
simp [Basis.equivFun, Matrix.one_apply, Finsupp.single_apply, eq_comm]
| 1,717 |
import Mathlib.LinearAlgebra.Matrix.Reindex
import Mathlib.LinearAlgebra.Matrix.ToLin
#align_import linear_algebra.matrix.basis from "leanprover-community/mathlib"@"6c263e4bfc2e6714de30f22178b4d0ca4d149a76"
noncomputable section
open LinearMap Matrix Set Submodule
open Matrix
section BasisToMatrix
variable {ι ι' κ κ' : Type*}
variable {R M : Type*} [CommSemiring R] [AddCommMonoid M] [Module R M]
variable {R₂ M₂ : Type*} [CommRing R₂] [AddCommGroup M₂] [Module R₂ M₂]
open Function Matrix
def Basis.toMatrix (e : Basis ι R M) (v : ι' → M) : Matrix ι ι' R := fun i j => e.repr (v j) i
#align basis.to_matrix Basis.toMatrix
variable (e : Basis ι R M) (v : ι' → M) (i : ι) (j : ι')
namespace Basis
theorem toMatrix_apply : e.toMatrix v i j = e.repr (v j) i :=
rfl
#align basis.to_matrix_apply Basis.toMatrix_apply
theorem toMatrix_transpose_apply : (e.toMatrix v)ᵀ j = e.repr (v j) :=
funext fun _ => rfl
#align basis.to_matrix_transpose_apply Basis.toMatrix_transpose_apply
theorem toMatrix_eq_toMatrix_constr [Fintype ι] [DecidableEq ι] (v : ι → M) :
e.toMatrix v = LinearMap.toMatrix e e (e.constr ℕ v) := by
ext
rw [Basis.toMatrix_apply, LinearMap.toMatrix_apply, Basis.constr_basis]
#align basis.to_matrix_eq_to_matrix_constr Basis.toMatrix_eq_toMatrix_constr
-- TODO (maybe) Adjust the definition of `Basis.toMatrix` to eliminate the transpose.
theorem coePiBasisFun.toMatrix_eq_transpose [Finite ι] :
((Pi.basisFun R ι).toMatrix : Matrix ι ι R → Matrix ι ι R) = Matrix.transpose := by
ext M i j
rfl
#align basis.coe_pi_basis_fun.to_matrix_eq_transpose Basis.coePiBasisFun.toMatrix_eq_transpose
@[simp]
theorem toMatrix_self [DecidableEq ι] : e.toMatrix e = 1 := by
unfold Basis.toMatrix
ext i j
simp [Basis.equivFun, Matrix.one_apply, Finsupp.single_apply, eq_comm]
#align basis.to_matrix_self Basis.toMatrix_self
| Mathlib/LinearAlgebra/Matrix/Basis.lean | 86 | 92 | theorem toMatrix_update [DecidableEq ι'] (x : M) :
e.toMatrix (Function.update v j x) = Matrix.updateColumn (e.toMatrix v) j (e.repr x) := by |
ext i' k
rw [Basis.toMatrix, Matrix.updateColumn_apply, e.toMatrix_apply]
split_ifs with h
· rw [h, update_same j x v]
· rw [update_noteq h]
| 1,717 |
import Mathlib.LinearAlgebra.Matrix.Reindex
import Mathlib.LinearAlgebra.Matrix.ToLin
#align_import linear_algebra.matrix.basis from "leanprover-community/mathlib"@"6c263e4bfc2e6714de30f22178b4d0ca4d149a76"
noncomputable section
open LinearMap Matrix Set Submodule
open Matrix
section BasisToMatrix
variable {ι ι' κ κ' : Type*}
variable {R M : Type*} [CommSemiring R] [AddCommMonoid M] [Module R M]
variable {R₂ M₂ : Type*} [CommRing R₂] [AddCommGroup M₂] [Module R₂ M₂]
open Function Matrix
def Basis.toMatrix (e : Basis ι R M) (v : ι' → M) : Matrix ι ι' R := fun i j => e.repr (v j) i
#align basis.to_matrix Basis.toMatrix
variable (e : Basis ι R M) (v : ι' → M) (i : ι) (j : ι')
namespace Basis
theorem toMatrix_apply : e.toMatrix v i j = e.repr (v j) i :=
rfl
#align basis.to_matrix_apply Basis.toMatrix_apply
theorem toMatrix_transpose_apply : (e.toMatrix v)ᵀ j = e.repr (v j) :=
funext fun _ => rfl
#align basis.to_matrix_transpose_apply Basis.toMatrix_transpose_apply
theorem toMatrix_eq_toMatrix_constr [Fintype ι] [DecidableEq ι] (v : ι → M) :
e.toMatrix v = LinearMap.toMatrix e e (e.constr ℕ v) := by
ext
rw [Basis.toMatrix_apply, LinearMap.toMatrix_apply, Basis.constr_basis]
#align basis.to_matrix_eq_to_matrix_constr Basis.toMatrix_eq_toMatrix_constr
-- TODO (maybe) Adjust the definition of `Basis.toMatrix` to eliminate the transpose.
theorem coePiBasisFun.toMatrix_eq_transpose [Finite ι] :
((Pi.basisFun R ι).toMatrix : Matrix ι ι R → Matrix ι ι R) = Matrix.transpose := by
ext M i j
rfl
#align basis.coe_pi_basis_fun.to_matrix_eq_transpose Basis.coePiBasisFun.toMatrix_eq_transpose
@[simp]
theorem toMatrix_self [DecidableEq ι] : e.toMatrix e = 1 := by
unfold Basis.toMatrix
ext i j
simp [Basis.equivFun, Matrix.one_apply, Finsupp.single_apply, eq_comm]
#align basis.to_matrix_self Basis.toMatrix_self
theorem toMatrix_update [DecidableEq ι'] (x : M) :
e.toMatrix (Function.update v j x) = Matrix.updateColumn (e.toMatrix v) j (e.repr x) := by
ext i' k
rw [Basis.toMatrix, Matrix.updateColumn_apply, e.toMatrix_apply]
split_ifs with h
· rw [h, update_same j x v]
· rw [update_noteq h]
#align basis.to_matrix_update Basis.toMatrix_update
@[simp]
| Mathlib/LinearAlgebra/Matrix/Basis.lean | 97 | 102 | theorem toMatrix_unitsSMul [DecidableEq ι] (e : Basis ι R₂ M₂) (w : ι → R₂ˣ) :
e.toMatrix (e.unitsSMul w) = diagonal ((↑) ∘ w) := by |
ext i j
by_cases h : i = j
· simp [h, toMatrix_apply, unitsSMul_apply, Units.smul_def]
· simp [h, toMatrix_apply, unitsSMul_apply, Units.smul_def, Ne.symm h]
| 1,717 |
import Mathlib.LinearAlgebra.Matrix.Reindex
import Mathlib.LinearAlgebra.Matrix.ToLin
#align_import linear_algebra.matrix.basis from "leanprover-community/mathlib"@"6c263e4bfc2e6714de30f22178b4d0ca4d149a76"
noncomputable section
open LinearMap Matrix Set Submodule
open Matrix
section BasisToMatrix
variable {ι ι' κ κ' : Type*}
variable {R M : Type*} [CommSemiring R] [AddCommMonoid M] [Module R M]
variable {R₂ M₂ : Type*} [CommRing R₂] [AddCommGroup M₂] [Module R₂ M₂]
open Function Matrix
def Basis.toMatrix (e : Basis ι R M) (v : ι' → M) : Matrix ι ι' R := fun i j => e.repr (v j) i
#align basis.to_matrix Basis.toMatrix
variable (e : Basis ι R M) (v : ι' → M) (i : ι) (j : ι')
namespace Basis
theorem toMatrix_apply : e.toMatrix v i j = e.repr (v j) i :=
rfl
#align basis.to_matrix_apply Basis.toMatrix_apply
theorem toMatrix_transpose_apply : (e.toMatrix v)ᵀ j = e.repr (v j) :=
funext fun _ => rfl
#align basis.to_matrix_transpose_apply Basis.toMatrix_transpose_apply
theorem toMatrix_eq_toMatrix_constr [Fintype ι] [DecidableEq ι] (v : ι → M) :
e.toMatrix v = LinearMap.toMatrix e e (e.constr ℕ v) := by
ext
rw [Basis.toMatrix_apply, LinearMap.toMatrix_apply, Basis.constr_basis]
#align basis.to_matrix_eq_to_matrix_constr Basis.toMatrix_eq_toMatrix_constr
-- TODO (maybe) Adjust the definition of `Basis.toMatrix` to eliminate the transpose.
theorem coePiBasisFun.toMatrix_eq_transpose [Finite ι] :
((Pi.basisFun R ι).toMatrix : Matrix ι ι R → Matrix ι ι R) = Matrix.transpose := by
ext M i j
rfl
#align basis.coe_pi_basis_fun.to_matrix_eq_transpose Basis.coePiBasisFun.toMatrix_eq_transpose
@[simp]
theorem toMatrix_self [DecidableEq ι] : e.toMatrix e = 1 := by
unfold Basis.toMatrix
ext i j
simp [Basis.equivFun, Matrix.one_apply, Finsupp.single_apply, eq_comm]
#align basis.to_matrix_self Basis.toMatrix_self
theorem toMatrix_update [DecidableEq ι'] (x : M) :
e.toMatrix (Function.update v j x) = Matrix.updateColumn (e.toMatrix v) j (e.repr x) := by
ext i' k
rw [Basis.toMatrix, Matrix.updateColumn_apply, e.toMatrix_apply]
split_ifs with h
· rw [h, update_same j x v]
· rw [update_noteq h]
#align basis.to_matrix_update Basis.toMatrix_update
@[simp]
theorem toMatrix_unitsSMul [DecidableEq ι] (e : Basis ι R₂ M₂) (w : ι → R₂ˣ) :
e.toMatrix (e.unitsSMul w) = diagonal ((↑) ∘ w) := by
ext i j
by_cases h : i = j
· simp [h, toMatrix_apply, unitsSMul_apply, Units.smul_def]
· simp [h, toMatrix_apply, unitsSMul_apply, Units.smul_def, Ne.symm h]
#align basis.to_matrix_units_smul Basis.toMatrix_unitsSMul
@[simp]
theorem toMatrix_isUnitSMul [DecidableEq ι] (e : Basis ι R₂ M₂) {w : ι → R₂}
(hw : ∀ i, IsUnit (w i)) : e.toMatrix (e.isUnitSMul hw) = diagonal w :=
e.toMatrix_unitsSMul _
#align basis.to_matrix_is_unit_smul Basis.toMatrix_isUnitSMul
@[simp]
| Mathlib/LinearAlgebra/Matrix/Basis.lean | 113 | 114 | theorem sum_toMatrix_smul_self [Fintype ι] : ∑ i : ι, e.toMatrix v i j • e i = v j := by |
simp_rw [e.toMatrix_apply, e.sum_repr]
| 1,717 |
import Mathlib.LinearAlgebra.Matrix.Reindex
import Mathlib.LinearAlgebra.Matrix.ToLin
#align_import linear_algebra.matrix.basis from "leanprover-community/mathlib"@"6c263e4bfc2e6714de30f22178b4d0ca4d149a76"
noncomputable section
open LinearMap Matrix Set Submodule
open Matrix
section BasisToMatrix
variable {ι ι' κ κ' : Type*}
variable {R M : Type*} [CommSemiring R] [AddCommMonoid M] [Module R M]
variable {R₂ M₂ : Type*} [CommRing R₂] [AddCommGroup M₂] [Module R₂ M₂]
open Function Matrix
def Basis.toMatrix (e : Basis ι R M) (v : ι' → M) : Matrix ι ι' R := fun i j => e.repr (v j) i
#align basis.to_matrix Basis.toMatrix
variable (e : Basis ι R M) (v : ι' → M) (i : ι) (j : ι')
namespace Basis
theorem toMatrix_apply : e.toMatrix v i j = e.repr (v j) i :=
rfl
#align basis.to_matrix_apply Basis.toMatrix_apply
theorem toMatrix_transpose_apply : (e.toMatrix v)ᵀ j = e.repr (v j) :=
funext fun _ => rfl
#align basis.to_matrix_transpose_apply Basis.toMatrix_transpose_apply
theorem toMatrix_eq_toMatrix_constr [Fintype ι] [DecidableEq ι] (v : ι → M) :
e.toMatrix v = LinearMap.toMatrix e e (e.constr ℕ v) := by
ext
rw [Basis.toMatrix_apply, LinearMap.toMatrix_apply, Basis.constr_basis]
#align basis.to_matrix_eq_to_matrix_constr Basis.toMatrix_eq_toMatrix_constr
-- TODO (maybe) Adjust the definition of `Basis.toMatrix` to eliminate the transpose.
theorem coePiBasisFun.toMatrix_eq_transpose [Finite ι] :
((Pi.basisFun R ι).toMatrix : Matrix ι ι R → Matrix ι ι R) = Matrix.transpose := by
ext M i j
rfl
#align basis.coe_pi_basis_fun.to_matrix_eq_transpose Basis.coePiBasisFun.toMatrix_eq_transpose
@[simp]
theorem toMatrix_self [DecidableEq ι] : e.toMatrix e = 1 := by
unfold Basis.toMatrix
ext i j
simp [Basis.equivFun, Matrix.one_apply, Finsupp.single_apply, eq_comm]
#align basis.to_matrix_self Basis.toMatrix_self
theorem toMatrix_update [DecidableEq ι'] (x : M) :
e.toMatrix (Function.update v j x) = Matrix.updateColumn (e.toMatrix v) j (e.repr x) := by
ext i' k
rw [Basis.toMatrix, Matrix.updateColumn_apply, e.toMatrix_apply]
split_ifs with h
· rw [h, update_same j x v]
· rw [update_noteq h]
#align basis.to_matrix_update Basis.toMatrix_update
@[simp]
theorem toMatrix_unitsSMul [DecidableEq ι] (e : Basis ι R₂ M₂) (w : ι → R₂ˣ) :
e.toMatrix (e.unitsSMul w) = diagonal ((↑) ∘ w) := by
ext i j
by_cases h : i = j
· simp [h, toMatrix_apply, unitsSMul_apply, Units.smul_def]
· simp [h, toMatrix_apply, unitsSMul_apply, Units.smul_def, Ne.symm h]
#align basis.to_matrix_units_smul Basis.toMatrix_unitsSMul
@[simp]
theorem toMatrix_isUnitSMul [DecidableEq ι] (e : Basis ι R₂ M₂) {w : ι → R₂}
(hw : ∀ i, IsUnit (w i)) : e.toMatrix (e.isUnitSMul hw) = diagonal w :=
e.toMatrix_unitsSMul _
#align basis.to_matrix_is_unit_smul Basis.toMatrix_isUnitSMul
@[simp]
theorem sum_toMatrix_smul_self [Fintype ι] : ∑ i : ι, e.toMatrix v i j • e i = v j := by
simp_rw [e.toMatrix_apply, e.sum_repr]
#align basis.sum_to_matrix_smul_self Basis.sum_toMatrix_smul_self
| Mathlib/LinearAlgebra/Matrix/Basis.lean | 117 | 122 | theorem toMatrix_smul {R₁ S : Type*} [CommRing R₁] [Ring S] [Algebra R₁ S] [Fintype ι]
[DecidableEq ι] (x : S) (b : Basis ι R₁ S) (w : ι → S) :
(b.toMatrix (x • w)) = (Algebra.leftMulMatrix b x) * (b.toMatrix w) := by |
ext
rw [Basis.toMatrix_apply, Pi.smul_apply, smul_eq_mul, ← Algebra.leftMulMatrix_mulVec_repr]
rfl
| 1,717 |
import Mathlib.LinearAlgebra.Matrix.Reindex
import Mathlib.LinearAlgebra.Matrix.ToLin
#align_import linear_algebra.matrix.basis from "leanprover-community/mathlib"@"6c263e4bfc2e6714de30f22178b4d0ca4d149a76"
noncomputable section
open LinearMap Matrix Set Submodule
open Matrix
section BasisToMatrix
variable {ι ι' κ κ' : Type*}
variable {R M : Type*} [CommSemiring R] [AddCommMonoid M] [Module R M]
variable {R₂ M₂ : Type*} [CommRing R₂] [AddCommGroup M₂] [Module R₂ M₂]
open Function Matrix
def Basis.toMatrix (e : Basis ι R M) (v : ι' → M) : Matrix ι ι' R := fun i j => e.repr (v j) i
#align basis.to_matrix Basis.toMatrix
variable (e : Basis ι R M) (v : ι' → M) (i : ι) (j : ι')
namespace Basis
theorem toMatrix_apply : e.toMatrix v i j = e.repr (v j) i :=
rfl
#align basis.to_matrix_apply Basis.toMatrix_apply
theorem toMatrix_transpose_apply : (e.toMatrix v)ᵀ j = e.repr (v j) :=
funext fun _ => rfl
#align basis.to_matrix_transpose_apply Basis.toMatrix_transpose_apply
theorem toMatrix_eq_toMatrix_constr [Fintype ι] [DecidableEq ι] (v : ι → M) :
e.toMatrix v = LinearMap.toMatrix e e (e.constr ℕ v) := by
ext
rw [Basis.toMatrix_apply, LinearMap.toMatrix_apply, Basis.constr_basis]
#align basis.to_matrix_eq_to_matrix_constr Basis.toMatrix_eq_toMatrix_constr
-- TODO (maybe) Adjust the definition of `Basis.toMatrix` to eliminate the transpose.
theorem coePiBasisFun.toMatrix_eq_transpose [Finite ι] :
((Pi.basisFun R ι).toMatrix : Matrix ι ι R → Matrix ι ι R) = Matrix.transpose := by
ext M i j
rfl
#align basis.coe_pi_basis_fun.to_matrix_eq_transpose Basis.coePiBasisFun.toMatrix_eq_transpose
@[simp]
theorem toMatrix_self [DecidableEq ι] : e.toMatrix e = 1 := by
unfold Basis.toMatrix
ext i j
simp [Basis.equivFun, Matrix.one_apply, Finsupp.single_apply, eq_comm]
#align basis.to_matrix_self Basis.toMatrix_self
theorem toMatrix_update [DecidableEq ι'] (x : M) :
e.toMatrix (Function.update v j x) = Matrix.updateColumn (e.toMatrix v) j (e.repr x) := by
ext i' k
rw [Basis.toMatrix, Matrix.updateColumn_apply, e.toMatrix_apply]
split_ifs with h
· rw [h, update_same j x v]
· rw [update_noteq h]
#align basis.to_matrix_update Basis.toMatrix_update
@[simp]
theorem toMatrix_unitsSMul [DecidableEq ι] (e : Basis ι R₂ M₂) (w : ι → R₂ˣ) :
e.toMatrix (e.unitsSMul w) = diagonal ((↑) ∘ w) := by
ext i j
by_cases h : i = j
· simp [h, toMatrix_apply, unitsSMul_apply, Units.smul_def]
· simp [h, toMatrix_apply, unitsSMul_apply, Units.smul_def, Ne.symm h]
#align basis.to_matrix_units_smul Basis.toMatrix_unitsSMul
@[simp]
theorem toMatrix_isUnitSMul [DecidableEq ι] (e : Basis ι R₂ M₂) {w : ι → R₂}
(hw : ∀ i, IsUnit (w i)) : e.toMatrix (e.isUnitSMul hw) = diagonal w :=
e.toMatrix_unitsSMul _
#align basis.to_matrix_is_unit_smul Basis.toMatrix_isUnitSMul
@[simp]
theorem sum_toMatrix_smul_self [Fintype ι] : ∑ i : ι, e.toMatrix v i j • e i = v j := by
simp_rw [e.toMatrix_apply, e.sum_repr]
#align basis.sum_to_matrix_smul_self Basis.sum_toMatrix_smul_self
theorem toMatrix_smul {R₁ S : Type*} [CommRing R₁] [Ring S] [Algebra R₁ S] [Fintype ι]
[DecidableEq ι] (x : S) (b : Basis ι R₁ S) (w : ι → S) :
(b.toMatrix (x • w)) = (Algebra.leftMulMatrix b x) * (b.toMatrix w) := by
ext
rw [Basis.toMatrix_apply, Pi.smul_apply, smul_eq_mul, ← Algebra.leftMulMatrix_mulVec_repr]
rfl
| Mathlib/LinearAlgebra/Matrix/Basis.lean | 124 | 128 | theorem toMatrix_map_vecMul {S : Type*} [Ring S] [Algebra R S] [Fintype ι] (b : Basis ι R S)
(v : ι' → S) : b ᵥ* ((b.toMatrix v).map <| algebraMap R S) = v := by |
ext i
simp_rw [vecMul, dotProduct, Matrix.map_apply, ← Algebra.commutes, ← Algebra.smul_def,
sum_toMatrix_smul_self]
| 1,717 |
import Mathlib.LinearAlgebra.Charpoly.Basic
import Mathlib.LinearAlgebra.Matrix.Basis
#align_import linear_algebra.charpoly.to_matrix from "leanprover-community/mathlib"@"baab5d3091555838751562e6caad33c844bea15e"
universe u v w
variable {R M M₁ M₂ : Type*} [CommRing R] [Nontrivial R]
variable [AddCommGroup M] [Module R M] [Module.Free R M] [Module.Finite R M]
variable [AddCommGroup M₁] [Module R M₁] [Module.Finite R M₁] [Module.Free R M₁]
variable [AddCommGroup M₂] [Module R M₂] [Module.Finite R M₂] [Module.Free R M₂]
variable (f : M →ₗ[R] M)
open Matrix
noncomputable section
open Module.Free Polynomial Matrix
namespace LinearMap
section Basic
attribute [-instance] instCoeOutOfCoeSort
attribute [local instance 2000] RingHomClass.toNonUnitalRingHomClass
attribute [local instance 2000] NonUnitalRingHomClass.toMulHomClass
@[simp]
| Mathlib/LinearAlgebra/Charpoly/ToMatrix.lean | 48 | 87 | theorem charpoly_toMatrix {ι : Type w} [DecidableEq ι] [Fintype ι] (b : Basis ι R M) :
(toMatrix b b f).charpoly = f.charpoly := by |
let A := toMatrix b b f
let b' := chooseBasis R M
let ι' := ChooseBasisIndex R M
let A' := toMatrix b' b' f
let e := Basis.indexEquiv b b'
let φ := reindexLinearEquiv R R e e
let φ₁ := reindexLinearEquiv R R e (Equiv.refl ι')
let φ₂ := reindexLinearEquiv R R (Equiv.refl ι') (Equiv.refl ι')
let φ₃ := reindexLinearEquiv R R (Equiv.refl ι') e
let P := b.toMatrix b'
let Q := b'.toMatrix b
have hPQ : C.mapMatrix (φ₁ P) * C.mapMatrix (φ₃ Q) = 1 := by
rw [RingHom.mapMatrix_apply, RingHom.mapMatrix_apply, ← Matrix.map_mul,
reindexLinearEquiv_mul R R, Basis.toMatrix_mul_toMatrix_flip,
reindexLinearEquiv_one, ← RingHom.mapMatrix_apply, RingHom.map_one]
calc
A.charpoly = (reindex e e A).charpoly := (charpoly_reindex _ _).symm
_ = det (scalar ι' X - C.mapMatrix (φ A)) := rfl
_ = det (scalar ι' X - C.mapMatrix (φ (P * A' * Q))) := by
rw [basis_toMatrix_mul_linearMap_toMatrix_mul_basis_toMatrix]
_ = det (scalar ι' X - C.mapMatrix (φ₁ P * φ₂ A' * φ₃ Q)) := by
rw [reindexLinearEquiv_mul, reindexLinearEquiv_mul]
_ = det (scalar ι' X - C.mapMatrix (φ₁ P) * C.mapMatrix A' * C.mapMatrix (φ₃ Q)) := by simp [φ₂]
_ = det (scalar ι' X * C.mapMatrix (φ₁ P) * C.mapMatrix (φ₃ Q) -
C.mapMatrix (φ₁ P) * C.mapMatrix A' * C.mapMatrix (φ₃ Q)) := by
rw [Matrix.mul_assoc ((scalar ι') X), hPQ, Matrix.mul_one]
_ = det (C.mapMatrix (φ₁ P) * scalar ι' X * C.mapMatrix (φ₃ Q) -
C.mapMatrix (φ₁ P) * C.mapMatrix A' * C.mapMatrix (φ₃ Q)) := by
rw [scalar_commute _ commute_X]
_ = det (C.mapMatrix (φ₁ P) * (scalar ι' X - C.mapMatrix A') * C.mapMatrix (φ₃ Q)) := by
rw [← Matrix.sub_mul, ← Matrix.mul_sub]
_ = det (C.mapMatrix (φ₁ P)) * det (scalar ι' X - C.mapMatrix A') * det (C.mapMatrix (φ₃ Q)) :=
by rw [det_mul, det_mul]
_ = det (C.mapMatrix (φ₁ P)) * det (C.mapMatrix (φ₃ Q)) * det (scalar ι' X - C.mapMatrix A') :=
by ring
_ = det (scalar ι' X - C.mapMatrix A') := by
rw [← det_mul, hPQ, det_one, one_mul]
_ = f.charpoly := rfl
| 1,718 |
import Mathlib.Algebra.Algebra.Operations
import Mathlib.Algebra.Algebra.Subalgebra.Prod
import Mathlib.Algebra.Algebra.Subalgebra.Tower
import Mathlib.LinearAlgebra.Basis
import Mathlib.LinearAlgebra.Prod
import Mathlib.LinearAlgebra.Finsupp
import Mathlib.LinearAlgebra.Prod
#align_import ring_theory.adjoin.basic from "leanprover-community/mathlib"@"a35ddf20601f85f78cd57e7f5b09ed528d71b7af"
universe uR uS uA uB
open Pointwise
open Submodule Subsemiring
variable {R : Type uR} {S : Type uS} {A : Type uA} {B : Type uB}
namespace Algebra
section Semiring
variable [CommSemiring R] [CommSemiring S] [Semiring A] [Semiring B]
variable [Algebra R S] [Algebra R A] [Algebra S A] [Algebra R B] [IsScalarTower R S A]
variable {s t : Set A}
@[aesop safe 20 apply (rule_sets := [SetLike])]
theorem subset_adjoin : s ⊆ adjoin R s :=
Algebra.gc.le_u_l s
#align algebra.subset_adjoin Algebra.subset_adjoin
theorem adjoin_le {S : Subalgebra R A} (H : s ⊆ S) : adjoin R s ≤ S :=
Algebra.gc.l_le H
#align algebra.adjoin_le Algebra.adjoin_le
theorem adjoin_eq_sInf : adjoin R s = sInf { p : Subalgebra R A | s ⊆ p } :=
le_antisymm (le_sInf fun _ h => adjoin_le h) (sInf_le subset_adjoin)
#align algebra.adjoin_eq_Inf Algebra.adjoin_eq_sInf
theorem adjoin_le_iff {S : Subalgebra R A} : adjoin R s ≤ S ↔ s ⊆ S :=
Algebra.gc _ _
#align algebra.adjoin_le_iff Algebra.adjoin_le_iff
theorem adjoin_mono (H : s ⊆ t) : adjoin R s ≤ adjoin R t :=
Algebra.gc.monotone_l H
#align algebra.adjoin_mono Algebra.adjoin_mono
theorem adjoin_eq_of_le (S : Subalgebra R A) (h₁ : s ⊆ S) (h₂ : S ≤ adjoin R s) : adjoin R s = S :=
le_antisymm (adjoin_le h₁) h₂
#align algebra.adjoin_eq_of_le Algebra.adjoin_eq_of_le
theorem adjoin_eq (S : Subalgebra R A) : adjoin R ↑S = S :=
adjoin_eq_of_le _ (Set.Subset.refl _) subset_adjoin
#align algebra.adjoin_eq Algebra.adjoin_eq
theorem adjoin_iUnion {α : Type*} (s : α → Set A) :
adjoin R (Set.iUnion s) = ⨆ i : α, adjoin R (s i) :=
(@Algebra.gc R A _ _ _).l_iSup
#align algebra.adjoin_Union Algebra.adjoin_iUnion
| Mathlib/RingTheory/Adjoin/Basic.lean | 79 | 80 | theorem adjoin_attach_biUnion [DecidableEq A] {α : Type*} {s : Finset α} (f : s → Finset A) :
adjoin R (s.attach.biUnion f : Set A) = ⨆ x, adjoin R (f x) := by | simp [adjoin_iUnion]
| 1,719 |
import Mathlib.Algebra.Algebra.Operations
import Mathlib.Algebra.Algebra.Subalgebra.Prod
import Mathlib.Algebra.Algebra.Subalgebra.Tower
import Mathlib.LinearAlgebra.Basis
import Mathlib.LinearAlgebra.Prod
import Mathlib.LinearAlgebra.Finsupp
import Mathlib.LinearAlgebra.Prod
#align_import ring_theory.adjoin.basic from "leanprover-community/mathlib"@"a35ddf20601f85f78cd57e7f5b09ed528d71b7af"
universe uR uS uA uB
open Pointwise
open Submodule Subsemiring
variable {R : Type uR} {S : Type uS} {A : Type uA} {B : Type uB}
namespace Algebra
section Semiring
variable [CommSemiring R] [CommSemiring S] [Semiring A] [Semiring B]
variable [Algebra R S] [Algebra R A] [Algebra S A] [Algebra R B] [IsScalarTower R S A]
variable {s t : Set A}
@[aesop safe 20 apply (rule_sets := [SetLike])]
theorem subset_adjoin : s ⊆ adjoin R s :=
Algebra.gc.le_u_l s
#align algebra.subset_adjoin Algebra.subset_adjoin
theorem adjoin_le {S : Subalgebra R A} (H : s ⊆ S) : adjoin R s ≤ S :=
Algebra.gc.l_le H
#align algebra.adjoin_le Algebra.adjoin_le
theorem adjoin_eq_sInf : adjoin R s = sInf { p : Subalgebra R A | s ⊆ p } :=
le_antisymm (le_sInf fun _ h => adjoin_le h) (sInf_le subset_adjoin)
#align algebra.adjoin_eq_Inf Algebra.adjoin_eq_sInf
theorem adjoin_le_iff {S : Subalgebra R A} : adjoin R s ≤ S ↔ s ⊆ S :=
Algebra.gc _ _
#align algebra.adjoin_le_iff Algebra.adjoin_le_iff
theorem adjoin_mono (H : s ⊆ t) : adjoin R s ≤ adjoin R t :=
Algebra.gc.monotone_l H
#align algebra.adjoin_mono Algebra.adjoin_mono
theorem adjoin_eq_of_le (S : Subalgebra R A) (h₁ : s ⊆ S) (h₂ : S ≤ adjoin R s) : adjoin R s = S :=
le_antisymm (adjoin_le h₁) h₂
#align algebra.adjoin_eq_of_le Algebra.adjoin_eq_of_le
theorem adjoin_eq (S : Subalgebra R A) : adjoin R ↑S = S :=
adjoin_eq_of_le _ (Set.Subset.refl _) subset_adjoin
#align algebra.adjoin_eq Algebra.adjoin_eq
theorem adjoin_iUnion {α : Type*} (s : α → Set A) :
adjoin R (Set.iUnion s) = ⨆ i : α, adjoin R (s i) :=
(@Algebra.gc R A _ _ _).l_iSup
#align algebra.adjoin_Union Algebra.adjoin_iUnion
theorem adjoin_attach_biUnion [DecidableEq A] {α : Type*} {s : Finset α} (f : s → Finset A) :
adjoin R (s.attach.biUnion f : Set A) = ⨆ x, adjoin R (f x) := by simp [adjoin_iUnion]
#align algebra.adjoin_attach_bUnion Algebra.adjoin_attach_biUnion
@[elab_as_elim]
theorem adjoin_induction {p : A → Prop} {x : A} (h : x ∈ adjoin R s) (mem : ∀ x ∈ s, p x)
(algebraMap : ∀ r, p (algebraMap R A r)) (add : ∀ x y, p x → p y → p (x + y))
(mul : ∀ x y, p x → p y → p (x * y)) : p x :=
let S : Subalgebra R A :=
{ carrier := p
mul_mem' := mul _ _
add_mem' := add _ _
algebraMap_mem' := algebraMap }
adjoin_le (show s ≤ S from mem) h
#align algebra.adjoin_induction Algebra.adjoin_induction
@[elab_as_elim]
| Mathlib/RingTheory/Adjoin/Basic.lean | 99 | 113 | theorem adjoin_induction₂ {p : A → A → Prop} {a b : A} (ha : a ∈ adjoin R s) (hb : b ∈ adjoin R s)
(Hs : ∀ x ∈ s, ∀ y ∈ s, p x y) (Halg : ∀ r₁ r₂, p (algebraMap R A r₁) (algebraMap R A r₂))
(Halg_left : ∀ (r), ∀ x ∈ s, p (algebraMap R A r) x)
(Halg_right : ∀ (r), ∀ x ∈ s, p x (algebraMap R A r))
(Hadd_left : ∀ x₁ x₂ y, p x₁ y → p x₂ y → p (x₁ + x₂) y)
(Hadd_right : ∀ x y₁ y₂, p x y₁ → p x y₂ → p x (y₁ + y₂))
(Hmul_left : ∀ x₁ x₂ y, p x₁ y → p x₂ y → p (x₁ * x₂) y)
(Hmul_right : ∀ x y₁ y₂, p x y₁ → p x y₂ → p x (y₁ * y₂)) : p a b := by |
refine adjoin_induction hb ?_ (fun r => ?_) (Hadd_right a) (Hmul_right a)
· exact adjoin_induction ha Hs Halg_left
(fun x y Hx Hy z hz => Hadd_left x y z (Hx z hz) (Hy z hz))
fun x y Hx Hy z hz => Hmul_left x y z (Hx z hz) (Hy z hz)
· exact adjoin_induction ha (Halg_right r) (fun r' => Halg r' r)
(fun x y => Hadd_left x y ((algebraMap R A) r))
fun x y => Hmul_left x y ((algebraMap R A) r)
| 1,719 |
import Mathlib.Algebra.Algebra.Operations
import Mathlib.Algebra.Algebra.Subalgebra.Basic
import Mathlib.Algebra.Ring.Subring.Pointwise
import Mathlib.RingTheory.Adjoin.Basic
#align_import algebra.algebra.subalgebra.pointwise from "leanprover-community/mathlib"@"b2c707cd190a58ea0565c86695a19e99ccecc215"
namespace Subalgebra
section Pointwise
variable {R : Type*} {A : Type*} [CommSemiring R] [Semiring A] [Algebra R A]
| Mathlib/Algebra/Algebra/Subalgebra/Pointwise.lean | 27 | 32 | theorem mul_toSubmodule_le (S T : Subalgebra R A) :
(Subalgebra.toSubmodule S)* (Subalgebra.toSubmodule T) ≤ Subalgebra.toSubmodule (S ⊔ T) := by |
rw [Submodule.mul_le]
intro y hy z hz
show y * z ∈ S ⊔ T
exact mul_mem (Algebra.mem_sup_left hy) (Algebra.mem_sup_right hz)
| 1,720 |
import Mathlib.Algebra.Algebra.Operations
import Mathlib.Algebra.Algebra.Subalgebra.Basic
import Mathlib.Algebra.Ring.Subring.Pointwise
import Mathlib.RingTheory.Adjoin.Basic
#align_import algebra.algebra.subalgebra.pointwise from "leanprover-community/mathlib"@"b2c707cd190a58ea0565c86695a19e99ccecc215"
namespace Subalgebra
section Pointwise
variable {R : Type*} {A : Type*} [CommSemiring R] [Semiring A] [Algebra R A]
theorem mul_toSubmodule_le (S T : Subalgebra R A) :
(Subalgebra.toSubmodule S)* (Subalgebra.toSubmodule T) ≤ Subalgebra.toSubmodule (S ⊔ T) := by
rw [Submodule.mul_le]
intro y hy z hz
show y * z ∈ S ⊔ T
exact mul_mem (Algebra.mem_sup_left hy) (Algebra.mem_sup_right hz)
#align subalgebra.mul_to_submodule_le Subalgebra.mul_toSubmodule_le
@[simp]
| Mathlib/Algebra/Algebra/Subalgebra/Pointwise.lean | 37 | 44 | theorem mul_self (S : Subalgebra R A) : (Subalgebra.toSubmodule S) * (Subalgebra.toSubmodule S)
= (Subalgebra.toSubmodule S) := by |
apply le_antisymm
· refine (mul_toSubmodule_le _ _).trans_eq ?_
rw [sup_idem]
· intro x hx1
rw [← mul_one x]
exact Submodule.mul_mem_mul hx1 (show (1 : A) ∈ S from one_mem S)
| 1,720 |
import Mathlib.Algebra.Algebra.Operations
import Mathlib.Algebra.Algebra.Subalgebra.Basic
import Mathlib.Algebra.Ring.Subring.Pointwise
import Mathlib.RingTheory.Adjoin.Basic
#align_import algebra.algebra.subalgebra.pointwise from "leanprover-community/mathlib"@"b2c707cd190a58ea0565c86695a19e99ccecc215"
namespace Subalgebra
section Pointwise
variable {R : Type*} {A : Type*} [CommSemiring R] [Semiring A] [Algebra R A]
theorem mul_toSubmodule_le (S T : Subalgebra R A) :
(Subalgebra.toSubmodule S)* (Subalgebra.toSubmodule T) ≤ Subalgebra.toSubmodule (S ⊔ T) := by
rw [Submodule.mul_le]
intro y hy z hz
show y * z ∈ S ⊔ T
exact mul_mem (Algebra.mem_sup_left hy) (Algebra.mem_sup_right hz)
#align subalgebra.mul_to_submodule_le Subalgebra.mul_toSubmodule_le
@[simp]
theorem mul_self (S : Subalgebra R A) : (Subalgebra.toSubmodule S) * (Subalgebra.toSubmodule S)
= (Subalgebra.toSubmodule S) := by
apply le_antisymm
· refine (mul_toSubmodule_le _ _).trans_eq ?_
rw [sup_idem]
· intro x hx1
rw [← mul_one x]
exact Submodule.mul_mem_mul hx1 (show (1 : A) ∈ S from one_mem S)
#align subalgebra.mul_self Subalgebra.mul_self
| Mathlib/Algebra/Algebra/Subalgebra/Pointwise.lean | 48 | 65 | theorem mul_toSubmodule {R : Type*} {A : Type*} [CommSemiring R] [CommSemiring A] [Algebra R A]
(S T : Subalgebra R A) : (Subalgebra.toSubmodule S) * (Subalgebra.toSubmodule T)
= Subalgebra.toSubmodule (S ⊔ T) := by |
refine le_antisymm (mul_toSubmodule_le _ _) ?_
rintro x (hx : x ∈ Algebra.adjoin R (S ∪ T : Set A))
refine
Algebra.adjoin_induction hx (fun x hx => ?_) (fun r => ?_) (fun _ _ => Submodule.add_mem _)
fun x y hx hy => ?_
· cases' hx with hxS hxT
· rw [← mul_one x]
exact Submodule.mul_mem_mul hxS (show (1 : A) ∈ T from one_mem T)
· rw [← one_mul x]
exact Submodule.mul_mem_mul (show (1 : A) ∈ S from one_mem S) hxT
· rw [← one_mul (algebraMap _ _ _)]
exact Submodule.mul_mem_mul (show (1 : A) ∈ S from one_mem S) (algebraMap_mem T _)
have := Submodule.mul_mem_mul hx hy
rwa [mul_assoc, mul_comm _ (Subalgebra.toSubmodule T), ← mul_assoc _ _ (Subalgebra.toSubmodule S),
mul_self, mul_comm (Subalgebra.toSubmodule T), ← mul_assoc, mul_self] at this
| 1,720 |
import Mathlib.LinearAlgebra.FiniteDimensional
import Mathlib.LinearAlgebra.TensorProduct.Tower
import Mathlib.RingTheory.Adjoin.Basic
import Mathlib.LinearAlgebra.DirectSum.Finsupp
#align_import ring_theory.tensor_product from "leanprover-community/mathlib"@"88fcdc3da43943f5b01925deddaa5bf0c0e85e4e"
suppress_compilation
open scoped TensorProduct
open TensorProduct
namespace LinearMap
open TensorProduct
section Semiring
variable {R A B M N P : Type*} [CommSemiring R]
variable [Semiring A] [Algebra R A] [Semiring B] [Algebra R B]
variable [AddCommMonoid M] [AddCommMonoid N] [AddCommMonoid P]
variable [Module R M] [Module R N] [Module R P]
variable (r : R) (f g : M →ₗ[R] N)
variable (A)
def baseChange (f : M →ₗ[R] N) : A ⊗[R] M →ₗ[A] A ⊗[R] N :=
AlgebraTensorModule.map (LinearMap.id : A →ₗ[A] A) f
#align linear_map.base_change LinearMap.baseChange
variable {A}
@[simp]
theorem baseChange_tmul (a : A) (x : M) : f.baseChange A (a ⊗ₜ x) = a ⊗ₜ f x :=
rfl
#align linear_map.base_change_tmul LinearMap.baseChange_tmul
theorem baseChange_eq_ltensor : (f.baseChange A : A ⊗ M → A ⊗ N) = f.lTensor A :=
rfl
#align linear_map.base_change_eq_ltensor LinearMap.baseChange_eq_ltensor
@[simp]
| Mathlib/RingTheory/TensorProduct/Basic.lean | 83 | 86 | theorem baseChange_add : (f + g).baseChange A = f.baseChange A + g.baseChange A := by |
ext
-- Porting note: added `-baseChange_tmul`
simp [baseChange_eq_ltensor, -baseChange_tmul]
| 1,721 |
import Mathlib.LinearAlgebra.FiniteDimensional
import Mathlib.LinearAlgebra.TensorProduct.Tower
import Mathlib.RingTheory.Adjoin.Basic
import Mathlib.LinearAlgebra.DirectSum.Finsupp
#align_import ring_theory.tensor_product from "leanprover-community/mathlib"@"88fcdc3da43943f5b01925deddaa5bf0c0e85e4e"
suppress_compilation
open scoped TensorProduct
open TensorProduct
namespace LinearMap
open TensorProduct
section Semiring
variable {R A B M N P : Type*} [CommSemiring R]
variable [Semiring A] [Algebra R A] [Semiring B] [Algebra R B]
variable [AddCommMonoid M] [AddCommMonoid N] [AddCommMonoid P]
variable [Module R M] [Module R N] [Module R P]
variable (r : R) (f g : M →ₗ[R] N)
variable (A)
def baseChange (f : M →ₗ[R] N) : A ⊗[R] M →ₗ[A] A ⊗[R] N :=
AlgebraTensorModule.map (LinearMap.id : A →ₗ[A] A) f
#align linear_map.base_change LinearMap.baseChange
variable {A}
@[simp]
theorem baseChange_tmul (a : A) (x : M) : f.baseChange A (a ⊗ₜ x) = a ⊗ₜ f x :=
rfl
#align linear_map.base_change_tmul LinearMap.baseChange_tmul
theorem baseChange_eq_ltensor : (f.baseChange A : A ⊗ M → A ⊗ N) = f.lTensor A :=
rfl
#align linear_map.base_change_eq_ltensor LinearMap.baseChange_eq_ltensor
@[simp]
theorem baseChange_add : (f + g).baseChange A = f.baseChange A + g.baseChange A := by
ext
-- Porting note: added `-baseChange_tmul`
simp [baseChange_eq_ltensor, -baseChange_tmul]
#align linear_map.base_change_add LinearMap.baseChange_add
@[simp]
| Mathlib/RingTheory/TensorProduct/Basic.lean | 90 | 92 | theorem baseChange_zero : baseChange A (0 : M →ₗ[R] N) = 0 := by |
ext
simp [baseChange_eq_ltensor]
| 1,721 |
import Mathlib.LinearAlgebra.FiniteDimensional
import Mathlib.LinearAlgebra.TensorProduct.Tower
import Mathlib.RingTheory.Adjoin.Basic
import Mathlib.LinearAlgebra.DirectSum.Finsupp
#align_import ring_theory.tensor_product from "leanprover-community/mathlib"@"88fcdc3da43943f5b01925deddaa5bf0c0e85e4e"
suppress_compilation
open scoped TensorProduct
open TensorProduct
namespace LinearMap
open TensorProduct
section Semiring
variable {R A B M N P : Type*} [CommSemiring R]
variable [Semiring A] [Algebra R A] [Semiring B] [Algebra R B]
variable [AddCommMonoid M] [AddCommMonoid N] [AddCommMonoid P]
variable [Module R M] [Module R N] [Module R P]
variable (r : R) (f g : M →ₗ[R] N)
variable (A)
def baseChange (f : M →ₗ[R] N) : A ⊗[R] M →ₗ[A] A ⊗[R] N :=
AlgebraTensorModule.map (LinearMap.id : A →ₗ[A] A) f
#align linear_map.base_change LinearMap.baseChange
variable {A}
@[simp]
theorem baseChange_tmul (a : A) (x : M) : f.baseChange A (a ⊗ₜ x) = a ⊗ₜ f x :=
rfl
#align linear_map.base_change_tmul LinearMap.baseChange_tmul
theorem baseChange_eq_ltensor : (f.baseChange A : A ⊗ M → A ⊗ N) = f.lTensor A :=
rfl
#align linear_map.base_change_eq_ltensor LinearMap.baseChange_eq_ltensor
@[simp]
theorem baseChange_add : (f + g).baseChange A = f.baseChange A + g.baseChange A := by
ext
-- Porting note: added `-baseChange_tmul`
simp [baseChange_eq_ltensor, -baseChange_tmul]
#align linear_map.base_change_add LinearMap.baseChange_add
@[simp]
theorem baseChange_zero : baseChange A (0 : M →ₗ[R] N) = 0 := by
ext
simp [baseChange_eq_ltensor]
#align linear_map.base_change_zero LinearMap.baseChange_zero
@[simp]
| Mathlib/RingTheory/TensorProduct/Basic.lean | 96 | 98 | theorem baseChange_smul : (r • f).baseChange A = r • f.baseChange A := by |
ext
simp [baseChange_tmul]
| 1,721 |
import Mathlib.Data.Matrix.Basis
import Mathlib.RingTheory.TensorProduct.Basic
#align_import ring_theory.matrix_algebra from "leanprover-community/mathlib"@"6c351a8fb9b06e5a542fdf427bfb9f46724f9453"
suppress_compilation
universe u v w
open TensorProduct
open TensorProduct
open Algebra.TensorProduct
open Matrix
variable {R : Type u} [CommSemiring R]
variable {A : Type v} [Semiring A] [Algebra R A]
variable {n : Type w}
variable (R A n)
namespace MatrixEquivTensor
def toFunBilinear : A →ₗ[R] Matrix n n R →ₗ[R] Matrix n n A :=
(Algebra.lsmul R R (Matrix n n A)).toLinearMap.compl₂ (Algebra.linearMap R A).mapMatrix
#align matrix_equiv_tensor.to_fun_bilinear MatrixEquivTensor.toFunBilinear
@[simp]
theorem toFunBilinear_apply (a : A) (m : Matrix n n R) :
toFunBilinear R A n a m = a • m.map (algebraMap R A) :=
rfl
#align matrix_equiv_tensor.to_fun_bilinear_apply MatrixEquivTensor.toFunBilinear_apply
def toFunLinear : A ⊗[R] Matrix n n R →ₗ[R] Matrix n n A :=
TensorProduct.lift (toFunBilinear R A n)
#align matrix_equiv_tensor.to_fun_linear MatrixEquivTensor.toFunLinear
variable [DecidableEq n] [Fintype n]
def toFunAlgHom : A ⊗[R] Matrix n n R →ₐ[R] Matrix n n A :=
algHomOfLinearMapTensorProduct (toFunLinear R A n)
(by
intros
simp_rw [toFunLinear, lift.tmul, toFunBilinear_apply, Matrix.map_mul]
ext
dsimp
simp_rw [Matrix.mul_apply, Matrix.smul_apply, Matrix.map_apply, smul_eq_mul, Finset.mul_sum,
_root_.mul_assoc, Algebra.left_comm])
(by
simp_rw [toFunLinear, lift.tmul, toFunBilinear_apply,
Matrix.map_one (algebraMap R A) (map_zero _) (map_one _), one_smul])
#align matrix_equiv_tensor.to_fun_alg_hom MatrixEquivTensor.toFunAlgHom
@[simp]
theorem toFunAlgHom_apply (a : A) (m : Matrix n n R) :
toFunAlgHom R A n (a ⊗ₜ m) = a • m.map (algebraMap R A) := rfl
#align matrix_equiv_tensor.to_fun_alg_hom_apply MatrixEquivTensor.toFunAlgHom_apply
def invFun (M : Matrix n n A) : A ⊗[R] Matrix n n R :=
∑ p : n × n, M p.1 p.2 ⊗ₜ stdBasisMatrix p.1 p.2 1
#align matrix_equiv_tensor.inv_fun MatrixEquivTensor.invFun
@[simp]
| Mathlib/RingTheory/MatrixAlgebra.lean | 89 | 89 | theorem invFun_zero : invFun R A n 0 = 0 := by | simp [invFun]
| 1,722 |
import Mathlib.Data.Matrix.Basis
import Mathlib.RingTheory.TensorProduct.Basic
#align_import ring_theory.matrix_algebra from "leanprover-community/mathlib"@"6c351a8fb9b06e5a542fdf427bfb9f46724f9453"
suppress_compilation
universe u v w
open TensorProduct
open TensorProduct
open Algebra.TensorProduct
open Matrix
variable {R : Type u} [CommSemiring R]
variable {A : Type v} [Semiring A] [Algebra R A]
variable {n : Type w}
variable (R A n)
namespace MatrixEquivTensor
def toFunBilinear : A →ₗ[R] Matrix n n R →ₗ[R] Matrix n n A :=
(Algebra.lsmul R R (Matrix n n A)).toLinearMap.compl₂ (Algebra.linearMap R A).mapMatrix
#align matrix_equiv_tensor.to_fun_bilinear MatrixEquivTensor.toFunBilinear
@[simp]
theorem toFunBilinear_apply (a : A) (m : Matrix n n R) :
toFunBilinear R A n a m = a • m.map (algebraMap R A) :=
rfl
#align matrix_equiv_tensor.to_fun_bilinear_apply MatrixEquivTensor.toFunBilinear_apply
def toFunLinear : A ⊗[R] Matrix n n R →ₗ[R] Matrix n n A :=
TensorProduct.lift (toFunBilinear R A n)
#align matrix_equiv_tensor.to_fun_linear MatrixEquivTensor.toFunLinear
variable [DecidableEq n] [Fintype n]
def toFunAlgHom : A ⊗[R] Matrix n n R →ₐ[R] Matrix n n A :=
algHomOfLinearMapTensorProduct (toFunLinear R A n)
(by
intros
simp_rw [toFunLinear, lift.tmul, toFunBilinear_apply, Matrix.map_mul]
ext
dsimp
simp_rw [Matrix.mul_apply, Matrix.smul_apply, Matrix.map_apply, smul_eq_mul, Finset.mul_sum,
_root_.mul_assoc, Algebra.left_comm])
(by
simp_rw [toFunLinear, lift.tmul, toFunBilinear_apply,
Matrix.map_one (algebraMap R A) (map_zero _) (map_one _), one_smul])
#align matrix_equiv_tensor.to_fun_alg_hom MatrixEquivTensor.toFunAlgHom
@[simp]
theorem toFunAlgHom_apply (a : A) (m : Matrix n n R) :
toFunAlgHom R A n (a ⊗ₜ m) = a • m.map (algebraMap R A) := rfl
#align matrix_equiv_tensor.to_fun_alg_hom_apply MatrixEquivTensor.toFunAlgHom_apply
def invFun (M : Matrix n n A) : A ⊗[R] Matrix n n R :=
∑ p : n × n, M p.1 p.2 ⊗ₜ stdBasisMatrix p.1 p.2 1
#align matrix_equiv_tensor.inv_fun MatrixEquivTensor.invFun
@[simp]
theorem invFun_zero : invFun R A n 0 = 0 := by simp [invFun]
#align matrix_equiv_tensor.inv_fun_zero MatrixEquivTensor.invFun_zero
@[simp]
| Mathlib/RingTheory/MatrixAlgebra.lean | 93 | 95 | theorem invFun_add (M N : Matrix n n A) :
invFun R A n (M + N) = invFun R A n M + invFun R A n N := by |
simp [invFun, add_tmul, Finset.sum_add_distrib]
| 1,722 |
import Mathlib.Data.Matrix.Basis
import Mathlib.RingTheory.TensorProduct.Basic
#align_import ring_theory.matrix_algebra from "leanprover-community/mathlib"@"6c351a8fb9b06e5a542fdf427bfb9f46724f9453"
suppress_compilation
universe u v w
open TensorProduct
open TensorProduct
open Algebra.TensorProduct
open Matrix
variable {R : Type u} [CommSemiring R]
variable {A : Type v} [Semiring A] [Algebra R A]
variable {n : Type w}
variable (R A n)
namespace MatrixEquivTensor
def toFunBilinear : A →ₗ[R] Matrix n n R →ₗ[R] Matrix n n A :=
(Algebra.lsmul R R (Matrix n n A)).toLinearMap.compl₂ (Algebra.linearMap R A).mapMatrix
#align matrix_equiv_tensor.to_fun_bilinear MatrixEquivTensor.toFunBilinear
@[simp]
theorem toFunBilinear_apply (a : A) (m : Matrix n n R) :
toFunBilinear R A n a m = a • m.map (algebraMap R A) :=
rfl
#align matrix_equiv_tensor.to_fun_bilinear_apply MatrixEquivTensor.toFunBilinear_apply
def toFunLinear : A ⊗[R] Matrix n n R →ₗ[R] Matrix n n A :=
TensorProduct.lift (toFunBilinear R A n)
#align matrix_equiv_tensor.to_fun_linear MatrixEquivTensor.toFunLinear
variable [DecidableEq n] [Fintype n]
def toFunAlgHom : A ⊗[R] Matrix n n R →ₐ[R] Matrix n n A :=
algHomOfLinearMapTensorProduct (toFunLinear R A n)
(by
intros
simp_rw [toFunLinear, lift.tmul, toFunBilinear_apply, Matrix.map_mul]
ext
dsimp
simp_rw [Matrix.mul_apply, Matrix.smul_apply, Matrix.map_apply, smul_eq_mul, Finset.mul_sum,
_root_.mul_assoc, Algebra.left_comm])
(by
simp_rw [toFunLinear, lift.tmul, toFunBilinear_apply,
Matrix.map_one (algebraMap R A) (map_zero _) (map_one _), one_smul])
#align matrix_equiv_tensor.to_fun_alg_hom MatrixEquivTensor.toFunAlgHom
@[simp]
theorem toFunAlgHom_apply (a : A) (m : Matrix n n R) :
toFunAlgHom R A n (a ⊗ₜ m) = a • m.map (algebraMap R A) := rfl
#align matrix_equiv_tensor.to_fun_alg_hom_apply MatrixEquivTensor.toFunAlgHom_apply
def invFun (M : Matrix n n A) : A ⊗[R] Matrix n n R :=
∑ p : n × n, M p.1 p.2 ⊗ₜ stdBasisMatrix p.1 p.2 1
#align matrix_equiv_tensor.inv_fun MatrixEquivTensor.invFun
@[simp]
theorem invFun_zero : invFun R A n 0 = 0 := by simp [invFun]
#align matrix_equiv_tensor.inv_fun_zero MatrixEquivTensor.invFun_zero
@[simp]
theorem invFun_add (M N : Matrix n n A) :
invFun R A n (M + N) = invFun R A n M + invFun R A n N := by
simp [invFun, add_tmul, Finset.sum_add_distrib]
#align matrix_equiv_tensor.inv_fun_add MatrixEquivTensor.invFun_add
@[simp]
| Mathlib/RingTheory/MatrixAlgebra.lean | 99 | 101 | theorem invFun_smul (a : A) (M : Matrix n n A) :
invFun R A n (a • M) = a ⊗ₜ 1 * invFun R A n M := by |
simp [invFun, Finset.mul_sum]
| 1,722 |
import Mathlib.Data.Matrix.Basis
import Mathlib.RingTheory.TensorProduct.Basic
#align_import ring_theory.matrix_algebra from "leanprover-community/mathlib"@"6c351a8fb9b06e5a542fdf427bfb9f46724f9453"
suppress_compilation
universe u v w
open TensorProduct
open TensorProduct
open Algebra.TensorProduct
open Matrix
variable {R : Type u} [CommSemiring R]
variable {A : Type v} [Semiring A] [Algebra R A]
variable {n : Type w}
variable (R A n)
namespace MatrixEquivTensor
def toFunBilinear : A →ₗ[R] Matrix n n R →ₗ[R] Matrix n n A :=
(Algebra.lsmul R R (Matrix n n A)).toLinearMap.compl₂ (Algebra.linearMap R A).mapMatrix
#align matrix_equiv_tensor.to_fun_bilinear MatrixEquivTensor.toFunBilinear
@[simp]
theorem toFunBilinear_apply (a : A) (m : Matrix n n R) :
toFunBilinear R A n a m = a • m.map (algebraMap R A) :=
rfl
#align matrix_equiv_tensor.to_fun_bilinear_apply MatrixEquivTensor.toFunBilinear_apply
def toFunLinear : A ⊗[R] Matrix n n R →ₗ[R] Matrix n n A :=
TensorProduct.lift (toFunBilinear R A n)
#align matrix_equiv_tensor.to_fun_linear MatrixEquivTensor.toFunLinear
variable [DecidableEq n] [Fintype n]
def toFunAlgHom : A ⊗[R] Matrix n n R →ₐ[R] Matrix n n A :=
algHomOfLinearMapTensorProduct (toFunLinear R A n)
(by
intros
simp_rw [toFunLinear, lift.tmul, toFunBilinear_apply, Matrix.map_mul]
ext
dsimp
simp_rw [Matrix.mul_apply, Matrix.smul_apply, Matrix.map_apply, smul_eq_mul, Finset.mul_sum,
_root_.mul_assoc, Algebra.left_comm])
(by
simp_rw [toFunLinear, lift.tmul, toFunBilinear_apply,
Matrix.map_one (algebraMap R A) (map_zero _) (map_one _), one_smul])
#align matrix_equiv_tensor.to_fun_alg_hom MatrixEquivTensor.toFunAlgHom
@[simp]
theorem toFunAlgHom_apply (a : A) (m : Matrix n n R) :
toFunAlgHom R A n (a ⊗ₜ m) = a • m.map (algebraMap R A) := rfl
#align matrix_equiv_tensor.to_fun_alg_hom_apply MatrixEquivTensor.toFunAlgHom_apply
def invFun (M : Matrix n n A) : A ⊗[R] Matrix n n R :=
∑ p : n × n, M p.1 p.2 ⊗ₜ stdBasisMatrix p.1 p.2 1
#align matrix_equiv_tensor.inv_fun MatrixEquivTensor.invFun
@[simp]
theorem invFun_zero : invFun R A n 0 = 0 := by simp [invFun]
#align matrix_equiv_tensor.inv_fun_zero MatrixEquivTensor.invFun_zero
@[simp]
theorem invFun_add (M N : Matrix n n A) :
invFun R A n (M + N) = invFun R A n M + invFun R A n N := by
simp [invFun, add_tmul, Finset.sum_add_distrib]
#align matrix_equiv_tensor.inv_fun_add MatrixEquivTensor.invFun_add
@[simp]
theorem invFun_smul (a : A) (M : Matrix n n A) :
invFun R A n (a • M) = a ⊗ₜ 1 * invFun R A n M := by
simp [invFun, Finset.mul_sum]
#align matrix_equiv_tensor.inv_fun_smul MatrixEquivTensor.invFun_smul
@[simp]
| Mathlib/RingTheory/MatrixAlgebra.lean | 105 | 110 | theorem invFun_algebraMap (M : Matrix n n R) : invFun R A n (M.map (algebraMap R A)) = 1 ⊗ₜ M := by |
dsimp [invFun]
simp only [Algebra.algebraMap_eq_smul_one, smul_tmul, ← tmul_sum, mul_boole]
congr
conv_rhs => rw [matrix_eq_sum_std_basis M]
convert Finset.sum_product (β := Matrix n n R); simp
| 1,722 |
import Mathlib.Data.Matrix.Basis
import Mathlib.RingTheory.TensorProduct.Basic
#align_import ring_theory.matrix_algebra from "leanprover-community/mathlib"@"6c351a8fb9b06e5a542fdf427bfb9f46724f9453"
suppress_compilation
universe u v w
open TensorProduct
open TensorProduct
open Algebra.TensorProduct
open Matrix
variable {R : Type u} [CommSemiring R]
variable {A : Type v} [Semiring A] [Algebra R A]
variable {n : Type w}
variable (R A n)
namespace MatrixEquivTensor
def toFunBilinear : A →ₗ[R] Matrix n n R →ₗ[R] Matrix n n A :=
(Algebra.lsmul R R (Matrix n n A)).toLinearMap.compl₂ (Algebra.linearMap R A).mapMatrix
#align matrix_equiv_tensor.to_fun_bilinear MatrixEquivTensor.toFunBilinear
@[simp]
theorem toFunBilinear_apply (a : A) (m : Matrix n n R) :
toFunBilinear R A n a m = a • m.map (algebraMap R A) :=
rfl
#align matrix_equiv_tensor.to_fun_bilinear_apply MatrixEquivTensor.toFunBilinear_apply
def toFunLinear : A ⊗[R] Matrix n n R →ₗ[R] Matrix n n A :=
TensorProduct.lift (toFunBilinear R A n)
#align matrix_equiv_tensor.to_fun_linear MatrixEquivTensor.toFunLinear
variable [DecidableEq n] [Fintype n]
def toFunAlgHom : A ⊗[R] Matrix n n R →ₐ[R] Matrix n n A :=
algHomOfLinearMapTensorProduct (toFunLinear R A n)
(by
intros
simp_rw [toFunLinear, lift.tmul, toFunBilinear_apply, Matrix.map_mul]
ext
dsimp
simp_rw [Matrix.mul_apply, Matrix.smul_apply, Matrix.map_apply, smul_eq_mul, Finset.mul_sum,
_root_.mul_assoc, Algebra.left_comm])
(by
simp_rw [toFunLinear, lift.tmul, toFunBilinear_apply,
Matrix.map_one (algebraMap R A) (map_zero _) (map_one _), one_smul])
#align matrix_equiv_tensor.to_fun_alg_hom MatrixEquivTensor.toFunAlgHom
@[simp]
theorem toFunAlgHom_apply (a : A) (m : Matrix n n R) :
toFunAlgHom R A n (a ⊗ₜ m) = a • m.map (algebraMap R A) := rfl
#align matrix_equiv_tensor.to_fun_alg_hom_apply MatrixEquivTensor.toFunAlgHom_apply
def invFun (M : Matrix n n A) : A ⊗[R] Matrix n n R :=
∑ p : n × n, M p.1 p.2 ⊗ₜ stdBasisMatrix p.1 p.2 1
#align matrix_equiv_tensor.inv_fun MatrixEquivTensor.invFun
@[simp]
theorem invFun_zero : invFun R A n 0 = 0 := by simp [invFun]
#align matrix_equiv_tensor.inv_fun_zero MatrixEquivTensor.invFun_zero
@[simp]
theorem invFun_add (M N : Matrix n n A) :
invFun R A n (M + N) = invFun R A n M + invFun R A n N := by
simp [invFun, add_tmul, Finset.sum_add_distrib]
#align matrix_equiv_tensor.inv_fun_add MatrixEquivTensor.invFun_add
@[simp]
theorem invFun_smul (a : A) (M : Matrix n n A) :
invFun R A n (a • M) = a ⊗ₜ 1 * invFun R A n M := by
simp [invFun, Finset.mul_sum]
#align matrix_equiv_tensor.inv_fun_smul MatrixEquivTensor.invFun_smul
@[simp]
theorem invFun_algebraMap (M : Matrix n n R) : invFun R A n (M.map (algebraMap R A)) = 1 ⊗ₜ M := by
dsimp [invFun]
simp only [Algebra.algebraMap_eq_smul_one, smul_tmul, ← tmul_sum, mul_boole]
congr
conv_rhs => rw [matrix_eq_sum_std_basis M]
convert Finset.sum_product (β := Matrix n n R); simp
#align matrix_equiv_tensor.inv_fun_algebra_map MatrixEquivTensor.invFun_algebraMap
| Mathlib/RingTheory/MatrixAlgebra.lean | 113 | 121 | theorem right_inv (M : Matrix n n A) : (toFunAlgHom R A n) (invFun R A n M) = M := by |
simp only [invFun, AlgHom.map_sum, stdBasisMatrix, apply_ite ↑(algebraMap R A), smul_eq_mul,
mul_boole, toFunAlgHom_apply, RingHom.map_zero, RingHom.map_one, Matrix.map_apply,
Pi.smul_def]
convert Finset.sum_product (β := Matrix n n A)
conv_lhs => rw [matrix_eq_sum_std_basis M]
refine Finset.sum_congr rfl fun i _ => Finset.sum_congr rfl fun j _ => Matrix.ext fun a b => ?_
simp only [stdBasisMatrix, smul_apply, Matrix.map_apply]
split_ifs <;> aesop
| 1,722 |
import Mathlib.Data.Matrix.Basis
import Mathlib.RingTheory.TensorProduct.Basic
#align_import ring_theory.matrix_algebra from "leanprover-community/mathlib"@"6c351a8fb9b06e5a542fdf427bfb9f46724f9453"
suppress_compilation
universe u v w
open TensorProduct
open TensorProduct
open Algebra.TensorProduct
open Matrix
variable {R : Type u} [CommSemiring R]
variable {A : Type v} [Semiring A] [Algebra R A]
variable {n : Type w}
variable (R A n)
namespace MatrixEquivTensor
def toFunBilinear : A →ₗ[R] Matrix n n R →ₗ[R] Matrix n n A :=
(Algebra.lsmul R R (Matrix n n A)).toLinearMap.compl₂ (Algebra.linearMap R A).mapMatrix
#align matrix_equiv_tensor.to_fun_bilinear MatrixEquivTensor.toFunBilinear
@[simp]
theorem toFunBilinear_apply (a : A) (m : Matrix n n R) :
toFunBilinear R A n a m = a • m.map (algebraMap R A) :=
rfl
#align matrix_equiv_tensor.to_fun_bilinear_apply MatrixEquivTensor.toFunBilinear_apply
def toFunLinear : A ⊗[R] Matrix n n R →ₗ[R] Matrix n n A :=
TensorProduct.lift (toFunBilinear R A n)
#align matrix_equiv_tensor.to_fun_linear MatrixEquivTensor.toFunLinear
variable [DecidableEq n] [Fintype n]
def toFunAlgHom : A ⊗[R] Matrix n n R →ₐ[R] Matrix n n A :=
algHomOfLinearMapTensorProduct (toFunLinear R A n)
(by
intros
simp_rw [toFunLinear, lift.tmul, toFunBilinear_apply, Matrix.map_mul]
ext
dsimp
simp_rw [Matrix.mul_apply, Matrix.smul_apply, Matrix.map_apply, smul_eq_mul, Finset.mul_sum,
_root_.mul_assoc, Algebra.left_comm])
(by
simp_rw [toFunLinear, lift.tmul, toFunBilinear_apply,
Matrix.map_one (algebraMap R A) (map_zero _) (map_one _), one_smul])
#align matrix_equiv_tensor.to_fun_alg_hom MatrixEquivTensor.toFunAlgHom
@[simp]
theorem toFunAlgHom_apply (a : A) (m : Matrix n n R) :
toFunAlgHom R A n (a ⊗ₜ m) = a • m.map (algebraMap R A) := rfl
#align matrix_equiv_tensor.to_fun_alg_hom_apply MatrixEquivTensor.toFunAlgHom_apply
def invFun (M : Matrix n n A) : A ⊗[R] Matrix n n R :=
∑ p : n × n, M p.1 p.2 ⊗ₜ stdBasisMatrix p.1 p.2 1
#align matrix_equiv_tensor.inv_fun MatrixEquivTensor.invFun
@[simp]
theorem invFun_zero : invFun R A n 0 = 0 := by simp [invFun]
#align matrix_equiv_tensor.inv_fun_zero MatrixEquivTensor.invFun_zero
@[simp]
theorem invFun_add (M N : Matrix n n A) :
invFun R A n (M + N) = invFun R A n M + invFun R A n N := by
simp [invFun, add_tmul, Finset.sum_add_distrib]
#align matrix_equiv_tensor.inv_fun_add MatrixEquivTensor.invFun_add
@[simp]
theorem invFun_smul (a : A) (M : Matrix n n A) :
invFun R A n (a • M) = a ⊗ₜ 1 * invFun R A n M := by
simp [invFun, Finset.mul_sum]
#align matrix_equiv_tensor.inv_fun_smul MatrixEquivTensor.invFun_smul
@[simp]
theorem invFun_algebraMap (M : Matrix n n R) : invFun R A n (M.map (algebraMap R A)) = 1 ⊗ₜ M := by
dsimp [invFun]
simp only [Algebra.algebraMap_eq_smul_one, smul_tmul, ← tmul_sum, mul_boole]
congr
conv_rhs => rw [matrix_eq_sum_std_basis M]
convert Finset.sum_product (β := Matrix n n R); simp
#align matrix_equiv_tensor.inv_fun_algebra_map MatrixEquivTensor.invFun_algebraMap
theorem right_inv (M : Matrix n n A) : (toFunAlgHom R A n) (invFun R A n M) = M := by
simp only [invFun, AlgHom.map_sum, stdBasisMatrix, apply_ite ↑(algebraMap R A), smul_eq_mul,
mul_boole, toFunAlgHom_apply, RingHom.map_zero, RingHom.map_one, Matrix.map_apply,
Pi.smul_def]
convert Finset.sum_product (β := Matrix n n A)
conv_lhs => rw [matrix_eq_sum_std_basis M]
refine Finset.sum_congr rfl fun i _ => Finset.sum_congr rfl fun j _ => Matrix.ext fun a b => ?_
simp only [stdBasisMatrix, smul_apply, Matrix.map_apply]
split_ifs <;> aesop
#align matrix_equiv_tensor.right_inv MatrixEquivTensor.right_inv
| Mathlib/RingTheory/MatrixAlgebra.lean | 124 | 130 | theorem left_inv (M : A ⊗[R] Matrix n n R) : invFun R A n (toFunAlgHom R A n M) = M := by |
induction M using TensorProduct.induction_on with
| zero => simp
| tmul a m => simp
| add x y hx hy =>
rw [map_add]
conv_rhs => rw [← hx, ← hy, ← invFun_add]
| 1,722 |
import Mathlib.RingTheory.FinitePresentation
import Mathlib.RingTheory.Localization.Away.Basic
import Mathlib.RingTheory.Localization.Away.AdjoinRoot
import Mathlib.RingTheory.QuotientNilpotent
import Mathlib.RingTheory.TensorProduct.Basic
-- Porting note: added to make the syntax work below.
open scoped TensorProduct
universe u
namespace Algebra
section
variable (R : Type u) [CommSemiring R]
variable (A : Type u) [Semiring A] [Algebra R A]
@[mk_iff]
class FormallyUnramified : Prop where
comp_injective :
∀ ⦃B : Type u⦄ [CommRing B],
∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥),
Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I)
#align algebra.formally_unramified Algebra.FormallyUnramified
end
namespace FormallyUnramified
section
variable {R : Type u} [CommSemiring R]
variable {A : Type u} [Semiring A] [Algebra R A]
variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B)
| Mathlib/RingTheory/Unramified/Basic.lean | 69 | 83 | theorem lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B]
[FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B)
(h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by |
revert g₁ g₂
change Function.Injective (Ideal.Quotient.mkₐ R I).comp
revert _RB
apply Ideal.IsNilpotent.induction_on (R := B) I hI
· intro B _ I hI _; exact FormallyUnramified.comp_injective I hI
· intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e
apply h₁
apply h₂
ext x
replace e := AlgHom.congr_fun e x
dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢
rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq]
| 1,723 |
import Mathlib.RingTheory.FinitePresentation
import Mathlib.RingTheory.Localization.Away.Basic
import Mathlib.RingTheory.Localization.Away.AdjoinRoot
import Mathlib.RingTheory.QuotientNilpotent
import Mathlib.RingTheory.TensorProduct.Basic
-- Porting note: added to make the syntax work below.
open scoped TensorProduct
universe u
namespace Algebra
section
variable (R : Type u) [CommSemiring R]
variable (A : Type u) [Semiring A] [Algebra R A]
@[mk_iff]
class FormallyUnramified : Prop where
comp_injective :
∀ ⦃B : Type u⦄ [CommRing B],
∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥),
Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I)
#align algebra.formally_unramified Algebra.FormallyUnramified
end
namespace FormallyUnramified
section
variable {R : Type u} [CommSemiring R]
variable {A : Type u} [Semiring A] [Algebra R A]
variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B)
theorem lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B]
[FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B)
(h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by
revert g₁ g₂
change Function.Injective (Ideal.Quotient.mkₐ R I).comp
revert _RB
apply Ideal.IsNilpotent.induction_on (R := B) I hI
· intro B _ I hI _; exact FormallyUnramified.comp_injective I hI
· intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e
apply h₁
apply h₂
ext x
replace e := AlgHom.congr_fun e x
dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢
rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq]
#align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique
theorem ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B}
(H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ :=
FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H)
#align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext
theorem lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C]
(f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B)
(h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ :=
FormallyUnramified.lift_unique _ hf _ _
(by
ext x
have := RingHom.congr_fun h x
simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk,
RingHom.mem_ker, map_sub, sub_eq_zero])
#align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom
theorem ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C)
(hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) :
g₁ = g₂ :=
FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h)
#align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext'
theorem lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C]
[Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C))
(g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ :=
FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h)
#align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique'
end
section OfEquiv
variable {R : Type u} [CommSemiring R]
variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B]
| Mathlib/RingTheory/Unramified/Basic.lean | 121 | 128 | theorem of_equiv [FormallyUnramified R A] (e : A ≃ₐ[R] B) :
FormallyUnramified R B := by |
constructor
intro C _ _ I hI f₁ f₂ e'
rw [← f₁.comp_id, ← f₂.comp_id, ← e.comp_symm, ← AlgHom.comp_assoc, ← AlgHom.comp_assoc]
congr 1
refine FormallyUnramified.comp_injective I hI ?_
rw [← AlgHom.comp_assoc, e', AlgHom.comp_assoc]
| 1,723 |
import Mathlib.RingTheory.FinitePresentation
import Mathlib.RingTheory.Localization.Away.Basic
import Mathlib.RingTheory.Localization.Away.AdjoinRoot
import Mathlib.RingTheory.QuotientNilpotent
import Mathlib.RingTheory.TensorProduct.Basic
-- Porting note: added to make the syntax work below.
open scoped TensorProduct
universe u
namespace Algebra
section
variable (R : Type u) [CommSemiring R]
variable (A : Type u) [Semiring A] [Algebra R A]
@[mk_iff]
class FormallyUnramified : Prop where
comp_injective :
∀ ⦃B : Type u⦄ [CommRing B],
∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥),
Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I)
#align algebra.formally_unramified Algebra.FormallyUnramified
end
namespace FormallyUnramified
section
variable {R : Type u} [CommSemiring R]
variable {A : Type u} [Semiring A] [Algebra R A]
variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B)
theorem lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B]
[FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B)
(h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by
revert g₁ g₂
change Function.Injective (Ideal.Quotient.mkₐ R I).comp
revert _RB
apply Ideal.IsNilpotent.induction_on (R := B) I hI
· intro B _ I hI _; exact FormallyUnramified.comp_injective I hI
· intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e
apply h₁
apply h₂
ext x
replace e := AlgHom.congr_fun e x
dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢
rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq]
#align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique
theorem ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B}
(H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ :=
FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H)
#align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext
theorem lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C]
(f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B)
(h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ :=
FormallyUnramified.lift_unique _ hf _ _
(by
ext x
have := RingHom.congr_fun h x
simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk,
RingHom.mem_ker, map_sub, sub_eq_zero])
#align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom
theorem ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C)
(hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) :
g₁ = g₂ :=
FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h)
#align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext'
theorem lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C]
[Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C))
(g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ :=
FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h)
#align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique'
end
section Comp
variable (R : Type u) [CommSemiring R]
variable (A : Type u) [CommSemiring A] [Algebra R A]
variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B]
| Mathlib/RingTheory/Unramified/Basic.lean | 139 | 152 | theorem comp [FormallyUnramified R A] [FormallyUnramified A B] :
FormallyUnramified R B := by |
constructor
intro C _ _ I hI f₁ f₂ e
have e' :=
FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B)
(f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc])
letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra
let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl }
let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm }
ext1 x
change F₁ x = F₂ x
congr
exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e)
| 1,723 |
import Mathlib.RingTheory.FinitePresentation
import Mathlib.RingTheory.Localization.Away.Basic
import Mathlib.RingTheory.Localization.Away.AdjoinRoot
import Mathlib.RingTheory.QuotientNilpotent
import Mathlib.RingTheory.TensorProduct.Basic
-- Porting note: added to make the syntax work below.
open scoped TensorProduct
universe u
namespace Algebra
section
variable (R : Type u) [CommSemiring R]
variable (A : Type u) [Semiring A] [Algebra R A]
@[mk_iff]
class FormallyUnramified : Prop where
comp_injective :
∀ ⦃B : Type u⦄ [CommRing B],
∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥),
Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I)
#align algebra.formally_unramified Algebra.FormallyUnramified
end
namespace FormallyUnramified
section
variable {R : Type u} [CommSemiring R]
variable {A : Type u} [Semiring A] [Algebra R A]
variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B)
theorem lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B]
[FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B)
(h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by
revert g₁ g₂
change Function.Injective (Ideal.Quotient.mkₐ R I).comp
revert _RB
apply Ideal.IsNilpotent.induction_on (R := B) I hI
· intro B _ I hI _; exact FormallyUnramified.comp_injective I hI
· intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e
apply h₁
apply h₂
ext x
replace e := AlgHom.congr_fun e x
dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢
rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq]
#align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique
theorem ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B}
(H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ :=
FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H)
#align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext
theorem lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C]
(f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B)
(h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ :=
FormallyUnramified.lift_unique _ hf _ _
(by
ext x
have := RingHom.congr_fun h x
simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk,
RingHom.mem_ker, map_sub, sub_eq_zero])
#align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom
theorem ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C)
(hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) :
g₁ = g₂ :=
FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h)
#align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext'
theorem lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C]
[Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C))
(g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ :=
FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h)
#align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique'
end
section Comp
variable (R : Type u) [CommSemiring R]
variable (A : Type u) [CommSemiring A] [Algebra R A]
variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B]
theorem comp [FormallyUnramified R A] [FormallyUnramified A B] :
FormallyUnramified R B := by
constructor
intro C _ _ I hI f₁ f₂ e
have e' :=
FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B)
(f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc])
letI := (f₁.comp (IsScalarTower.toAlgHom R A B)).toRingHom.toAlgebra
let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl }
let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm }
ext1 x
change F₁ x = F₂ x
congr
exact FormallyUnramified.ext I ⟨2, hI⟩ (AlgHom.congr_fun e)
#align algebra.formally_unramified.comp Algebra.FormallyUnramified.comp
| Mathlib/RingTheory/Unramified/Basic.lean | 155 | 163 | theorem of_comp [FormallyUnramified R B] : FormallyUnramified A B := by |
constructor
intro Q _ _ I e f₁ f₂ e'
letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra
letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl
refine AlgHom.restrictScalars_injective R ?_
refine FormallyUnramified.ext I ⟨2, e⟩ ?_
intro x
exact AlgHom.congr_fun e' x
| 1,723 |
import Mathlib.RingTheory.FinitePresentation
import Mathlib.RingTheory.Localization.Away.Basic
import Mathlib.RingTheory.Localization.Away.AdjoinRoot
import Mathlib.RingTheory.QuotientNilpotent
import Mathlib.RingTheory.TensorProduct.Basic
-- Porting note: added to make the syntax work below.
open scoped TensorProduct
universe u
namespace Algebra
section
variable (R : Type u) [CommSemiring R]
variable (A : Type u) [Semiring A] [Algebra R A]
@[mk_iff]
class FormallyUnramified : Prop where
comp_injective :
∀ ⦃B : Type u⦄ [CommRing B],
∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥),
Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I)
#align algebra.formally_unramified Algebra.FormallyUnramified
end
namespace FormallyUnramified
section
variable {R : Type u} [CommSemiring R]
variable {A : Type u} [Semiring A] [Algebra R A]
variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B)
theorem lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B]
[FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B)
(h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂ := by
revert g₁ g₂
change Function.Injective (Ideal.Quotient.mkₐ R I).comp
revert _RB
apply Ideal.IsNilpotent.induction_on (R := B) I hI
· intro B _ I hI _; exact FormallyUnramified.comp_injective I hI
· intro B _ I J hIJ h₁ h₂ _ g₁ g₂ e
apply h₁
apply h₂
ext x
replace e := AlgHom.congr_fun e x
dsimp only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk] at e ⊢
rwa [Ideal.Quotient.eq, ← map_sub, Ideal.mem_quotient_iff_mem hIJ, ← Ideal.Quotient.eq]
#align algebra.formally_unramified.lift_unique Algebra.FormallyUnramified.lift_unique
theorem ext [FormallyUnramified R A] (hI : IsNilpotent I) {g₁ g₂ : A →ₐ[R] B}
(H : ∀ x, Ideal.Quotient.mk I (g₁ x) = Ideal.Quotient.mk I (g₂ x)) : g₁ = g₂ :=
FormallyUnramified.lift_unique I hI g₁ g₂ (AlgHom.ext H)
#align algebra.formally_unramified.ext Algebra.FormallyUnramified.ext
theorem lift_unique_of_ringHom [FormallyUnramified R A] {C : Type u} [CommRing C]
(f : B →+* C) (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B)
(h : f.comp ↑g₁ = f.comp (g₂ : A →+* B)) : g₁ = g₂ :=
FormallyUnramified.lift_unique _ hf _ _
(by
ext x
have := RingHom.congr_fun h x
simpa only [Ideal.Quotient.eq, Function.comp_apply, AlgHom.coe_comp, Ideal.Quotient.mkₐ_eq_mk,
RingHom.mem_ker, map_sub, sub_eq_zero])
#align algebra.formally_unramified.lift_unique_of_ring_hom Algebra.FormallyUnramified.lift_unique_of_ringHom
theorem ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C)
(hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) :
g₁ = g₂ :=
FormallyUnramified.lift_unique_of_ringHom f hf g₁ g₂ (RingHom.ext h)
#align algebra.formally_unramified.ext' Algebra.FormallyUnramified.ext'
theorem lift_unique' [FormallyUnramified R A] {C : Type u} [CommRing C]
[Algebra R C] (f : B →ₐ[R] C) (hf : IsNilpotent <| RingHom.ker (f : B →+* C))
(g₁ g₂ : A →ₐ[R] B) (h : f.comp g₁ = f.comp g₂) : g₁ = g₂ :=
FormallyUnramified.ext' _ hf g₁ g₂ (AlgHom.congr_fun h)
#align algebra.formally_unramified.lift_unique' Algebra.FormallyUnramified.lift_unique'
end
section Localization
variable {R S Rₘ Sₘ : Type u} [CommRing R] [CommRing S] [CommRing Rₘ] [CommRing Sₘ]
variable (M : Submonoid R)
variable [Algebra R S] [Algebra R Sₘ] [Algebra S Sₘ] [Algebra R Rₘ] [Algebra Rₘ Sₘ]
variable [IsScalarTower R Rₘ Sₘ] [IsScalarTower R S Sₘ]
variable [IsLocalization M Rₘ] [IsLocalization (M.map (algebraMap R S)) Sₘ]
-- Porting note: no longer supported
-- attribute [local elab_as_elim] Ideal.IsNilpotent.induction_on
| Mathlib/RingTheory/Unramified/Basic.lean | 201 | 207 | theorem of_isLocalization : FormallyUnramified R Rₘ := by |
constructor
intro Q _ _ I _ f₁ f₂ _
apply AlgHom.coe_ringHom_injective
refine IsLocalization.ringHom_ext M ?_
ext
simp
| 1,723 |
import Mathlib.RingTheory.TensorProduct.Basic
import Mathlib.Algebra.Module.ULift
#align_import ring_theory.is_tensor_product from "leanprover-community/mathlib"@"c4926d76bb9c5a4a62ed2f03d998081786132105"
universe u v₁ v₂ v₃ v₄
open TensorProduct
section IsTensorProduct
variable {R : Type*} [CommSemiring R]
variable {M₁ M₂ M M' : Type*}
variable [AddCommMonoid M₁] [AddCommMonoid M₂] [AddCommMonoid M] [AddCommMonoid M']
variable [Module R M₁] [Module R M₂] [Module R M] [Module R M']
variable (f : M₁ →ₗ[R] M₂ →ₗ[R] M)
variable {N₁ N₂ N : Type*} [AddCommMonoid N₁] [AddCommMonoid N₂] [AddCommMonoid N]
variable [Module R N₁] [Module R N₂] [Module R N]
variable {g : N₁ →ₗ[R] N₂ →ₗ[R] N}
def IsTensorProduct : Prop :=
Function.Bijective (TensorProduct.lift f)
#align is_tensor_product IsTensorProduct
variable (R M N) {f}
| Mathlib/RingTheory/IsTensorProduct.lean | 60 | 65 | theorem TensorProduct.isTensorProduct : IsTensorProduct (TensorProduct.mk R M N) := by |
delta IsTensorProduct
convert_to Function.Bijective (LinearMap.id : M ⊗[R] N →ₗ[R] M ⊗[R] N) using 2
· apply TensorProduct.ext'
simp
· exact Function.bijective_id
| 1,724 |
import Mathlib.RingTheory.TensorProduct.Basic
import Mathlib.Algebra.Module.ULift
#align_import ring_theory.is_tensor_product from "leanprover-community/mathlib"@"c4926d76bb9c5a4a62ed2f03d998081786132105"
universe u v₁ v₂ v₃ v₄
open TensorProduct
section IsTensorProduct
variable {R : Type*} [CommSemiring R]
variable {M₁ M₂ M M' : Type*}
variable [AddCommMonoid M₁] [AddCommMonoid M₂] [AddCommMonoid M] [AddCommMonoid M']
variable [Module R M₁] [Module R M₂] [Module R M] [Module R M']
variable (f : M₁ →ₗ[R] M₂ →ₗ[R] M)
variable {N₁ N₂ N : Type*} [AddCommMonoid N₁] [AddCommMonoid N₂] [AddCommMonoid N]
variable [Module R N₁] [Module R N₂] [Module R N]
variable {g : N₁ →ₗ[R] N₂ →ₗ[R] N}
def IsTensorProduct : Prop :=
Function.Bijective (TensorProduct.lift f)
#align is_tensor_product IsTensorProduct
variable (R M N) {f}
theorem TensorProduct.isTensorProduct : IsTensorProduct (TensorProduct.mk R M N) := by
delta IsTensorProduct
convert_to Function.Bijective (LinearMap.id : M ⊗[R] N →ₗ[R] M ⊗[R] N) using 2
· apply TensorProduct.ext'
simp
· exact Function.bijective_id
#align tensor_product.is_tensor_product TensorProduct.isTensorProduct
variable {R M N}
@[simps! apply]
noncomputable def IsTensorProduct.equiv (h : IsTensorProduct f) : M₁ ⊗[R] M₂ ≃ₗ[R] M :=
LinearEquiv.ofBijective _ h
#align is_tensor_product.equiv IsTensorProduct.equiv
@[simp]
theorem IsTensorProduct.equiv_toLinearMap (h : IsTensorProduct f) :
h.equiv.toLinearMap = TensorProduct.lift f :=
rfl
#align is_tensor_product.equiv_to_linear_map IsTensorProduct.equiv_toLinearMap
@[simp]
| Mathlib/RingTheory/IsTensorProduct.lean | 83 | 87 | theorem IsTensorProduct.equiv_symm_apply (h : IsTensorProduct f) (x₁ : M₁) (x₂ : M₂) :
h.equiv.symm (f x₁ x₂) = x₁ ⊗ₜ x₂ := by |
apply h.equiv.injective
refine (h.equiv.apply_symm_apply _).trans ?_
simp
| 1,724 |
import Mathlib.RingTheory.TensorProduct.Basic
import Mathlib.Algebra.Module.ULift
#align_import ring_theory.is_tensor_product from "leanprover-community/mathlib"@"c4926d76bb9c5a4a62ed2f03d998081786132105"
universe u v₁ v₂ v₃ v₄
open TensorProduct
section IsTensorProduct
variable {R : Type*} [CommSemiring R]
variable {M₁ M₂ M M' : Type*}
variable [AddCommMonoid M₁] [AddCommMonoid M₂] [AddCommMonoid M] [AddCommMonoid M']
variable [Module R M₁] [Module R M₂] [Module R M] [Module R M']
variable (f : M₁ →ₗ[R] M₂ →ₗ[R] M)
variable {N₁ N₂ N : Type*} [AddCommMonoid N₁] [AddCommMonoid N₂] [AddCommMonoid N]
variable [Module R N₁] [Module R N₂] [Module R N]
variable {g : N₁ →ₗ[R] N₂ →ₗ[R] N}
def IsTensorProduct : Prop :=
Function.Bijective (TensorProduct.lift f)
#align is_tensor_product IsTensorProduct
variable (R M N) {f}
theorem TensorProduct.isTensorProduct : IsTensorProduct (TensorProduct.mk R M N) := by
delta IsTensorProduct
convert_to Function.Bijective (LinearMap.id : M ⊗[R] N →ₗ[R] M ⊗[R] N) using 2
· apply TensorProduct.ext'
simp
· exact Function.bijective_id
#align tensor_product.is_tensor_product TensorProduct.isTensorProduct
variable {R M N}
@[simps! apply]
noncomputable def IsTensorProduct.equiv (h : IsTensorProduct f) : M₁ ⊗[R] M₂ ≃ₗ[R] M :=
LinearEquiv.ofBijective _ h
#align is_tensor_product.equiv IsTensorProduct.equiv
@[simp]
theorem IsTensorProduct.equiv_toLinearMap (h : IsTensorProduct f) :
h.equiv.toLinearMap = TensorProduct.lift f :=
rfl
#align is_tensor_product.equiv_to_linear_map IsTensorProduct.equiv_toLinearMap
@[simp]
theorem IsTensorProduct.equiv_symm_apply (h : IsTensorProduct f) (x₁ : M₁) (x₂ : M₂) :
h.equiv.symm (f x₁ x₂) = x₁ ⊗ₜ x₂ := by
apply h.equiv.injective
refine (h.equiv.apply_symm_apply _).trans ?_
simp
#align is_tensor_product.equiv_symm_apply IsTensorProduct.equiv_symm_apply
noncomputable def IsTensorProduct.lift (h : IsTensorProduct f) (f' : M₁ →ₗ[R] M₂ →ₗ[R] M') :
M →ₗ[R] M' :=
(TensorProduct.lift f').comp h.equiv.symm.toLinearMap
#align is_tensor_product.lift IsTensorProduct.lift
| Mathlib/RingTheory/IsTensorProduct.lean | 97 | 100 | theorem IsTensorProduct.lift_eq (h : IsTensorProduct f) (f' : M₁ →ₗ[R] M₂ →ₗ[R] M') (x₁ : M₁)
(x₂ : M₂) : h.lift f' (f x₁ x₂) = f' x₁ x₂ := by |
delta IsTensorProduct.lift
simp
| 1,724 |
import Mathlib.RingTheory.TensorProduct.Basic
import Mathlib.Algebra.Module.ULift
#align_import ring_theory.is_tensor_product from "leanprover-community/mathlib"@"c4926d76bb9c5a4a62ed2f03d998081786132105"
universe u v₁ v₂ v₃ v₄
open TensorProduct
section IsTensorProduct
variable {R : Type*} [CommSemiring R]
variable {M₁ M₂ M M' : Type*}
variable [AddCommMonoid M₁] [AddCommMonoid M₂] [AddCommMonoid M] [AddCommMonoid M']
variable [Module R M₁] [Module R M₂] [Module R M] [Module R M']
variable (f : M₁ →ₗ[R] M₂ →ₗ[R] M)
variable {N₁ N₂ N : Type*} [AddCommMonoid N₁] [AddCommMonoid N₂] [AddCommMonoid N]
variable [Module R N₁] [Module R N₂] [Module R N]
variable {g : N₁ →ₗ[R] N₂ →ₗ[R] N}
def IsTensorProduct : Prop :=
Function.Bijective (TensorProduct.lift f)
#align is_tensor_product IsTensorProduct
variable (R M N) {f}
theorem TensorProduct.isTensorProduct : IsTensorProduct (TensorProduct.mk R M N) := by
delta IsTensorProduct
convert_to Function.Bijective (LinearMap.id : M ⊗[R] N →ₗ[R] M ⊗[R] N) using 2
· apply TensorProduct.ext'
simp
· exact Function.bijective_id
#align tensor_product.is_tensor_product TensorProduct.isTensorProduct
variable {R M N}
@[simps! apply]
noncomputable def IsTensorProduct.equiv (h : IsTensorProduct f) : M₁ ⊗[R] M₂ ≃ₗ[R] M :=
LinearEquiv.ofBijective _ h
#align is_tensor_product.equiv IsTensorProduct.equiv
@[simp]
theorem IsTensorProduct.equiv_toLinearMap (h : IsTensorProduct f) :
h.equiv.toLinearMap = TensorProduct.lift f :=
rfl
#align is_tensor_product.equiv_to_linear_map IsTensorProduct.equiv_toLinearMap
@[simp]
theorem IsTensorProduct.equiv_symm_apply (h : IsTensorProduct f) (x₁ : M₁) (x₂ : M₂) :
h.equiv.symm (f x₁ x₂) = x₁ ⊗ₜ x₂ := by
apply h.equiv.injective
refine (h.equiv.apply_symm_apply _).trans ?_
simp
#align is_tensor_product.equiv_symm_apply IsTensorProduct.equiv_symm_apply
noncomputable def IsTensorProduct.lift (h : IsTensorProduct f) (f' : M₁ →ₗ[R] M₂ →ₗ[R] M') :
M →ₗ[R] M' :=
(TensorProduct.lift f').comp h.equiv.symm.toLinearMap
#align is_tensor_product.lift IsTensorProduct.lift
theorem IsTensorProduct.lift_eq (h : IsTensorProduct f) (f' : M₁ →ₗ[R] M₂ →ₗ[R] M') (x₁ : M₁)
(x₂ : M₂) : h.lift f' (f x₁ x₂) = f' x₁ x₂ := by
delta IsTensorProduct.lift
simp
#align is_tensor_product.lift_eq IsTensorProduct.lift_eq
noncomputable def IsTensorProduct.map (hf : IsTensorProduct f) (hg : IsTensorProduct g)
(i₁ : M₁ →ₗ[R] N₁) (i₂ : M₂ →ₗ[R] N₂) : M →ₗ[R] N :=
hg.equiv.toLinearMap.comp ((TensorProduct.map i₁ i₂).comp hf.equiv.symm.toLinearMap)
#align is_tensor_product.map IsTensorProduct.map
| Mathlib/RingTheory/IsTensorProduct.lean | 109 | 112 | theorem IsTensorProduct.map_eq (hf : IsTensorProduct f) (hg : IsTensorProduct g) (i₁ : M₁ →ₗ[R] N₁)
(i₂ : M₂ →ₗ[R] N₂) (x₁ : M₁) (x₂ : M₂) : hf.map hg i₁ i₂ (f x₁ x₂) = g (i₁ x₁) (i₂ x₂) := by |
delta IsTensorProduct.map
simp
| 1,724 |
import Mathlib.RingTheory.TensorProduct.Basic
import Mathlib.Algebra.Module.ULift
#align_import ring_theory.is_tensor_product from "leanprover-community/mathlib"@"c4926d76bb9c5a4a62ed2f03d998081786132105"
universe u v₁ v₂ v₃ v₄
open TensorProduct
section IsTensorProduct
variable {R : Type*} [CommSemiring R]
variable {M₁ M₂ M M' : Type*}
variable [AddCommMonoid M₁] [AddCommMonoid M₂] [AddCommMonoid M] [AddCommMonoid M']
variable [Module R M₁] [Module R M₂] [Module R M] [Module R M']
variable (f : M₁ →ₗ[R] M₂ →ₗ[R] M)
variable {N₁ N₂ N : Type*} [AddCommMonoid N₁] [AddCommMonoid N₂] [AddCommMonoid N]
variable [Module R N₁] [Module R N₂] [Module R N]
variable {g : N₁ →ₗ[R] N₂ →ₗ[R] N}
def IsTensorProduct : Prop :=
Function.Bijective (TensorProduct.lift f)
#align is_tensor_product IsTensorProduct
variable (R M N) {f}
theorem TensorProduct.isTensorProduct : IsTensorProduct (TensorProduct.mk R M N) := by
delta IsTensorProduct
convert_to Function.Bijective (LinearMap.id : M ⊗[R] N →ₗ[R] M ⊗[R] N) using 2
· apply TensorProduct.ext'
simp
· exact Function.bijective_id
#align tensor_product.is_tensor_product TensorProduct.isTensorProduct
variable {R M N}
@[simps! apply]
noncomputable def IsTensorProduct.equiv (h : IsTensorProduct f) : M₁ ⊗[R] M₂ ≃ₗ[R] M :=
LinearEquiv.ofBijective _ h
#align is_tensor_product.equiv IsTensorProduct.equiv
@[simp]
theorem IsTensorProduct.equiv_toLinearMap (h : IsTensorProduct f) :
h.equiv.toLinearMap = TensorProduct.lift f :=
rfl
#align is_tensor_product.equiv_to_linear_map IsTensorProduct.equiv_toLinearMap
@[simp]
theorem IsTensorProduct.equiv_symm_apply (h : IsTensorProduct f) (x₁ : M₁) (x₂ : M₂) :
h.equiv.symm (f x₁ x₂) = x₁ ⊗ₜ x₂ := by
apply h.equiv.injective
refine (h.equiv.apply_symm_apply _).trans ?_
simp
#align is_tensor_product.equiv_symm_apply IsTensorProduct.equiv_symm_apply
noncomputable def IsTensorProduct.lift (h : IsTensorProduct f) (f' : M₁ →ₗ[R] M₂ →ₗ[R] M') :
M →ₗ[R] M' :=
(TensorProduct.lift f').comp h.equiv.symm.toLinearMap
#align is_tensor_product.lift IsTensorProduct.lift
theorem IsTensorProduct.lift_eq (h : IsTensorProduct f) (f' : M₁ →ₗ[R] M₂ →ₗ[R] M') (x₁ : M₁)
(x₂ : M₂) : h.lift f' (f x₁ x₂) = f' x₁ x₂ := by
delta IsTensorProduct.lift
simp
#align is_tensor_product.lift_eq IsTensorProduct.lift_eq
noncomputable def IsTensorProduct.map (hf : IsTensorProduct f) (hg : IsTensorProduct g)
(i₁ : M₁ →ₗ[R] N₁) (i₂ : M₂ →ₗ[R] N₂) : M →ₗ[R] N :=
hg.equiv.toLinearMap.comp ((TensorProduct.map i₁ i₂).comp hf.equiv.symm.toLinearMap)
#align is_tensor_product.map IsTensorProduct.map
theorem IsTensorProduct.map_eq (hf : IsTensorProduct f) (hg : IsTensorProduct g) (i₁ : M₁ →ₗ[R] N₁)
(i₂ : M₂ →ₗ[R] N₂) (x₁ : M₁) (x₂ : M₂) : hf.map hg i₁ i₂ (f x₁ x₂) = g (i₁ x₁) (i₂ x₂) := by
delta IsTensorProduct.map
simp
#align is_tensor_product.map_eq IsTensorProduct.map_eq
| Mathlib/RingTheory/IsTensorProduct.lean | 115 | 127 | theorem IsTensorProduct.inductionOn (h : IsTensorProduct f) {C : M → Prop} (m : M) (h0 : C 0)
(htmul : ∀ x y, C (f x y)) (hadd : ∀ x y, C x → C y → C (x + y)) : C m := by |
rw [← h.equiv.right_inv m]
generalize h.equiv.invFun m = y
change C (TensorProduct.lift f y)
induction y using TensorProduct.induction_on with
| zero => rwa [map_zero]
| tmul _ _ =>
rw [TensorProduct.lift.tmul]
apply htmul
| add _ _ _ _ =>
rw [map_add]
apply hadd <;> assumption
| 1,724 |
import Mathlib.Algebra.Category.Ring.Constructions
import Mathlib.Algebra.Category.Ring.Colimits
import Mathlib.CategoryTheory.Iso
import Mathlib.RingTheory.Localization.Away.Basic
import Mathlib.RingTheory.IsTensorProduct
#align_import ring_theory.ring_hom_properties from "leanprover-community/mathlib"@"a7c017d750512a352b623b1824d75da5998457d0"
universe u
open CategoryTheory Opposite CategoryTheory.Limits
namespace RingHom
-- Porting Note: Deleted variable `f` here, since it wasn't used explicitly
variable (P : ∀ {R S : Type u} [CommRing R] [CommRing S] (_ : R →+* S), Prop)
section RespectsIso
def RespectsIso : Prop :=
(∀ {R S T : Type u} [CommRing R] [CommRing S] [CommRing T],
∀ (f : R →+* S) (e : S ≃+* T) (_ : P f), P (e.toRingHom.comp f)) ∧
∀ {R S T : Type u} [CommRing R] [CommRing S] [CommRing T],
∀ (f : S →+* T) (e : R ≃+* S) (_ : P f), P (f.comp e.toRingHom)
#align ring_hom.respects_iso RingHom.RespectsIso
variable {P}
theorem RespectsIso.cancel_left_isIso (hP : RespectsIso @P) {R S T : CommRingCat} (f : R ⟶ S)
(g : S ⟶ T) [IsIso f] : P (f ≫ g) ↔ P g :=
⟨fun H => by
convert hP.2 (f ≫ g) (asIso f).symm.commRingCatIsoToRingEquiv H
exact (IsIso.inv_hom_id_assoc _ _).symm, hP.2 g (asIso f).commRingCatIsoToRingEquiv⟩
#align ring_hom.respects_iso.cancel_left_is_iso RingHom.RespectsIso.cancel_left_isIso
theorem RespectsIso.cancel_right_isIso (hP : RespectsIso @P) {R S T : CommRingCat} (f : R ⟶ S)
(g : S ⟶ T) [IsIso g] : P (f ≫ g) ↔ P f :=
⟨fun H => by
convert hP.1 (f ≫ g) (asIso g).symm.commRingCatIsoToRingEquiv H
change f = f ≫ g ≫ inv g
simp, hP.1 f (asIso g).commRingCatIsoToRingEquiv⟩
#align ring_hom.respects_iso.cancel_right_is_iso RingHom.RespectsIso.cancel_right_isIso
| Mathlib/RingTheory/RingHomProperties.lean | 65 | 91 | theorem RespectsIso.is_localization_away_iff (hP : RingHom.RespectsIso @P) {R S : Type u}
(R' S' : Type u) [CommRing R] [CommRing S] [CommRing R'] [CommRing S'] [Algebra R R']
[Algebra S S'] (f : R →+* S) (r : R) [IsLocalization.Away r R'] [IsLocalization.Away (f r) S'] :
P (Localization.awayMap f r) ↔ P (IsLocalization.Away.map R' S' f r) := by |
let e₁ : R' ≃+* Localization.Away r :=
(IsLocalization.algEquiv (Submonoid.powers r) _ _).toRingEquiv
let e₂ : Localization.Away (f r) ≃+* S' :=
(IsLocalization.algEquiv (Submonoid.powers (f r)) _ _).toRingEquiv
refine (hP.cancel_left_isIso e₁.toCommRingCatIso.hom (CommRingCat.ofHom _)).symm.trans ?_
refine (hP.cancel_right_isIso (CommRingCat.ofHom _) e₂.toCommRingCatIso.hom).symm.trans ?_
rw [← eq_iff_iff]
congr 1
-- Porting note: Here, the proof used to have a huge `simp` involving `[anonymous]`, which didn't
-- work out anymore. The issue seemed to be that it couldn't handle a term in which Ring
-- homomorphisms were repeatedly casted to the bundled category and back. Here we resolve the
-- problem by converting the goal to a more straightforward form.
let e := (e₂ : Localization.Away (f r) →+* S').comp
(((IsLocalization.map (Localization.Away (f r)) f
(by rintro x ⟨n, rfl⟩; use n; simp : Submonoid.powers r ≤ Submonoid.comap f
(Submonoid.powers (f r)))) : Localization.Away r →+* Localization.Away (f r)).comp
(e₁: R' →+* Localization.Away r))
suffices e = IsLocalization.Away.map R' S' f r by
convert this
apply IsLocalization.ringHom_ext (Submonoid.powers r) _
ext1 x
dsimp [e, e₁, e₂, IsLocalization.Away.map]
simp only [IsLocalization.map_eq, id_apply, RingHomCompTriple.comp_apply]
| 1,725 |
import Mathlib.RingTheory.RingHomProperties
#align_import ring_theory.ring_hom.finite from "leanprover-community/mathlib"@"b5aecf07a179c60b6b37c1ac9da952f3b565c785"
namespace RingHom
open scoped TensorProduct
open TensorProduct Algebra.TensorProduct
| Mathlib/RingTheory/RingHom/Finite.lean | 23 | 25 | theorem finite_stableUnderComposition : StableUnderComposition @Finite := by |
introv R hf hg
exact hg.comp hf
| 1,726 |
import Mathlib.RingTheory.RingHomProperties
#align_import ring_theory.ring_hom.finite from "leanprover-community/mathlib"@"b5aecf07a179c60b6b37c1ac9da952f3b565c785"
namespace RingHom
open scoped TensorProduct
open TensorProduct Algebra.TensorProduct
theorem finite_stableUnderComposition : StableUnderComposition @Finite := by
introv R hf hg
exact hg.comp hf
#align ring_hom.finite_stable_under_composition RingHom.finite_stableUnderComposition
| Mathlib/RingTheory/RingHom/Finite.lean | 28 | 31 | theorem finite_respectsIso : RespectsIso @Finite := by |
apply finite_stableUnderComposition.respectsIso
intros
exact Finite.of_surjective _ (RingEquiv.toEquiv _).surjective
| 1,726 |
import Mathlib.RingTheory.RingHomProperties
#align_import ring_theory.ring_hom.finite from "leanprover-community/mathlib"@"b5aecf07a179c60b6b37c1ac9da952f3b565c785"
namespace RingHom
open scoped TensorProduct
open TensorProduct Algebra.TensorProduct
theorem finite_stableUnderComposition : StableUnderComposition @Finite := by
introv R hf hg
exact hg.comp hf
#align ring_hom.finite_stable_under_composition RingHom.finite_stableUnderComposition
theorem finite_respectsIso : RespectsIso @Finite := by
apply finite_stableUnderComposition.respectsIso
intros
exact Finite.of_surjective _ (RingEquiv.toEquiv _).surjective
#align ring_hom.finite_respects_iso RingHom.finite_respectsIso
| Mathlib/RingTheory/RingHom/Finite.lean | 34 | 42 | theorem finite_stableUnderBaseChange : StableUnderBaseChange @Finite := by |
refine StableUnderBaseChange.mk _ finite_respectsIso ?_
classical
introv h
replace h : Module.Finite R T := by
rw [RingHom.Finite] at h; convert h; ext; simp_rw [Algebra.smul_def]; rfl
suffices Module.Finite S (S ⊗[R] T) by
rw [RingHom.Finite]; convert this; congr; ext; simp_rw [Algebra.smul_def]; rfl
exact inferInstance
| 1,726 |
import Mathlib.RingTheory.RingHomProperties
import Mathlib.RingTheory.IntegralClosure
#align_import ring_theory.ring_hom.integral from "leanprover-community/mathlib"@"a7c017d750512a352b623b1824d75da5998457d0"
namespace RingHom
open scoped TensorProduct
open TensorProduct Algebra.TensorProduct
| Mathlib/RingTheory/RingHom/Integral.lean | 24 | 25 | theorem isIntegral_stableUnderComposition : StableUnderComposition fun f => f.IsIntegral := by |
introv R hf hg; exact hf.trans _ _ hg
| 1,727 |
import Mathlib.RingTheory.RingHomProperties
import Mathlib.RingTheory.IntegralClosure
#align_import ring_theory.ring_hom.integral from "leanprover-community/mathlib"@"a7c017d750512a352b623b1824d75da5998457d0"
namespace RingHom
open scoped TensorProduct
open TensorProduct Algebra.TensorProduct
theorem isIntegral_stableUnderComposition : StableUnderComposition fun f => f.IsIntegral := by
introv R hf hg; exact hf.trans _ _ hg
#align ring_hom.is_integral_stable_under_composition RingHom.isIntegral_stableUnderComposition
| Mathlib/RingTheory/RingHom/Integral.lean | 28 | 32 | theorem isIntegral_respectsIso : RespectsIso fun f => f.IsIntegral := by |
apply isIntegral_stableUnderComposition.respectsIso
introv x
rw [← e.apply_symm_apply x]
apply RingHom.isIntegralElem_map
| 1,727 |
import Mathlib.RingTheory.RingHomProperties
import Mathlib.RingTheory.IntegralClosure
#align_import ring_theory.ring_hom.integral from "leanprover-community/mathlib"@"a7c017d750512a352b623b1824d75da5998457d0"
namespace RingHom
open scoped TensorProduct
open TensorProduct Algebra.TensorProduct
theorem isIntegral_stableUnderComposition : StableUnderComposition fun f => f.IsIntegral := by
introv R hf hg; exact hf.trans _ _ hg
#align ring_hom.is_integral_stable_under_composition RingHom.isIntegral_stableUnderComposition
theorem isIntegral_respectsIso : RespectsIso fun f => f.IsIntegral := by
apply isIntegral_stableUnderComposition.respectsIso
introv x
rw [← e.apply_symm_apply x]
apply RingHom.isIntegralElem_map
#align ring_hom.is_integral_respects_iso RingHom.isIntegral_respectsIso
| Mathlib/RingTheory/RingHom/Integral.lean | 35 | 41 | theorem isIntegral_stableUnderBaseChange : StableUnderBaseChange fun f => f.IsIntegral := by |
refine StableUnderBaseChange.mk _ isIntegral_respectsIso ?_
introv h x
refine TensorProduct.induction_on x ?_ ?_ ?_
· apply isIntegral_zero
· intro x y; exact IsIntegral.tmul x (h y)
· intro x y hx hy; exact IsIntegral.add hx hy
| 1,727 |
import Mathlib.RingTheory.FiniteType
import Mathlib.RingTheory.Localization.AtPrime
import Mathlib.RingTheory.Localization.Away.Basic
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Nilpotent.Lemmas
import Mathlib.RingTheory.RingHomProperties
import Mathlib.Data.Set.Subsingleton
#align_import ring_theory.local_properties from "leanprover-community/mathlib"@"a7c017d750512a352b623b1824d75da5998457d0"
open scoped Pointwise Classical
universe u
variable {R S : Type u} [CommRing R] [CommRing S] (M : Submonoid R)
variable (N : Submonoid S) (R' S' : Type u) [CommRing R'] [CommRing S'] (f : R →+* S)
variable [Algebra R R'] [Algebra S S']
section Properties
section RingHom
variable (P : ∀ {R S : Type u} [CommRing R] [CommRing S] (_ : R →+* S), Prop)
def RingHom.LocalizationPreserves :=
∀ ⦃R S : Type u⦄ [CommRing R] [CommRing S] (f : R →+* S) (M : Submonoid R) (R' S' : Type u)
[CommRing R'] [CommRing S'] [Algebra R R'] [Algebra S S'] [IsLocalization M R']
[IsLocalization (M.map f) S'],
P f → P (IsLocalization.map S' f (Submonoid.le_comap_map M) : R' →+* S')
#align ring_hom.localization_preserves RingHom.LocalizationPreserves
def RingHom.OfLocalizationFiniteSpan :=
∀ ⦃R S : Type u⦄ [CommRing R] [CommRing S] (f : R →+* S) (s : Finset R)
(_ : Ideal.span (s : Set R) = ⊤) (_ : ∀ r : s, P (Localization.awayMap f r)), P f
#align ring_hom.of_localization_finite_span RingHom.OfLocalizationFiniteSpan
def RingHom.OfLocalizationSpan :=
∀ ⦃R S : Type u⦄ [CommRing R] [CommRing S] (f : R →+* S) (s : Set R) (_ : Ideal.span s = ⊤)
(_ : ∀ r : s, P (Localization.awayMap f r)), P f
#align ring_hom.of_localization_span RingHom.OfLocalizationSpan
def RingHom.HoldsForLocalizationAway : Prop :=
∀ ⦃R : Type u⦄ (S : Type u) [CommRing R] [CommRing S] [Algebra R S] (r : R)
[IsLocalization.Away r S], P (algebraMap R S)
#align ring_hom.holds_for_localization_away RingHom.HoldsForLocalizationAway
def RingHom.OfLocalizationFiniteSpanTarget : Prop :=
∀ ⦃R S : Type u⦄ [CommRing R] [CommRing S] (f : R →+* S) (s : Finset S)
(_ : Ideal.span (s : Set S) = ⊤)
(_ : ∀ r : s, P ((algebraMap S (Localization.Away (r : S))).comp f)), P f
#align ring_hom.of_localization_finite_span_target RingHom.OfLocalizationFiniteSpanTarget
def RingHom.OfLocalizationSpanTarget : Prop :=
∀ ⦃R S : Type u⦄ [CommRing R] [CommRing S] (f : R →+* S) (s : Set S) (_ : Ideal.span s = ⊤)
(_ : ∀ r : s, P ((algebraMap S (Localization.Away (r : S))).comp f)), P f
#align ring_hom.of_localization_span_target RingHom.OfLocalizationSpanTarget
def RingHom.OfLocalizationPrime : Prop :=
∀ ⦃R S : Type u⦄ [CommRing R] [CommRing S] (f : R →+* S),
(∀ (J : Ideal S) (_ : J.IsPrime), P (Localization.localRingHom _ J f rfl)) → P f
#align ring_hom.of_localization_prime RingHom.OfLocalizationPrime
structure RingHom.PropertyIsLocal : Prop where
LocalizationPreserves : RingHom.LocalizationPreserves @P
OfLocalizationSpanTarget : RingHom.OfLocalizationSpanTarget @P
StableUnderComposition : RingHom.StableUnderComposition @P
HoldsForLocalizationAway : RingHom.HoldsForLocalizationAway @P
#align ring_hom.property_is_local RingHom.PropertyIsLocal
| Mathlib/RingTheory/LocalProperties.lean | 153 | 163 | theorem RingHom.ofLocalizationSpan_iff_finite :
RingHom.OfLocalizationSpan @P ↔ RingHom.OfLocalizationFiniteSpan @P := by |
delta RingHom.OfLocalizationSpan RingHom.OfLocalizationFiniteSpan
apply forall₅_congr
-- TODO: Using `refine` here breaks `resetI`.
intros
constructor
· intro h s; exact h s
· intro h s hs hs'
obtain ⟨s', h₁, h₂⟩ := (Ideal.span_eq_top_iff_finite s).mp hs
exact h s' h₂ fun x => hs' ⟨_, h₁ x.prop⟩
| 1,728 |
import Mathlib.RingTheory.FiniteType
import Mathlib.RingTheory.Localization.AtPrime
import Mathlib.RingTheory.Localization.Away.Basic
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Nilpotent.Lemmas
import Mathlib.RingTheory.RingHomProperties
import Mathlib.Data.Set.Subsingleton
#align_import ring_theory.local_properties from "leanprover-community/mathlib"@"a7c017d750512a352b623b1824d75da5998457d0"
open scoped Pointwise Classical
universe u
variable {R S : Type u} [CommRing R] [CommRing S] (M : Submonoid R)
variable (N : Submonoid S) (R' S' : Type u) [CommRing R'] [CommRing S'] (f : R →+* S)
variable [Algebra R R'] [Algebra S S']
section Properties
section RingHom
variable (P : ∀ {R S : Type u} [CommRing R] [CommRing S] (_ : R →+* S), Prop)
def RingHom.LocalizationPreserves :=
∀ ⦃R S : Type u⦄ [CommRing R] [CommRing S] (f : R →+* S) (M : Submonoid R) (R' S' : Type u)
[CommRing R'] [CommRing S'] [Algebra R R'] [Algebra S S'] [IsLocalization M R']
[IsLocalization (M.map f) S'],
P f → P (IsLocalization.map S' f (Submonoid.le_comap_map M) : R' →+* S')
#align ring_hom.localization_preserves RingHom.LocalizationPreserves
def RingHom.OfLocalizationFiniteSpan :=
∀ ⦃R S : Type u⦄ [CommRing R] [CommRing S] (f : R →+* S) (s : Finset R)
(_ : Ideal.span (s : Set R) = ⊤) (_ : ∀ r : s, P (Localization.awayMap f r)), P f
#align ring_hom.of_localization_finite_span RingHom.OfLocalizationFiniteSpan
def RingHom.OfLocalizationSpan :=
∀ ⦃R S : Type u⦄ [CommRing R] [CommRing S] (f : R →+* S) (s : Set R) (_ : Ideal.span s = ⊤)
(_ : ∀ r : s, P (Localization.awayMap f r)), P f
#align ring_hom.of_localization_span RingHom.OfLocalizationSpan
def RingHom.HoldsForLocalizationAway : Prop :=
∀ ⦃R : Type u⦄ (S : Type u) [CommRing R] [CommRing S] [Algebra R S] (r : R)
[IsLocalization.Away r S], P (algebraMap R S)
#align ring_hom.holds_for_localization_away RingHom.HoldsForLocalizationAway
def RingHom.OfLocalizationFiniteSpanTarget : Prop :=
∀ ⦃R S : Type u⦄ [CommRing R] [CommRing S] (f : R →+* S) (s : Finset S)
(_ : Ideal.span (s : Set S) = ⊤)
(_ : ∀ r : s, P ((algebraMap S (Localization.Away (r : S))).comp f)), P f
#align ring_hom.of_localization_finite_span_target RingHom.OfLocalizationFiniteSpanTarget
def RingHom.OfLocalizationSpanTarget : Prop :=
∀ ⦃R S : Type u⦄ [CommRing R] [CommRing S] (f : R →+* S) (s : Set S) (_ : Ideal.span s = ⊤)
(_ : ∀ r : s, P ((algebraMap S (Localization.Away (r : S))).comp f)), P f
#align ring_hom.of_localization_span_target RingHom.OfLocalizationSpanTarget
def RingHom.OfLocalizationPrime : Prop :=
∀ ⦃R S : Type u⦄ [CommRing R] [CommRing S] (f : R →+* S),
(∀ (J : Ideal S) (_ : J.IsPrime), P (Localization.localRingHom _ J f rfl)) → P f
#align ring_hom.of_localization_prime RingHom.OfLocalizationPrime
structure RingHom.PropertyIsLocal : Prop where
LocalizationPreserves : RingHom.LocalizationPreserves @P
OfLocalizationSpanTarget : RingHom.OfLocalizationSpanTarget @P
StableUnderComposition : RingHom.StableUnderComposition @P
HoldsForLocalizationAway : RingHom.HoldsForLocalizationAway @P
#align ring_hom.property_is_local RingHom.PropertyIsLocal
theorem RingHom.ofLocalizationSpan_iff_finite :
RingHom.OfLocalizationSpan @P ↔ RingHom.OfLocalizationFiniteSpan @P := by
delta RingHom.OfLocalizationSpan RingHom.OfLocalizationFiniteSpan
apply forall₅_congr
-- TODO: Using `refine` here breaks `resetI`.
intros
constructor
· intro h s; exact h s
· intro h s hs hs'
obtain ⟨s', h₁, h₂⟩ := (Ideal.span_eq_top_iff_finite s).mp hs
exact h s' h₂ fun x => hs' ⟨_, h₁ x.prop⟩
#align ring_hom.of_localization_span_iff_finite RingHom.ofLocalizationSpan_iff_finite
| Mathlib/RingTheory/LocalProperties.lean | 166 | 176 | theorem RingHom.ofLocalizationSpanTarget_iff_finite :
RingHom.OfLocalizationSpanTarget @P ↔ RingHom.OfLocalizationFiniteSpanTarget @P := by |
delta RingHom.OfLocalizationSpanTarget RingHom.OfLocalizationFiniteSpanTarget
apply forall₅_congr
-- TODO: Using `refine` here breaks `resetI`.
intros
constructor
· intro h s; exact h s
· intro h s hs hs'
obtain ⟨s', h₁, h₂⟩ := (Ideal.span_eq_top_iff_finite s).mp hs
exact h s' h₂ fun x => hs' ⟨_, h₁ x.prop⟩
| 1,728 |
import Mathlib.RingTheory.FiniteType
import Mathlib.RingTheory.Localization.AtPrime
import Mathlib.RingTheory.Localization.Away.Basic
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Nilpotent.Lemmas
import Mathlib.RingTheory.RingHomProperties
import Mathlib.Data.Set.Subsingleton
#align_import ring_theory.local_properties from "leanprover-community/mathlib"@"a7c017d750512a352b623b1824d75da5998457d0"
open scoped Pointwise Classical
universe u
variable {R S : Type u} [CommRing R] [CommRing S] (M : Submonoid R)
variable (N : Submonoid S) (R' S' : Type u) [CommRing R'] [CommRing S'] (f : R →+* S)
variable [Algebra R R'] [Algebra S S']
section Properties
section RingHom
variable (P : ∀ {R S : Type u} [CommRing R] [CommRing S] (_ : R →+* S), Prop)
def RingHom.LocalizationPreserves :=
∀ ⦃R S : Type u⦄ [CommRing R] [CommRing S] (f : R →+* S) (M : Submonoid R) (R' S' : Type u)
[CommRing R'] [CommRing S'] [Algebra R R'] [Algebra S S'] [IsLocalization M R']
[IsLocalization (M.map f) S'],
P f → P (IsLocalization.map S' f (Submonoid.le_comap_map M) : R' →+* S')
#align ring_hom.localization_preserves RingHom.LocalizationPreserves
def RingHom.OfLocalizationFiniteSpan :=
∀ ⦃R S : Type u⦄ [CommRing R] [CommRing S] (f : R →+* S) (s : Finset R)
(_ : Ideal.span (s : Set R) = ⊤) (_ : ∀ r : s, P (Localization.awayMap f r)), P f
#align ring_hom.of_localization_finite_span RingHom.OfLocalizationFiniteSpan
def RingHom.OfLocalizationSpan :=
∀ ⦃R S : Type u⦄ [CommRing R] [CommRing S] (f : R →+* S) (s : Set R) (_ : Ideal.span s = ⊤)
(_ : ∀ r : s, P (Localization.awayMap f r)), P f
#align ring_hom.of_localization_span RingHom.OfLocalizationSpan
def RingHom.HoldsForLocalizationAway : Prop :=
∀ ⦃R : Type u⦄ (S : Type u) [CommRing R] [CommRing S] [Algebra R S] (r : R)
[IsLocalization.Away r S], P (algebraMap R S)
#align ring_hom.holds_for_localization_away RingHom.HoldsForLocalizationAway
def RingHom.OfLocalizationFiniteSpanTarget : Prop :=
∀ ⦃R S : Type u⦄ [CommRing R] [CommRing S] (f : R →+* S) (s : Finset S)
(_ : Ideal.span (s : Set S) = ⊤)
(_ : ∀ r : s, P ((algebraMap S (Localization.Away (r : S))).comp f)), P f
#align ring_hom.of_localization_finite_span_target RingHom.OfLocalizationFiniteSpanTarget
def RingHom.OfLocalizationSpanTarget : Prop :=
∀ ⦃R S : Type u⦄ [CommRing R] [CommRing S] (f : R →+* S) (s : Set S) (_ : Ideal.span s = ⊤)
(_ : ∀ r : s, P ((algebraMap S (Localization.Away (r : S))).comp f)), P f
#align ring_hom.of_localization_span_target RingHom.OfLocalizationSpanTarget
def RingHom.OfLocalizationPrime : Prop :=
∀ ⦃R S : Type u⦄ [CommRing R] [CommRing S] (f : R →+* S),
(∀ (J : Ideal S) (_ : J.IsPrime), P (Localization.localRingHom _ J f rfl)) → P f
#align ring_hom.of_localization_prime RingHom.OfLocalizationPrime
structure RingHom.PropertyIsLocal : Prop where
LocalizationPreserves : RingHom.LocalizationPreserves @P
OfLocalizationSpanTarget : RingHom.OfLocalizationSpanTarget @P
StableUnderComposition : RingHom.StableUnderComposition @P
HoldsForLocalizationAway : RingHom.HoldsForLocalizationAway @P
#align ring_hom.property_is_local RingHom.PropertyIsLocal
theorem RingHom.ofLocalizationSpan_iff_finite :
RingHom.OfLocalizationSpan @P ↔ RingHom.OfLocalizationFiniteSpan @P := by
delta RingHom.OfLocalizationSpan RingHom.OfLocalizationFiniteSpan
apply forall₅_congr
-- TODO: Using `refine` here breaks `resetI`.
intros
constructor
· intro h s; exact h s
· intro h s hs hs'
obtain ⟨s', h₁, h₂⟩ := (Ideal.span_eq_top_iff_finite s).mp hs
exact h s' h₂ fun x => hs' ⟨_, h₁ x.prop⟩
#align ring_hom.of_localization_span_iff_finite RingHom.ofLocalizationSpan_iff_finite
theorem RingHom.ofLocalizationSpanTarget_iff_finite :
RingHom.OfLocalizationSpanTarget @P ↔ RingHom.OfLocalizationFiniteSpanTarget @P := by
delta RingHom.OfLocalizationSpanTarget RingHom.OfLocalizationFiniteSpanTarget
apply forall₅_congr
-- TODO: Using `refine` here breaks `resetI`.
intros
constructor
· intro h s; exact h s
· intro h s hs hs'
obtain ⟨s', h₁, h₂⟩ := (Ideal.span_eq_top_iff_finite s).mp hs
exact h s' h₂ fun x => hs' ⟨_, h₁ x.prop⟩
#align ring_hom.of_localization_span_target_iff_finite RingHom.ofLocalizationSpanTarget_iff_finite
variable {P f R' S'}
| Mathlib/RingTheory/LocalProperties.lean | 181 | 189 | theorem RingHom.PropertyIsLocal.respectsIso (hP : RingHom.PropertyIsLocal @P) :
RingHom.RespectsIso @P := by |
apply hP.StableUnderComposition.respectsIso
introv
letI := e.toRingHom.toAlgebra
-- Porting note: was `apply_with hP.holds_for_localization_away { instances := ff }`
have : IsLocalization.Away (1 : R) S := by
apply IsLocalization.away_of_isUnit_of_bijective _ isUnit_one e.bijective
exact RingHom.PropertyIsLocal.HoldsForLocalizationAway hP S (1 : R)
| 1,728 |
import Mathlib.RingTheory.FiniteType
import Mathlib.RingTheory.Localization.AtPrime
import Mathlib.RingTheory.Localization.Away.Basic
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Nilpotent.Lemmas
import Mathlib.RingTheory.RingHomProperties
import Mathlib.Data.Set.Subsingleton
#align_import ring_theory.local_properties from "leanprover-community/mathlib"@"a7c017d750512a352b623b1824d75da5998457d0"
open scoped Pointwise Classical
universe u
variable {R S : Type u} [CommRing R] [CommRing S] (M : Submonoid R)
variable (N : Submonoid S) (R' S' : Type u) [CommRing R'] [CommRing S'] (f : R →+* S)
variable [Algebra R R'] [Algebra S S']
section Properties
section RingHom
variable (P : ∀ {R S : Type u} [CommRing R] [CommRing S] (_ : R →+* S), Prop)
def RingHom.LocalizationPreserves :=
∀ ⦃R S : Type u⦄ [CommRing R] [CommRing S] (f : R →+* S) (M : Submonoid R) (R' S' : Type u)
[CommRing R'] [CommRing S'] [Algebra R R'] [Algebra S S'] [IsLocalization M R']
[IsLocalization (M.map f) S'],
P f → P (IsLocalization.map S' f (Submonoid.le_comap_map M) : R' →+* S')
#align ring_hom.localization_preserves RingHom.LocalizationPreserves
def RingHom.OfLocalizationFiniteSpan :=
∀ ⦃R S : Type u⦄ [CommRing R] [CommRing S] (f : R →+* S) (s : Finset R)
(_ : Ideal.span (s : Set R) = ⊤) (_ : ∀ r : s, P (Localization.awayMap f r)), P f
#align ring_hom.of_localization_finite_span RingHom.OfLocalizationFiniteSpan
def RingHom.OfLocalizationSpan :=
∀ ⦃R S : Type u⦄ [CommRing R] [CommRing S] (f : R →+* S) (s : Set R) (_ : Ideal.span s = ⊤)
(_ : ∀ r : s, P (Localization.awayMap f r)), P f
#align ring_hom.of_localization_span RingHom.OfLocalizationSpan
def RingHom.HoldsForLocalizationAway : Prop :=
∀ ⦃R : Type u⦄ (S : Type u) [CommRing R] [CommRing S] [Algebra R S] (r : R)
[IsLocalization.Away r S], P (algebraMap R S)
#align ring_hom.holds_for_localization_away RingHom.HoldsForLocalizationAway
def RingHom.OfLocalizationFiniteSpanTarget : Prop :=
∀ ⦃R S : Type u⦄ [CommRing R] [CommRing S] (f : R →+* S) (s : Finset S)
(_ : Ideal.span (s : Set S) = ⊤)
(_ : ∀ r : s, P ((algebraMap S (Localization.Away (r : S))).comp f)), P f
#align ring_hom.of_localization_finite_span_target RingHom.OfLocalizationFiniteSpanTarget
def RingHom.OfLocalizationSpanTarget : Prop :=
∀ ⦃R S : Type u⦄ [CommRing R] [CommRing S] (f : R →+* S) (s : Set S) (_ : Ideal.span s = ⊤)
(_ : ∀ r : s, P ((algebraMap S (Localization.Away (r : S))).comp f)), P f
#align ring_hom.of_localization_span_target RingHom.OfLocalizationSpanTarget
def RingHom.OfLocalizationPrime : Prop :=
∀ ⦃R S : Type u⦄ [CommRing R] [CommRing S] (f : R →+* S),
(∀ (J : Ideal S) (_ : J.IsPrime), P (Localization.localRingHom _ J f rfl)) → P f
#align ring_hom.of_localization_prime RingHom.OfLocalizationPrime
structure RingHom.PropertyIsLocal : Prop where
LocalizationPreserves : RingHom.LocalizationPreserves @P
OfLocalizationSpanTarget : RingHom.OfLocalizationSpanTarget @P
StableUnderComposition : RingHom.StableUnderComposition @P
HoldsForLocalizationAway : RingHom.HoldsForLocalizationAway @P
#align ring_hom.property_is_local RingHom.PropertyIsLocal
theorem RingHom.ofLocalizationSpan_iff_finite :
RingHom.OfLocalizationSpan @P ↔ RingHom.OfLocalizationFiniteSpan @P := by
delta RingHom.OfLocalizationSpan RingHom.OfLocalizationFiniteSpan
apply forall₅_congr
-- TODO: Using `refine` here breaks `resetI`.
intros
constructor
· intro h s; exact h s
· intro h s hs hs'
obtain ⟨s', h₁, h₂⟩ := (Ideal.span_eq_top_iff_finite s).mp hs
exact h s' h₂ fun x => hs' ⟨_, h₁ x.prop⟩
#align ring_hom.of_localization_span_iff_finite RingHom.ofLocalizationSpan_iff_finite
theorem RingHom.ofLocalizationSpanTarget_iff_finite :
RingHom.OfLocalizationSpanTarget @P ↔ RingHom.OfLocalizationFiniteSpanTarget @P := by
delta RingHom.OfLocalizationSpanTarget RingHom.OfLocalizationFiniteSpanTarget
apply forall₅_congr
-- TODO: Using `refine` here breaks `resetI`.
intros
constructor
· intro h s; exact h s
· intro h s hs hs'
obtain ⟨s', h₁, h₂⟩ := (Ideal.span_eq_top_iff_finite s).mp hs
exact h s' h₂ fun x => hs' ⟨_, h₁ x.prop⟩
#align ring_hom.of_localization_span_target_iff_finite RingHom.ofLocalizationSpanTarget_iff_finite
variable {P f R' S'}
theorem RingHom.PropertyIsLocal.respectsIso (hP : RingHom.PropertyIsLocal @P) :
RingHom.RespectsIso @P := by
apply hP.StableUnderComposition.respectsIso
introv
letI := e.toRingHom.toAlgebra
-- Porting note: was `apply_with hP.holds_for_localization_away { instances := ff }`
have : IsLocalization.Away (1 : R) S := by
apply IsLocalization.away_of_isUnit_of_bijective _ isUnit_one e.bijective
exact RingHom.PropertyIsLocal.HoldsForLocalizationAway hP S (1 : R)
#align ring_hom.property_is_local.respects_iso RingHom.PropertyIsLocal.respectsIso
-- Almost all arguments are implicit since this is not intended to use mid-proof.
| Mathlib/RingTheory/LocalProperties.lean | 193 | 197 | theorem RingHom.LocalizationPreserves.away (H : RingHom.LocalizationPreserves @P) (r : R)
[IsLocalization.Away r R'] [IsLocalization.Away (f r) S'] (hf : P f) :
P (IsLocalization.Away.map R' S' f r) := by |
have : IsLocalization ((Submonoid.powers r).map f) S' := by rw [Submonoid.map_powers]; assumption
exact H f (Submonoid.powers r) R' S' hf
| 1,728 |
import Mathlib.RingTheory.FiniteType
import Mathlib.RingTheory.Localization.AtPrime
import Mathlib.RingTheory.Localization.Away.Basic
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Nilpotent.Lemmas
import Mathlib.RingTheory.RingHomProperties
import Mathlib.Data.Set.Subsingleton
#align_import ring_theory.local_properties from "leanprover-community/mathlib"@"a7c017d750512a352b623b1824d75da5998457d0"
open scoped Pointwise Classical
universe u
variable {R S : Type u} [CommRing R] [CommRing S] (M : Submonoid R)
variable (N : Submonoid S) (R' S' : Type u) [CommRing R'] [CommRing S'] (f : R →+* S)
variable [Algebra R R'] [Algebra S S']
section Properties
section Ideal
open scoped nonZeroDivisors
| Mathlib/RingTheory/LocalProperties.lean | 236 | 255 | theorem Ideal.le_of_localization_maximal {I J : Ideal R}
(h : ∀ (P : Ideal R) (hP : P.IsMaximal),
Ideal.map (algebraMap R (Localization.AtPrime P)) I ≤
Ideal.map (algebraMap R (Localization.AtPrime P)) J) :
I ≤ J := by |
intro x hx
suffices J.colon (Ideal.span {x}) = ⊤ by
simpa using Submodule.mem_colon.mp
(show (1 : R) ∈ J.colon (Ideal.span {x}) from this.symm ▸ Submodule.mem_top) x
(Ideal.mem_span_singleton_self x)
refine Not.imp_symm (J.colon (Ideal.span {x})).exists_le_maximal ?_
push_neg
intro P hP le
obtain ⟨⟨⟨a, ha⟩, ⟨s, hs⟩⟩, eq⟩ :=
(IsLocalization.mem_map_algebraMap_iff P.primeCompl _).mp (h P hP (Ideal.mem_map_of_mem _ hx))
rw [← _root_.map_mul, ← sub_eq_zero, ← map_sub] at eq
obtain ⟨⟨m, hm⟩, eq⟩ := (IsLocalization.map_eq_zero_iff P.primeCompl _ _).mp eq
refine hs ((hP.isPrime.mem_or_mem (le (Ideal.mem_colon_singleton.mpr ?_))).resolve_right hm)
simp only [Subtype.coe_mk, mul_sub, sub_eq_zero, mul_comm x s, mul_left_comm] at eq
simpa only [mul_assoc, eq] using J.mul_mem_left m ha
| 1,728 |
import Mathlib.RingTheory.FiniteType
import Mathlib.RingTheory.Localization.AtPrime
import Mathlib.RingTheory.Localization.Away.Basic
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Nilpotent.Lemmas
import Mathlib.RingTheory.RingHomProperties
import Mathlib.Data.Set.Subsingleton
#align_import ring_theory.local_properties from "leanprover-community/mathlib"@"a7c017d750512a352b623b1824d75da5998457d0"
open scoped Pointwise Classical
universe u
variable {R S : Type u} [CommRing R] [CommRing S] (M : Submonoid R)
variable (N : Submonoid S) (R' S' : Type u) [CommRing R'] [CommRing S'] (f : R →+* S)
variable [Algebra R R'] [Algebra S S']
section Properties
section Ideal
open scoped nonZeroDivisors
theorem Ideal.le_of_localization_maximal {I J : Ideal R}
(h : ∀ (P : Ideal R) (hP : P.IsMaximal),
Ideal.map (algebraMap R (Localization.AtPrime P)) I ≤
Ideal.map (algebraMap R (Localization.AtPrime P)) J) :
I ≤ J := by
intro x hx
suffices J.colon (Ideal.span {x}) = ⊤ by
simpa using Submodule.mem_colon.mp
(show (1 : R) ∈ J.colon (Ideal.span {x}) from this.symm ▸ Submodule.mem_top) x
(Ideal.mem_span_singleton_self x)
refine Not.imp_symm (J.colon (Ideal.span {x})).exists_le_maximal ?_
push_neg
intro P hP le
obtain ⟨⟨⟨a, ha⟩, ⟨s, hs⟩⟩, eq⟩ :=
(IsLocalization.mem_map_algebraMap_iff P.primeCompl _).mp (h P hP (Ideal.mem_map_of_mem _ hx))
rw [← _root_.map_mul, ← sub_eq_zero, ← map_sub] at eq
obtain ⟨⟨m, hm⟩, eq⟩ := (IsLocalization.map_eq_zero_iff P.primeCompl _ _).mp eq
refine hs ((hP.isPrime.mem_or_mem (le (Ideal.mem_colon_singleton.mpr ?_))).resolve_right hm)
simp only [Subtype.coe_mk, mul_sub, sub_eq_zero, mul_comm x s, mul_left_comm] at eq
simpa only [mul_assoc, eq] using J.mul_mem_left m ha
#align ideal.le_of_localization_maximal Ideal.le_of_localization_maximal
theorem Ideal.eq_of_localization_maximal {I J : Ideal R}
(h : ∀ (P : Ideal R) (_ : P.IsMaximal),
Ideal.map (algebraMap R (Localization.AtPrime P)) I =
Ideal.map (algebraMap R (Localization.AtPrime P)) J) :
I = J :=
le_antisymm (Ideal.le_of_localization_maximal fun P hP => (h P hP).le)
(Ideal.le_of_localization_maximal fun P hP => (h P hP).ge)
#align ideal.eq_of_localization_maximal Ideal.eq_of_localization_maximal
theorem ideal_eq_bot_of_localization' (I : Ideal R)
(h : ∀ (J : Ideal R) (hJ : J.IsMaximal),
Ideal.map (algebraMap R (Localization.AtPrime J)) I = ⊥) :
I = ⊥ :=
Ideal.eq_of_localization_maximal fun P hP => by simpa using h P hP
#align ideal_eq_bot_of_localization' ideal_eq_bot_of_localization'
-- TODO: This proof should work for all modules, once we have enough material on submodules of
-- localized modules.
theorem ideal_eq_bot_of_localization (I : Ideal R)
(h : ∀ (J : Ideal R) (hJ : J.IsMaximal),
IsLocalization.coeSubmodule (Localization.AtPrime J) I = ⊥) :
I = ⊥ :=
ideal_eq_bot_of_localization' _ fun P hP =>
(Ideal.map_eq_bot_iff_le_ker _).mpr fun x hx => by
rw [RingHom.mem_ker, ← Submodule.mem_bot R, ← h P hP, IsLocalization.mem_coeSubmodule]
exact ⟨x, hx, rfl⟩
#align ideal_eq_bot_of_localization ideal_eq_bot_of_localization
| Mathlib/RingTheory/LocalProperties.lean | 290 | 300 | theorem eq_zero_of_localization (r : R)
(h : ∀ (J : Ideal R) (hJ : J.IsMaximal), algebraMap R (Localization.AtPrime J) r = 0) :
r = 0 := by |
rw [← Ideal.span_singleton_eq_bot]
apply ideal_eq_bot_of_localization
intro J hJ
delta IsLocalization.coeSubmodule
erw [Submodule.map_span, Submodule.span_eq_bot]
rintro _ ⟨_, h', rfl⟩
cases Set.mem_singleton_iff.mpr h'
exact h J hJ
| 1,728 |
import Mathlib.AlgebraicGeometry.OpenImmersion
import Mathlib.AlgebraicGeometry.Morphisms.QuasiCompact
import Mathlib.CategoryTheory.MorphismProperty.Composition
import Mathlib.RingTheory.LocalProperties
universe v u
open CategoryTheory
namespace AlgebraicGeometry
class IsClosedImmersion {X Y : Scheme} (f : X ⟶ Y) : Prop where
base_closed : ClosedEmbedding f.1.base
surj_on_stalks : ∀ x, Function.Surjective (PresheafedSpace.stalkMap f.1 x)
namespace IsClosedImmersion
lemma closedEmbedding {X Y : Scheme} (f : X ⟶ Y)
[IsClosedImmersion f] : ClosedEmbedding f.1.base :=
IsClosedImmersion.base_closed
lemma surjective_stalkMap {X Y : Scheme} (f : X ⟶ Y)
[IsClosedImmersion f] (x : X) : Function.Surjective (PresheafedSpace.stalkMap f.1 x) :=
IsClosedImmersion.surj_on_stalks x
instance {X Y : Scheme} (f : X ⟶ Y) [IsIso f] : IsClosedImmersion f where
base_closed := Homeomorph.closedEmbedding <| TopCat.homeoOfIso (asIso f.1.base)
surj_on_stalks := fun _ ↦ (ConcreteCategory.bijective_of_isIso _).2
instance : MorphismProperty.IsMultiplicative @IsClosedImmersion where
id_mem _ := inferInstance
comp_mem {X Y Z} f g hf hg := by
refine ⟨hg.base_closed.comp hf.base_closed, fun x ↦ ?_⟩
erw [PresheafedSpace.stalkMap.comp]
exact (hf.surj_on_stalks x).comp (hg.surj_on_stalks (f.1.1 x))
instance comp {X Y Z : Scheme} (f : X ⟶ Y) (g : Y ⟶ Z) [IsClosedImmersion f]
[IsClosedImmersion g] : IsClosedImmersion (f ≫ g) :=
MorphismProperty.IsStableUnderComposition.comp_mem f g inferInstance inferInstance
lemma respectsIso : MorphismProperty.RespectsIso @IsClosedImmersion := by
constructor <;> intro X Y Z e f hf <;> infer_instance
| Mathlib/AlgebraicGeometry/Morphisms/ClosedImmersion.lean | 79 | 89 | theorem spec_of_surjective {R S : CommRingCat} (f : R ⟶ S) (h : Function.Surjective f) :
IsClosedImmersion (Scheme.specMap f) where
base_closed := PrimeSpectrum.closedEmbedding_comap_of_surjective _ _ h
surj_on_stalks x := by |
erw [← localRingHom_comp_stalkIso, CommRingCat.coe_comp, CommRingCat.coe_comp]
apply Function.Surjective.comp (Function.Surjective.comp _ _) _
· exact (ConcreteCategory.bijective_of_isIso (StructureSheaf.stalkIso S x).inv).2
· exact surjective_localRingHom_of_surjective f h x.asIdeal
· let g := (StructureSheaf.stalkIso ((CommRingCat.of R))
((PrimeSpectrum.comap (CommRingCat.ofHom f)) x)).hom
exact (ConcreteCategory.bijective_of_isIso g).2
| 1,729 |
import Mathlib.AlgebraicGeometry.OpenImmersion
import Mathlib.AlgebraicGeometry.Morphisms.QuasiCompact
import Mathlib.CategoryTheory.MorphismProperty.Composition
import Mathlib.RingTheory.LocalProperties
universe v u
open CategoryTheory
namespace AlgebraicGeometry
class IsClosedImmersion {X Y : Scheme} (f : X ⟶ Y) : Prop where
base_closed : ClosedEmbedding f.1.base
surj_on_stalks : ∀ x, Function.Surjective (PresheafedSpace.stalkMap f.1 x)
namespace IsClosedImmersion
lemma closedEmbedding {X Y : Scheme} (f : X ⟶ Y)
[IsClosedImmersion f] : ClosedEmbedding f.1.base :=
IsClosedImmersion.base_closed
lemma surjective_stalkMap {X Y : Scheme} (f : X ⟶ Y)
[IsClosedImmersion f] (x : X) : Function.Surjective (PresheafedSpace.stalkMap f.1 x) :=
IsClosedImmersion.surj_on_stalks x
instance {X Y : Scheme} (f : X ⟶ Y) [IsIso f] : IsClosedImmersion f where
base_closed := Homeomorph.closedEmbedding <| TopCat.homeoOfIso (asIso f.1.base)
surj_on_stalks := fun _ ↦ (ConcreteCategory.bijective_of_isIso _).2
instance : MorphismProperty.IsMultiplicative @IsClosedImmersion where
id_mem _ := inferInstance
comp_mem {X Y Z} f g hf hg := by
refine ⟨hg.base_closed.comp hf.base_closed, fun x ↦ ?_⟩
erw [PresheafedSpace.stalkMap.comp]
exact (hf.surj_on_stalks x).comp (hg.surj_on_stalks (f.1.1 x))
instance comp {X Y Z : Scheme} (f : X ⟶ Y) (g : Y ⟶ Z) [IsClosedImmersion f]
[IsClosedImmersion g] : IsClosedImmersion (f ≫ g) :=
MorphismProperty.IsStableUnderComposition.comp_mem f g inferInstance inferInstance
lemma respectsIso : MorphismProperty.RespectsIso @IsClosedImmersion := by
constructor <;> intro X Y Z e f hf <;> infer_instance
theorem spec_of_surjective {R S : CommRingCat} (f : R ⟶ S) (h : Function.Surjective f) :
IsClosedImmersion (Scheme.specMap f) where
base_closed := PrimeSpectrum.closedEmbedding_comap_of_surjective _ _ h
surj_on_stalks x := by
erw [← localRingHom_comp_stalkIso, CommRingCat.coe_comp, CommRingCat.coe_comp]
apply Function.Surjective.comp (Function.Surjective.comp _ _) _
· exact (ConcreteCategory.bijective_of_isIso (StructureSheaf.stalkIso S x).inv).2
· exact surjective_localRingHom_of_surjective f h x.asIdeal
· let g := (StructureSheaf.stalkIso ((CommRingCat.of R))
((PrimeSpectrum.comap (CommRingCat.ofHom f)) x)).hom
exact (ConcreteCategory.bijective_of_isIso g).2
instance spec_of_quotient_mk {R : CommRingCat.{u}} (I : Ideal R) :
IsClosedImmersion (Scheme.specMap (CommRingCat.ofHom (Ideal.Quotient.mk I))) :=
spec_of_surjective _ Ideal.Quotient.mk_surjective
| Mathlib/AlgebraicGeometry/Morphisms/ClosedImmersion.lean | 98 | 112 | theorem of_comp {X Y Z : Scheme} (f : X ⟶ Y) (g : Y ⟶ Z) [IsClosedImmersion g]
[IsClosedImmersion (f ≫ g)] : IsClosedImmersion f where
base_closed := by |
have h := closedEmbedding (f ≫ g)
rw [Scheme.comp_val_base] at h
apply closedEmbedding_of_continuous_injective_closed (Scheme.Hom.continuous f)
· exact Function.Injective.of_comp h.inj
· intro Z hZ
rw [ClosedEmbedding.closed_iff_image_closed (closedEmbedding g),
← Set.image_comp]
exact ClosedEmbedding.isClosedMap h _ hZ
surj_on_stalks x := by
have h := surjective_stalkMap (f ≫ g) x
erw [Scheme.comp_val, PresheafedSpace.stalkMap.comp] at h
exact Function.Surjective.of_comp h
| 1,729 |
import Mathlib.AlgebraicGeometry.Morphisms.ClosedImmersion
import Mathlib.AlgebraicGeometry.Morphisms.QuasiSeparated
import Mathlib.AlgebraicGeometry.Pullbacks
import Mathlib.CategoryTheory.MorphismProperty.Limits
noncomputable section
open CategoryTheory CategoryTheory.Limits Opposite TopologicalSpace
universe u
open scoped AlgebraicGeometry
namespace AlgebraicGeometry
variable {X Y : Scheme.{u}} (f : X ⟶ Y)
@[mk_iff]
class IsSeparated : Prop where
diagonal_isClosedImmersion : IsClosedImmersion (pullback.diagonal f) := by infer_instance
namespace IsSeparated
attribute [instance] diagonal_isClosedImmersion
| Mathlib/AlgebraicGeometry/Morphisms/Separated.lean | 49 | 52 | theorem isSeparated_eq_diagonal_isClosedImmersion :
@IsSeparated = MorphismProperty.diagonal @IsClosedImmersion := by |
ext
exact isSeparated_iff _
| 1,730 |
import Mathlib.AlgebraicGeometry.Morphisms.ClosedImmersion
import Mathlib.AlgebraicGeometry.Morphisms.QuasiSeparated
import Mathlib.AlgebraicGeometry.Pullbacks
import Mathlib.CategoryTheory.MorphismProperty.Limits
noncomputable section
open CategoryTheory CategoryTheory.Limits Opposite TopologicalSpace
universe u
open scoped AlgebraicGeometry
namespace AlgebraicGeometry
variable {X Y : Scheme.{u}} (f : X ⟶ Y)
@[mk_iff]
class IsSeparated : Prop where
diagonal_isClosedImmersion : IsClosedImmersion (pullback.diagonal f) := by infer_instance
namespace IsSeparated
attribute [instance] diagonal_isClosedImmersion
theorem isSeparated_eq_diagonal_isClosedImmersion :
@IsSeparated = MorphismProperty.diagonal @IsClosedImmersion := by
ext
exact isSeparated_iff _
instance (priority := 900) isSeparated_of_mono [Mono f] : IsSeparated f where
| Mathlib/AlgebraicGeometry/Morphisms/Separated.lean | 57 | 60 | theorem respectsIso : MorphismProperty.RespectsIso @IsSeparated := by |
rw [isSeparated_eq_diagonal_isClosedImmersion]
apply MorphismProperty.RespectsIso.diagonal
exact IsClosedImmersion.respectsIso
| 1,730 |
import Mathlib.RingTheory.LocalProperties
import Mathlib.RingTheory.Localization.InvSubmonoid
#align_import ring_theory.ring_hom.finite_type from "leanprover-community/mathlib"@"64fc7238fb41b1a4f12ff05e3d5edfa360dd768c"
namespace RingHom
open scoped Pointwise
| Mathlib/RingTheory/RingHom/FiniteType.lean | 24 | 26 | theorem finiteType_stableUnderComposition : StableUnderComposition @FiniteType := by |
introv R hf hg
exact hg.comp hf
| 1,731 |
import Mathlib.RingTheory.LocalProperties
import Mathlib.RingTheory.Localization.InvSubmonoid
#align_import ring_theory.ring_hom.finite_type from "leanprover-community/mathlib"@"64fc7238fb41b1a4f12ff05e3d5edfa360dd768c"
namespace RingHom
open scoped Pointwise
theorem finiteType_stableUnderComposition : StableUnderComposition @FiniteType := by
introv R hf hg
exact hg.comp hf
#align ring_hom.finite_type_stable_under_composition RingHom.finiteType_stableUnderComposition
| Mathlib/RingTheory/RingHom/FiniteType.lean | 29 | 35 | theorem finiteType_holdsForLocalizationAway : HoldsForLocalizationAway @FiniteType := by |
introv R _
suffices Algebra.FiniteType R S by
rw [RingHom.FiniteType]
convert this; ext;
rw [Algebra.smul_def]; rfl
exact IsLocalization.finiteType_of_monoid_fg (Submonoid.powers r) S
| 1,731 |
import Mathlib.RingTheory.LocalProperties
import Mathlib.RingTheory.Localization.InvSubmonoid
#align_import ring_theory.ring_hom.finite_type from "leanprover-community/mathlib"@"64fc7238fb41b1a4f12ff05e3d5edfa360dd768c"
namespace RingHom
open scoped Pointwise
theorem finiteType_stableUnderComposition : StableUnderComposition @FiniteType := by
introv R hf hg
exact hg.comp hf
#align ring_hom.finite_type_stable_under_composition RingHom.finiteType_stableUnderComposition
theorem finiteType_holdsForLocalizationAway : HoldsForLocalizationAway @FiniteType := by
introv R _
suffices Algebra.FiniteType R S by
rw [RingHom.FiniteType]
convert this; ext;
rw [Algebra.smul_def]; rfl
exact IsLocalization.finiteType_of_monoid_fg (Submonoid.powers r) S
#align ring_hom.finite_type_holds_for_localization_away RingHom.finiteType_holdsForLocalizationAway
| Mathlib/RingTheory/RingHom/FiniteType.lean | 38 | 91 | theorem finiteType_ofLocalizationSpanTarget : OfLocalizationSpanTarget @FiniteType := by |
-- Setup algebra intances.
rw [ofLocalizationSpanTarget_iff_finite]
introv R hs H
classical
letI := f.toAlgebra
replace H : ∀ r : s, Algebra.FiniteType R (Localization.Away (r : S)) := by
intro r; simp_rw [RingHom.FiniteType] at H; convert H r; ext; simp_rw [Algebra.smul_def]; rfl
replace H := fun r => (H r).1
constructor
-- Suppose `s : Finset S` spans `S`, and each `Sᵣ` is finitely generated as an `R`-algebra.
-- Say `t r : Finset Sᵣ` generates `Sᵣ`. By assumption, we may find `lᵢ` such that
-- `∑ lᵢ * sᵢ = 1`. I claim that all `s` and `l` and the numerators of `t` and generates `S`.
choose t ht using H
obtain ⟨l, hl⟩ :=
(Finsupp.mem_span_iff_total S (s : Set S) 1).mp
(show (1 : S) ∈ Ideal.span (s : Set S) by rw [hs]; trivial)
let sf := fun x : s => IsLocalization.finsetIntegerMultiple (Submonoid.powers (x : S)) (t x)
use s.attach.biUnion sf ∪ s ∪ l.support.image l
rw [eq_top_iff]
-- We need to show that every `x` falls in the subalgebra generated by those elements.
-- Since all `s` and `l` are in the subalgebra, it suffices to check that `sᵢ ^ nᵢ • x` falls in
-- the algebra for each `sᵢ` and some `nᵢ`.
rintro x -
apply Subalgebra.mem_of_span_eq_top_of_smul_pow_mem _ (s : Set S) l hl _ _ x _
· intro x hx
apply Algebra.subset_adjoin
rw [Finset.coe_union, Finset.coe_union]
exact Or.inl (Or.inr hx)
· intro i
by_cases h : l i = 0; · rw [h]; exact zero_mem _
apply Algebra.subset_adjoin
rw [Finset.coe_union, Finset.coe_image]
exact Or.inr (Set.mem_image_of_mem _ (Finsupp.mem_support_iff.mpr h))
· intro r
rw [Finset.coe_union, Finset.coe_union, Finset.coe_biUnion]
-- Since all `sᵢ` and numerators of `t r` are in the algebra, it suffices to show that the
-- image of `x` in `Sᵣ` falls in the `R`-adjoin of `t r`, which is of course true.
-- Porting note: The following `obtain` fails because Lean wants to know right away what the
-- placeholders are, so we need to provide a little more guidance
-- obtain ⟨⟨_, n₂, rfl⟩, hn₂⟩ := IsLocalization.exists_smul_mem_of_mem_adjoin
-- (Submonoid.powers (r : S)) x (t r) (Algebra.adjoin R _) _ _ _
rw [show ∀ A : Set S, (∃ n, (r : S) ^ n • x ∈ Algebra.adjoin R A) ↔
(∃ m : (Submonoid.powers (r : S)), (m : S) • x ∈ Algebra.adjoin R A) by
{ exact fun _ => by simp [Submonoid.mem_powers_iff] }]
refine IsLocalization.exists_smul_mem_of_mem_adjoin
(Submonoid.powers (r : S)) x (t r) (Algebra.adjoin R _) ?_ ?_ ?_
· intro x hx
apply Algebra.subset_adjoin
exact Or.inl (Or.inl ⟨_, ⟨r, rfl⟩, _, ⟨s.mem_attach r, rfl⟩, hx⟩)
· rw [Submonoid.powers_eq_closure, Submonoid.closure_le, Set.singleton_subset_iff]
apply Algebra.subset_adjoin
exact Or.inl (Or.inr r.2)
· rw [ht]; trivial
| 1,731 |
import Mathlib.AlgebraicGeometry.AffineScheme
import Mathlib.RingTheory.Nilpotent.Lemmas
import Mathlib.Topology.Sheaves.SheafCondition.Sites
import Mathlib.Algebra.Category.Ring.Constructions
import Mathlib.RingTheory.LocalProperties
#align_import algebraic_geometry.properties from "leanprover-community/mathlib"@"88474d1b5af6d37c2ab728b757771bced7f5194c"
-- Explicit universe annotations were used in this file to improve perfomance #12737
universe u
open TopologicalSpace Opposite CategoryTheory CategoryTheory.Limits TopCat
namespace AlgebraicGeometry
variable (X : Scheme)
instance : T0Space X.carrier := by
refine T0Space.of_open_cover fun x => ?_
obtain ⟨U, R, ⟨e⟩⟩ := X.local_affine x
let e' : U.1 ≃ₜ PrimeSpectrum R :=
homeoOfIso ((LocallyRingedSpace.forgetToSheafedSpace ⋙ SheafedSpace.forget _).mapIso e)
exact ⟨U.1.1, U.2, U.1.2, e'.embedding.t0Space⟩
instance : QuasiSober X.carrier := by
apply (config := { allowSynthFailures := true })
quasiSober_of_open_cover (Set.range fun x => Set.range <| (X.affineCover.map x).1.base)
· rintro ⟨_, i, rfl⟩; exact (X.affineCover.IsOpen i).base_open.isOpen_range
· rintro ⟨_, i, rfl⟩
exact @OpenEmbedding.quasiSober _ _ _ _ _ (Homeomorph.ofEmbedding _
(X.affineCover.IsOpen i).base_open.toEmbedding).symm.openEmbedding PrimeSpectrum.quasiSober
· rw [Set.top_eq_univ, Set.sUnion_range, Set.eq_univ_iff_forall]
intro x; exact ⟨_, ⟨_, rfl⟩, X.affineCover.Covers x⟩
class IsReduced : Prop where
component_reduced : ∀ U, IsReduced (X.presheaf.obj (op U)) := by infer_instance
#align algebraic_geometry.is_reduced AlgebraicGeometry.IsReduced
attribute [instance] IsReduced.component_reduced
| Mathlib/AlgebraicGeometry/Properties.lean | 61 | 68 | theorem isReducedOfStalkIsReduced [∀ x : X.carrier, _root_.IsReduced (X.presheaf.stalk x)] :
IsReduced X := by |
refine ⟨fun U => ⟨fun s hs => ?_⟩⟩
apply Presheaf.section_ext X.sheaf U s 0
intro x
rw [RingHom.map_zero]
change X.presheaf.germ x s = 0
exact (hs.map _).eq_zero
| 1,732 |
import Mathlib.AlgebraicGeometry.AffineScheme
import Mathlib.RingTheory.Nilpotent.Lemmas
import Mathlib.Topology.Sheaves.SheafCondition.Sites
import Mathlib.Algebra.Category.Ring.Constructions
import Mathlib.RingTheory.LocalProperties
#align_import algebraic_geometry.properties from "leanprover-community/mathlib"@"88474d1b5af6d37c2ab728b757771bced7f5194c"
-- Explicit universe annotations were used in this file to improve perfomance #12737
universe u
open TopologicalSpace Opposite CategoryTheory CategoryTheory.Limits TopCat
namespace AlgebraicGeometry
variable (X : Scheme)
instance : T0Space X.carrier := by
refine T0Space.of_open_cover fun x => ?_
obtain ⟨U, R, ⟨e⟩⟩ := X.local_affine x
let e' : U.1 ≃ₜ PrimeSpectrum R :=
homeoOfIso ((LocallyRingedSpace.forgetToSheafedSpace ⋙ SheafedSpace.forget _).mapIso e)
exact ⟨U.1.1, U.2, U.1.2, e'.embedding.t0Space⟩
instance : QuasiSober X.carrier := by
apply (config := { allowSynthFailures := true })
quasiSober_of_open_cover (Set.range fun x => Set.range <| (X.affineCover.map x).1.base)
· rintro ⟨_, i, rfl⟩; exact (X.affineCover.IsOpen i).base_open.isOpen_range
· rintro ⟨_, i, rfl⟩
exact @OpenEmbedding.quasiSober _ _ _ _ _ (Homeomorph.ofEmbedding _
(X.affineCover.IsOpen i).base_open.toEmbedding).symm.openEmbedding PrimeSpectrum.quasiSober
· rw [Set.top_eq_univ, Set.sUnion_range, Set.eq_univ_iff_forall]
intro x; exact ⟨_, ⟨_, rfl⟩, X.affineCover.Covers x⟩
class IsReduced : Prop where
component_reduced : ∀ U, IsReduced (X.presheaf.obj (op U)) := by infer_instance
#align algebraic_geometry.is_reduced AlgebraicGeometry.IsReduced
attribute [instance] IsReduced.component_reduced
theorem isReducedOfStalkIsReduced [∀ x : X.carrier, _root_.IsReduced (X.presheaf.stalk x)] :
IsReduced X := by
refine ⟨fun U => ⟨fun s hs => ?_⟩⟩
apply Presheaf.section_ext X.sheaf U s 0
intro x
rw [RingHom.map_zero]
change X.presheaf.germ x s = 0
exact (hs.map _).eq_zero
#align algebraic_geometry.is_reduced_of_stalk_is_reduced AlgebraicGeometry.isReducedOfStalkIsReduced
instance stalk_isReduced_of_reduced [IsReduced X] (x : X.carrier) :
_root_.IsReduced (X.presheaf.stalk x) := by
constructor
rintro g ⟨n, e⟩
obtain ⟨U, hxU, s, rfl⟩ := X.presheaf.germ_exist x g
rw [← map_pow, ← map_zero (X.presheaf.germ ⟨x, hxU⟩)] at e
obtain ⟨V, hxV, iU, iV, e'⟩ := X.presheaf.germ_eq x hxU hxU _ 0 e
rw [map_pow, map_zero] at e'
replace e' := (IsNilpotent.mk _ _ e').eq_zero (R := X.presheaf.obj <| op V)
erw [← ConcreteCategory.congr_hom (X.presheaf.germ_res iU ⟨x, hxV⟩) s]
rw [comp_apply, e', map_zero]
#align algebraic_geometry.stalk_is_reduced_of_reduced AlgebraicGeometry.stalk_isReduced_of_reduced
| Mathlib/AlgebraicGeometry/Properties.lean | 84 | 93 | theorem isReducedOfOpenImmersion {X Y : Scheme} (f : X ⟶ Y) [H : IsOpenImmersion f]
[IsReduced Y] : IsReduced X := by |
constructor
intro U
have : U = (Opens.map f.1.base).obj (H.base_open.isOpenMap.functor.obj U) := by
ext1; exact (Set.preimage_image_eq _ H.base_open.inj).symm
rw [this]
exact isReduced_of_injective (inv <| f.1.c.app (op <| H.base_open.isOpenMap.functor.obj U))
(asIso <| f.1.c.app (op <| H.base_open.isOpenMap.functor.obj U) :
Y.presheaf.obj _ ≅ _).symm.commRingCatIsoToRingEquiv.injective
| 1,732 |
import Mathlib.AlgebraicGeometry.AffineScheme
import Mathlib.RingTheory.Nilpotent.Lemmas
import Mathlib.Topology.Sheaves.SheafCondition.Sites
import Mathlib.Algebra.Category.Ring.Constructions
import Mathlib.RingTheory.LocalProperties
#align_import algebraic_geometry.properties from "leanprover-community/mathlib"@"88474d1b5af6d37c2ab728b757771bced7f5194c"
-- Explicit universe annotations were used in this file to improve perfomance #12737
universe u
open TopologicalSpace Opposite CategoryTheory CategoryTheory.Limits TopCat
namespace AlgebraicGeometry
variable (X : Scheme)
instance : T0Space X.carrier := by
refine T0Space.of_open_cover fun x => ?_
obtain ⟨U, R, ⟨e⟩⟩ := X.local_affine x
let e' : U.1 ≃ₜ PrimeSpectrum R :=
homeoOfIso ((LocallyRingedSpace.forgetToSheafedSpace ⋙ SheafedSpace.forget _).mapIso e)
exact ⟨U.1.1, U.2, U.1.2, e'.embedding.t0Space⟩
instance : QuasiSober X.carrier := by
apply (config := { allowSynthFailures := true })
quasiSober_of_open_cover (Set.range fun x => Set.range <| (X.affineCover.map x).1.base)
· rintro ⟨_, i, rfl⟩; exact (X.affineCover.IsOpen i).base_open.isOpen_range
· rintro ⟨_, i, rfl⟩
exact @OpenEmbedding.quasiSober _ _ _ _ _ (Homeomorph.ofEmbedding _
(X.affineCover.IsOpen i).base_open.toEmbedding).symm.openEmbedding PrimeSpectrum.quasiSober
· rw [Set.top_eq_univ, Set.sUnion_range, Set.eq_univ_iff_forall]
intro x; exact ⟨_, ⟨_, rfl⟩, X.affineCover.Covers x⟩
class IsReduced : Prop where
component_reduced : ∀ U, IsReduced (X.presheaf.obj (op U)) := by infer_instance
#align algebraic_geometry.is_reduced AlgebraicGeometry.IsReduced
attribute [instance] IsReduced.component_reduced
theorem isReducedOfStalkIsReduced [∀ x : X.carrier, _root_.IsReduced (X.presheaf.stalk x)] :
IsReduced X := by
refine ⟨fun U => ⟨fun s hs => ?_⟩⟩
apply Presheaf.section_ext X.sheaf U s 0
intro x
rw [RingHom.map_zero]
change X.presheaf.germ x s = 0
exact (hs.map _).eq_zero
#align algebraic_geometry.is_reduced_of_stalk_is_reduced AlgebraicGeometry.isReducedOfStalkIsReduced
instance stalk_isReduced_of_reduced [IsReduced X] (x : X.carrier) :
_root_.IsReduced (X.presheaf.stalk x) := by
constructor
rintro g ⟨n, e⟩
obtain ⟨U, hxU, s, rfl⟩ := X.presheaf.germ_exist x g
rw [← map_pow, ← map_zero (X.presheaf.germ ⟨x, hxU⟩)] at e
obtain ⟨V, hxV, iU, iV, e'⟩ := X.presheaf.germ_eq x hxU hxU _ 0 e
rw [map_pow, map_zero] at e'
replace e' := (IsNilpotent.mk _ _ e').eq_zero (R := X.presheaf.obj <| op V)
erw [← ConcreteCategory.congr_hom (X.presheaf.germ_res iU ⟨x, hxV⟩) s]
rw [comp_apply, e', map_zero]
#align algebraic_geometry.stalk_is_reduced_of_reduced AlgebraicGeometry.stalk_isReduced_of_reduced
theorem isReducedOfOpenImmersion {X Y : Scheme} (f : X ⟶ Y) [H : IsOpenImmersion f]
[IsReduced Y] : IsReduced X := by
constructor
intro U
have : U = (Opens.map f.1.base).obj (H.base_open.isOpenMap.functor.obj U) := by
ext1; exact (Set.preimage_image_eq _ H.base_open.inj).symm
rw [this]
exact isReduced_of_injective (inv <| f.1.c.app (op <| H.base_open.isOpenMap.functor.obj U))
(asIso <| f.1.c.app (op <| H.base_open.isOpenMap.functor.obj U) :
Y.presheaf.obj _ ≅ _).symm.commRingCatIsoToRingEquiv.injective
#align algebraic_geometry.is_reduced_of_open_immersion AlgebraicGeometry.isReducedOfOpenImmersion
instance {R : CommRingCat.{u}} [H : _root_.IsReduced R] : IsReduced (Scheme.Spec.obj <| op R) := by
apply (config := { allowSynthFailures := true }) isReducedOfStalkIsReduced
intro x; dsimp
have : _root_.IsReduced (CommRingCat.of <| Localization.AtPrime (PrimeSpectrum.asIdeal x)) := by
dsimp; infer_instance
rw [show (Scheme.Spec.obj <| op R).presheaf = (Spec.structureSheaf R).presheaf from rfl]
exact isReduced_of_injective (StructureSheaf.stalkIso R x).hom
(StructureSheaf.stalkIso R x).commRingCatIsoToRingEquiv.injective
| Mathlib/AlgebraicGeometry/Properties.lean | 105 | 112 | theorem affine_isReduced_iff (R : CommRingCat) :
IsReduced (Scheme.Spec.obj <| op R) ↔ _root_.IsReduced R := by |
refine ⟨?_, fun h => inferInstance⟩
intro h
have : _root_.IsReduced
(LocallyRingedSpace.Γ.obj (op <| Spec.toLocallyRingedSpace.obj <| op R)) := by
change _root_.IsReduced ((Scheme.Spec.obj <| op R).presheaf.obj <| op ⊤); infer_instance
exact isReduced_of_injective (toSpecΓ R) (asIso <| toSpecΓ R).commRingCatIsoToRingEquiv.injective
| 1,732 |
import Mathlib.AlgebraicGeometry.AffineScheme
import Mathlib.RingTheory.Nilpotent.Lemmas
import Mathlib.Topology.Sheaves.SheafCondition.Sites
import Mathlib.Algebra.Category.Ring.Constructions
import Mathlib.RingTheory.LocalProperties
#align_import algebraic_geometry.properties from "leanprover-community/mathlib"@"88474d1b5af6d37c2ab728b757771bced7f5194c"
-- Explicit universe annotations were used in this file to improve perfomance #12737
universe u
open TopologicalSpace Opposite CategoryTheory CategoryTheory.Limits TopCat
namespace AlgebraicGeometry
variable (X : Scheme)
instance : T0Space X.carrier := by
refine T0Space.of_open_cover fun x => ?_
obtain ⟨U, R, ⟨e⟩⟩ := X.local_affine x
let e' : U.1 ≃ₜ PrimeSpectrum R :=
homeoOfIso ((LocallyRingedSpace.forgetToSheafedSpace ⋙ SheafedSpace.forget _).mapIso e)
exact ⟨U.1.1, U.2, U.1.2, e'.embedding.t0Space⟩
instance : QuasiSober X.carrier := by
apply (config := { allowSynthFailures := true })
quasiSober_of_open_cover (Set.range fun x => Set.range <| (X.affineCover.map x).1.base)
· rintro ⟨_, i, rfl⟩; exact (X.affineCover.IsOpen i).base_open.isOpen_range
· rintro ⟨_, i, rfl⟩
exact @OpenEmbedding.quasiSober _ _ _ _ _ (Homeomorph.ofEmbedding _
(X.affineCover.IsOpen i).base_open.toEmbedding).symm.openEmbedding PrimeSpectrum.quasiSober
· rw [Set.top_eq_univ, Set.sUnion_range, Set.eq_univ_iff_forall]
intro x; exact ⟨_, ⟨_, rfl⟩, X.affineCover.Covers x⟩
class IsReduced : Prop where
component_reduced : ∀ U, IsReduced (X.presheaf.obj (op U)) := by infer_instance
#align algebraic_geometry.is_reduced AlgebraicGeometry.IsReduced
attribute [instance] IsReduced.component_reduced
theorem isReducedOfStalkIsReduced [∀ x : X.carrier, _root_.IsReduced (X.presheaf.stalk x)] :
IsReduced X := by
refine ⟨fun U => ⟨fun s hs => ?_⟩⟩
apply Presheaf.section_ext X.sheaf U s 0
intro x
rw [RingHom.map_zero]
change X.presheaf.germ x s = 0
exact (hs.map _).eq_zero
#align algebraic_geometry.is_reduced_of_stalk_is_reduced AlgebraicGeometry.isReducedOfStalkIsReduced
instance stalk_isReduced_of_reduced [IsReduced X] (x : X.carrier) :
_root_.IsReduced (X.presheaf.stalk x) := by
constructor
rintro g ⟨n, e⟩
obtain ⟨U, hxU, s, rfl⟩ := X.presheaf.germ_exist x g
rw [← map_pow, ← map_zero (X.presheaf.germ ⟨x, hxU⟩)] at e
obtain ⟨V, hxV, iU, iV, e'⟩ := X.presheaf.germ_eq x hxU hxU _ 0 e
rw [map_pow, map_zero] at e'
replace e' := (IsNilpotent.mk _ _ e').eq_zero (R := X.presheaf.obj <| op V)
erw [← ConcreteCategory.congr_hom (X.presheaf.germ_res iU ⟨x, hxV⟩) s]
rw [comp_apply, e', map_zero]
#align algebraic_geometry.stalk_is_reduced_of_reduced AlgebraicGeometry.stalk_isReduced_of_reduced
theorem isReducedOfOpenImmersion {X Y : Scheme} (f : X ⟶ Y) [H : IsOpenImmersion f]
[IsReduced Y] : IsReduced X := by
constructor
intro U
have : U = (Opens.map f.1.base).obj (H.base_open.isOpenMap.functor.obj U) := by
ext1; exact (Set.preimage_image_eq _ H.base_open.inj).symm
rw [this]
exact isReduced_of_injective (inv <| f.1.c.app (op <| H.base_open.isOpenMap.functor.obj U))
(asIso <| f.1.c.app (op <| H.base_open.isOpenMap.functor.obj U) :
Y.presheaf.obj _ ≅ _).symm.commRingCatIsoToRingEquiv.injective
#align algebraic_geometry.is_reduced_of_open_immersion AlgebraicGeometry.isReducedOfOpenImmersion
instance {R : CommRingCat.{u}} [H : _root_.IsReduced R] : IsReduced (Scheme.Spec.obj <| op R) := by
apply (config := { allowSynthFailures := true }) isReducedOfStalkIsReduced
intro x; dsimp
have : _root_.IsReduced (CommRingCat.of <| Localization.AtPrime (PrimeSpectrum.asIdeal x)) := by
dsimp; infer_instance
rw [show (Scheme.Spec.obj <| op R).presheaf = (Spec.structureSheaf R).presheaf from rfl]
exact isReduced_of_injective (StructureSheaf.stalkIso R x).hom
(StructureSheaf.stalkIso R x).commRingCatIsoToRingEquiv.injective
theorem affine_isReduced_iff (R : CommRingCat) :
IsReduced (Scheme.Spec.obj <| op R) ↔ _root_.IsReduced R := by
refine ⟨?_, fun h => inferInstance⟩
intro h
have : _root_.IsReduced
(LocallyRingedSpace.Γ.obj (op <| Spec.toLocallyRingedSpace.obj <| op R)) := by
change _root_.IsReduced ((Scheme.Spec.obj <| op R).presheaf.obj <| op ⊤); infer_instance
exact isReduced_of_injective (toSpecΓ R) (asIso <| toSpecΓ R).commRingCatIsoToRingEquiv.injective
#align algebraic_geometry.affine_is_reduced_iff AlgebraicGeometry.affine_isReduced_iff
| Mathlib/AlgebraicGeometry/Properties.lean | 115 | 119 | theorem isReducedOfIsAffineIsReduced [IsAffine X] [h : _root_.IsReduced (X.presheaf.obj (op ⊤))] :
IsReduced X :=
haveI : IsReduced (Scheme.Spec.obj (op (Scheme.Γ.obj (op X)))) := by |
rw [affine_isReduced_iff]; exact h
isReducedOfOpenImmersion X.isoSpec.hom
| 1,732 |
import Mathlib.AlgebraicGeometry.Properties
#align_import algebraic_geometry.function_field from "leanprover-community/mathlib"@"d39590fc8728fbf6743249802486f8c91ffe07bc"
-- Explicit universe annotations were used in this file to improve perfomance #12737
set_option linter.uppercaseLean3 false
universe u v
open TopologicalSpace Opposite CategoryTheory CategoryTheory.Limits TopCat
namespace AlgebraicGeometry
variable (X : Scheme)
noncomputable abbrev Scheme.functionField [IrreducibleSpace X.carrier] : CommRingCat :=
X.presheaf.stalk (genericPoint X.carrier)
#align algebraic_geometry.Scheme.function_field AlgebraicGeometry.Scheme.functionField
noncomputable abbrev Scheme.germToFunctionField [IrreducibleSpace X.carrier] (U : Opens X.carrier)
[h : Nonempty U] : X.presheaf.obj (op U) ⟶ X.functionField :=
X.presheaf.germ
⟨genericPoint X.carrier,
((genericPoint_spec X.carrier).mem_open_set_iff U.isOpen).mpr (by simpa using h)⟩
#align algebraic_geometry.Scheme.germ_to_function_field AlgebraicGeometry.Scheme.germToFunctionField
noncomputable instance [IrreducibleSpace X.carrier] (U : Opens X.carrier) [Nonempty U] :
Algebra (X.presheaf.obj (op U)) X.functionField :=
(X.germToFunctionField U).toAlgebra
noncomputable instance [IsIntegral X] : Field X.functionField := by
refine .ofIsUnitOrEqZero fun a ↦ ?_
obtain ⟨U, m, s, rfl⟩ := TopCat.Presheaf.germ_exist _ _ a
rw [or_iff_not_imp_right, ← (X.presheaf.germ ⟨_, m⟩).map_zero]
intro ha
replace ha := ne_of_apply_ne _ ha
have hs : genericPoint X.carrier ∈ RingedSpace.basicOpen _ s := by
rw [← SetLike.mem_coe, (genericPoint_spec X.carrier).mem_open_set_iff, Set.top_eq_univ,
Set.univ_inter, Set.nonempty_iff_ne_empty, Ne, ← Opens.coe_bot, ← SetLike.ext'_iff]
· erw [basicOpen_eq_bot_iff]
exact ha
· exact (RingedSpace.basicOpen _ _).isOpen
have := (X.presheaf.germ ⟨_, hs⟩).isUnit_map (RingedSpace.isUnit_res_basicOpen _ s)
rwa [TopCat.Presheaf.germ_res_apply] at this
| Mathlib/AlgebraicGeometry/FunctionField.lean | 67 | 75 | theorem germ_injective_of_isIntegral [IsIntegral X] {U : Opens X.carrier} (x : U) :
Function.Injective (X.presheaf.germ x) := by |
rw [injective_iff_map_eq_zero]
intro y hy
rw [← (X.presheaf.germ x).map_zero] at hy
obtain ⟨W, hW, iU, iV, e⟩ := X.presheaf.germ_eq _ x.prop x.prop _ _ hy
cases Subsingleton.elim iU iV
haveI : Nonempty W := ⟨⟨_, hW⟩⟩
exact map_injective_of_isIntegral X iU e
| 1,733 |
import Mathlib.AlgebraicGeometry.Properties
#align_import algebraic_geometry.function_field from "leanprover-community/mathlib"@"d39590fc8728fbf6743249802486f8c91ffe07bc"
-- Explicit universe annotations were used in this file to improve perfomance #12737
set_option linter.uppercaseLean3 false
universe u v
open TopologicalSpace Opposite CategoryTheory CategoryTheory.Limits TopCat
namespace AlgebraicGeometry
variable (X : Scheme)
noncomputable abbrev Scheme.functionField [IrreducibleSpace X.carrier] : CommRingCat :=
X.presheaf.stalk (genericPoint X.carrier)
#align algebraic_geometry.Scheme.function_field AlgebraicGeometry.Scheme.functionField
noncomputable abbrev Scheme.germToFunctionField [IrreducibleSpace X.carrier] (U : Opens X.carrier)
[h : Nonempty U] : X.presheaf.obj (op U) ⟶ X.functionField :=
X.presheaf.germ
⟨genericPoint X.carrier,
((genericPoint_spec X.carrier).mem_open_set_iff U.isOpen).mpr (by simpa using h)⟩
#align algebraic_geometry.Scheme.germ_to_function_field AlgebraicGeometry.Scheme.germToFunctionField
noncomputable instance [IrreducibleSpace X.carrier] (U : Opens X.carrier) [Nonempty U] :
Algebra (X.presheaf.obj (op U)) X.functionField :=
(X.germToFunctionField U).toAlgebra
noncomputable instance [IsIntegral X] : Field X.functionField := by
refine .ofIsUnitOrEqZero fun a ↦ ?_
obtain ⟨U, m, s, rfl⟩ := TopCat.Presheaf.germ_exist _ _ a
rw [or_iff_not_imp_right, ← (X.presheaf.germ ⟨_, m⟩).map_zero]
intro ha
replace ha := ne_of_apply_ne _ ha
have hs : genericPoint X.carrier ∈ RingedSpace.basicOpen _ s := by
rw [← SetLike.mem_coe, (genericPoint_spec X.carrier).mem_open_set_iff, Set.top_eq_univ,
Set.univ_inter, Set.nonempty_iff_ne_empty, Ne, ← Opens.coe_bot, ← SetLike.ext'_iff]
· erw [basicOpen_eq_bot_iff]
exact ha
· exact (RingedSpace.basicOpen _ _).isOpen
have := (X.presheaf.germ ⟨_, hs⟩).isUnit_map (RingedSpace.isUnit_res_basicOpen _ s)
rwa [TopCat.Presheaf.germ_res_apply] at this
theorem germ_injective_of_isIntegral [IsIntegral X] {U : Opens X.carrier} (x : U) :
Function.Injective (X.presheaf.germ x) := by
rw [injective_iff_map_eq_zero]
intro y hy
rw [← (X.presheaf.germ x).map_zero] at hy
obtain ⟨W, hW, iU, iV, e⟩ := X.presheaf.germ_eq _ x.prop x.prop _ _ hy
cases Subsingleton.elim iU iV
haveI : Nonempty W := ⟨⟨_, hW⟩⟩
exact map_injective_of_isIntegral X iU e
#align algebraic_geometry.germ_injective_of_is_integral AlgebraicGeometry.germ_injective_of_isIntegral
theorem Scheme.germToFunctionField_injective [IsIntegral X] (U : Opens X.carrier) [Nonempty U] :
Function.Injective (X.germToFunctionField U) :=
germ_injective_of_isIntegral _ _
#align algebraic_geometry.Scheme.germ_to_function_field_injective AlgebraicGeometry.Scheme.germToFunctionField_injective
| Mathlib/AlgebraicGeometry/FunctionField.lean | 83 | 93 | theorem genericPoint_eq_of_isOpenImmersion {X Y : Scheme} (f : X ⟶ Y) [H : IsOpenImmersion f]
[hX : IrreducibleSpace X.carrier] [IrreducibleSpace Y.carrier] :
f.1.base (genericPoint X.carrier : _) = (genericPoint Y.carrier : _) := by |
apply ((genericPoint_spec Y).eq _).symm
convert (genericPoint_spec X.carrier).image (show Continuous f.1.base by continuity)
symm
rw [eq_top_iff, Set.top_eq_univ, Set.top_eq_univ]
convert subset_closure_inter_of_isPreirreducible_of_isOpen _ H.base_open.isOpen_range _
· rw [Set.univ_inter, Set.image_univ]
· apply PreirreducibleSpace.isPreirreducible_univ (X := Y.carrier)
· exact ⟨_, trivial, Set.mem_range_self hX.2.some⟩
| 1,733 |
import Mathlib.AlgebraicGeometry.Properties
#align_import algebraic_geometry.function_field from "leanprover-community/mathlib"@"d39590fc8728fbf6743249802486f8c91ffe07bc"
-- Explicit universe annotations were used in this file to improve perfomance #12737
set_option linter.uppercaseLean3 false
universe u v
open TopologicalSpace Opposite CategoryTheory CategoryTheory.Limits TopCat
namespace AlgebraicGeometry
variable (X : Scheme)
noncomputable abbrev Scheme.functionField [IrreducibleSpace X.carrier] : CommRingCat :=
X.presheaf.stalk (genericPoint X.carrier)
#align algebraic_geometry.Scheme.function_field AlgebraicGeometry.Scheme.functionField
noncomputable abbrev Scheme.germToFunctionField [IrreducibleSpace X.carrier] (U : Opens X.carrier)
[h : Nonempty U] : X.presheaf.obj (op U) ⟶ X.functionField :=
X.presheaf.germ
⟨genericPoint X.carrier,
((genericPoint_spec X.carrier).mem_open_set_iff U.isOpen).mpr (by simpa using h)⟩
#align algebraic_geometry.Scheme.germ_to_function_field AlgebraicGeometry.Scheme.germToFunctionField
noncomputable instance [IrreducibleSpace X.carrier] (U : Opens X.carrier) [Nonempty U] :
Algebra (X.presheaf.obj (op U)) X.functionField :=
(X.germToFunctionField U).toAlgebra
noncomputable instance [IsIntegral X] : Field X.functionField := by
refine .ofIsUnitOrEqZero fun a ↦ ?_
obtain ⟨U, m, s, rfl⟩ := TopCat.Presheaf.germ_exist _ _ a
rw [or_iff_not_imp_right, ← (X.presheaf.germ ⟨_, m⟩).map_zero]
intro ha
replace ha := ne_of_apply_ne _ ha
have hs : genericPoint X.carrier ∈ RingedSpace.basicOpen _ s := by
rw [← SetLike.mem_coe, (genericPoint_spec X.carrier).mem_open_set_iff, Set.top_eq_univ,
Set.univ_inter, Set.nonempty_iff_ne_empty, Ne, ← Opens.coe_bot, ← SetLike.ext'_iff]
· erw [basicOpen_eq_bot_iff]
exact ha
· exact (RingedSpace.basicOpen _ _).isOpen
have := (X.presheaf.germ ⟨_, hs⟩).isUnit_map (RingedSpace.isUnit_res_basicOpen _ s)
rwa [TopCat.Presheaf.germ_res_apply] at this
theorem germ_injective_of_isIntegral [IsIntegral X] {U : Opens X.carrier} (x : U) :
Function.Injective (X.presheaf.germ x) := by
rw [injective_iff_map_eq_zero]
intro y hy
rw [← (X.presheaf.germ x).map_zero] at hy
obtain ⟨W, hW, iU, iV, e⟩ := X.presheaf.germ_eq _ x.prop x.prop _ _ hy
cases Subsingleton.elim iU iV
haveI : Nonempty W := ⟨⟨_, hW⟩⟩
exact map_injective_of_isIntegral X iU e
#align algebraic_geometry.germ_injective_of_is_integral AlgebraicGeometry.germ_injective_of_isIntegral
theorem Scheme.germToFunctionField_injective [IsIntegral X] (U : Opens X.carrier) [Nonempty U] :
Function.Injective (X.germToFunctionField U) :=
germ_injective_of_isIntegral _ _
#align algebraic_geometry.Scheme.germ_to_function_field_injective AlgebraicGeometry.Scheme.germToFunctionField_injective
theorem genericPoint_eq_of_isOpenImmersion {X Y : Scheme} (f : X ⟶ Y) [H : IsOpenImmersion f]
[hX : IrreducibleSpace X.carrier] [IrreducibleSpace Y.carrier] :
f.1.base (genericPoint X.carrier : _) = (genericPoint Y.carrier : _) := by
apply ((genericPoint_spec Y).eq _).symm
convert (genericPoint_spec X.carrier).image (show Continuous f.1.base by continuity)
symm
rw [eq_top_iff, Set.top_eq_univ, Set.top_eq_univ]
convert subset_closure_inter_of_isPreirreducible_of_isOpen _ H.base_open.isOpen_range _
· rw [Set.univ_inter, Set.image_univ]
· apply PreirreducibleSpace.isPreirreducible_univ (X := Y.carrier)
· exact ⟨_, trivial, Set.mem_range_self hX.2.some⟩
#align algebraic_geometry.generic_point_eq_of_is_open_immersion AlgebraicGeometry.genericPoint_eq_of_isOpenImmersion
noncomputable instance stalkFunctionFieldAlgebra [IrreducibleSpace X.carrier] (x : X.carrier) :
Algebra (X.presheaf.stalk x) X.functionField := by
apply RingHom.toAlgebra
exact X.presheaf.stalkSpecializes ((genericPoint_spec X.carrier).specializes trivial)
#align algebraic_geometry.stalk_function_field_algebra AlgebraicGeometry.stalkFunctionFieldAlgebra
instance functionField_isScalarTower [IrreducibleSpace X.carrier] (U : Opens X.carrier) (x : U)
[Nonempty U] : IsScalarTower (X.presheaf.obj <| op U) (X.presheaf.stalk x) X.functionField := by
apply IsScalarTower.of_algebraMap_eq'
simp_rw [RingHom.algebraMap_toAlgebra]
change _ = X.presheaf.germ x ≫ _
rw [X.presheaf.germ_stalkSpecializes]
#align algebraic_geometry.function_field_is_scalar_tower AlgebraicGeometry.functionField_isScalarTower
noncomputable instance (R : CommRingCat.{u}) [IsDomain R] :
Algebra R (Scheme.Spec.obj <| op R).functionField :=
RingHom.toAlgebra <| by change CommRingCat.of R ⟶ _; apply StructureSheaf.toStalk
@[simp]
| Mathlib/AlgebraicGeometry/FunctionField.lean | 115 | 121 | theorem genericPoint_eq_bot_of_affine (R : CommRingCat) [IsDomain R] :
genericPoint (Scheme.Spec.obj <| op R).carrier = (⟨0, Ideal.bot_prime⟩ : PrimeSpectrum R) := by |
apply (genericPoint_spec (Scheme.Spec.obj <| op R).carrier).eq
rw [isGenericPoint_def]
rw [← PrimeSpectrum.zeroLocus_vanishingIdeal_eq_closure, PrimeSpectrum.vanishingIdeal_singleton]
rw [Set.top_eq_univ, ← PrimeSpectrum.zeroLocus_singleton_zero]
simp_rw [Submodule.zero_eq_bot, Submodule.bot_coe]
| 1,733 |
import Mathlib.RingTheory.LocalProperties
#align_import ring_theory.ring_hom.surjective from "leanprover-community/mathlib"@"831c494092374cfe9f50591ed0ac81a25efc5b86"
namespace RingHom
open scoped TensorProduct
open TensorProduct Algebra.TensorProduct
local notation "surjective" => fun {X Y : Type _} [CommRing X] [CommRing Y] => fun f : X →+* Y =>
Function.Surjective f
| Mathlib/RingTheory/RingHom/Surjective.lean | 26 | 27 | theorem surjective_stableUnderComposition : StableUnderComposition surjective := by |
introv R hf hg; exact hg.comp hf
| 1,734 |
import Mathlib.RingTheory.LocalProperties
#align_import ring_theory.ring_hom.surjective from "leanprover-community/mathlib"@"831c494092374cfe9f50591ed0ac81a25efc5b86"
namespace RingHom
open scoped TensorProduct
open TensorProduct Algebra.TensorProduct
local notation "surjective" => fun {X Y : Type _} [CommRing X] [CommRing Y] => fun f : X →+* Y =>
Function.Surjective f
theorem surjective_stableUnderComposition : StableUnderComposition surjective := by
introv R hf hg; exact hg.comp hf
#align ring_hom.surjective_stable_under_composition RingHom.surjective_stableUnderComposition
| Mathlib/RingTheory/RingHom/Surjective.lean | 30 | 33 | theorem surjective_respectsIso : RespectsIso surjective := by |
apply surjective_stableUnderComposition.respectsIso
intros _ _ _ _ e
exact e.surjective
| 1,734 |
import Mathlib.RingTheory.LocalProperties
#align_import ring_theory.ring_hom.surjective from "leanprover-community/mathlib"@"831c494092374cfe9f50591ed0ac81a25efc5b86"
namespace RingHom
open scoped TensorProduct
open TensorProduct Algebra.TensorProduct
local notation "surjective" => fun {X Y : Type _} [CommRing X] [CommRing Y] => fun f : X →+* Y =>
Function.Surjective f
theorem surjective_stableUnderComposition : StableUnderComposition surjective := by
introv R hf hg; exact hg.comp hf
#align ring_hom.surjective_stable_under_composition RingHom.surjective_stableUnderComposition
theorem surjective_respectsIso : RespectsIso surjective := by
apply surjective_stableUnderComposition.respectsIso
intros _ _ _ _ e
exact e.surjective
#align ring_hom.surjective_respects_iso RingHom.surjective_respectsIso
| Mathlib/RingTheory/RingHom/Surjective.lean | 36 | 45 | theorem surjective_stableUnderBaseChange : StableUnderBaseChange surjective := by |
refine StableUnderBaseChange.mk _ surjective_respectsIso ?_
classical
introv h x
induction x using TensorProduct.induction_on with
| zero => exact ⟨0, map_zero _⟩
| tmul x y =>
obtain ⟨y, rfl⟩ := h y; use y • x; dsimp
rw [TensorProduct.smul_tmul, Algebra.algebraMap_eq_smul_one]
| add x y ex ey => obtain ⟨⟨x, rfl⟩, ⟨y, rfl⟩⟩ := ex, ey; exact ⟨x + y, map_add _ x y⟩
| 1,734 |
import Mathlib.RingTheory.LocalProperties
#align_import ring_theory.ring_hom.surjective from "leanprover-community/mathlib"@"831c494092374cfe9f50591ed0ac81a25efc5b86"
namespace RingHom
open scoped TensorProduct
open TensorProduct Algebra.TensorProduct
local notation "surjective" => fun {X Y : Type _} [CommRing X] [CommRing Y] => fun f : X →+* Y =>
Function.Surjective f
theorem surjective_stableUnderComposition : StableUnderComposition surjective := by
introv R hf hg; exact hg.comp hf
#align ring_hom.surjective_stable_under_composition RingHom.surjective_stableUnderComposition
theorem surjective_respectsIso : RespectsIso surjective := by
apply surjective_stableUnderComposition.respectsIso
intros _ _ _ _ e
exact e.surjective
#align ring_hom.surjective_respects_iso RingHom.surjective_respectsIso
theorem surjective_stableUnderBaseChange : StableUnderBaseChange surjective := by
refine StableUnderBaseChange.mk _ surjective_respectsIso ?_
classical
introv h x
induction x using TensorProduct.induction_on with
| zero => exact ⟨0, map_zero _⟩
| tmul x y =>
obtain ⟨y, rfl⟩ := h y; use y • x; dsimp
rw [TensorProduct.smul_tmul, Algebra.algebraMap_eq_smul_one]
| add x y ex ey => obtain ⟨⟨x, rfl⟩, ⟨y, rfl⟩⟩ := ex, ey; exact ⟨x + y, map_add _ x y⟩
#align ring_hom.surjective_stable_under_base_change RingHom.surjective_stableUnderBaseChange
| Mathlib/RingTheory/RingHom/Surjective.lean | 48 | 70 | theorem surjective_ofLocalizationSpan : OfLocalizationSpan surjective := by |
introv R hs H
letI := f.toAlgebra
show Function.Surjective (Algebra.ofId R S)
rw [← Algebra.range_top_iff_surjective, eq_top_iff]
rintro x -
obtain ⟨l, hl⟩ :=
(Finsupp.mem_span_iff_total R s 1).mp (show _ ∈ Ideal.span s by rw [hs]; trivial)
fapply
Subalgebra.mem_of_finset_sum_eq_one_of_pow_smul_mem _ l.support (fun x : s => f x) fun x : s =>
f (l x)
· simp_rw [← _root_.map_mul, ← map_sum, ← f.map_one]; exact f.congr_arg hl
· exact fun _ => Set.mem_range_self _
· exact fun _ => Set.mem_range_self _
· intro r
obtain ⟨y, hy⟩ := H r (IsLocalization.mk' _ x (1 : Submonoid.powers (f r)))
obtain ⟨z, ⟨_, n, rfl⟩, rfl⟩ := IsLocalization.mk'_surjective (Submonoid.powers (r : R)) y
erw [IsLocalization.map_mk', IsLocalization.eq] at hy
obtain ⟨⟨_, m, rfl⟩, hm⟩ := hy
refine ⟨m + n, ?_⟩
dsimp at hm ⊢
simp_rw [_root_.one_mul, ← _root_.mul_assoc, ← map_pow, ← f.map_mul, ← pow_add, map_pow] at hm
exact ⟨_, hm⟩
| 1,734 |
import Mathlib.AlgebraicGeometry.Morphisms.Basic
import Mathlib.RingTheory.LocalProperties
#align_import algebraic_geometry.morphisms.ring_hom_properties from "leanprover-community/mathlib"@"d39590fc8728fbf6743249802486f8c91ffe07bc"
-- Explicit universe annotations were used in this file to improve perfomance #12737
universe u
open CategoryTheory Opposite TopologicalSpace CategoryTheory.Limits AlgebraicGeometry
variable (P : ∀ {R S : Type u} [CommRing R] [CommRing S], (R →+* S) → Prop)
namespace RingHom
variable {P}
| Mathlib/AlgebraicGeometry/Morphisms/RingHomProperties.lean | 48 | 70 | theorem RespectsIso.basicOpen_iff (hP : RespectsIso @P) {X Y : Scheme.{u}} [IsAffine X] [IsAffine Y]
(f : X ⟶ Y) (r : Y.presheaf.obj (Opposite.op ⊤)) :
P (Scheme.Γ.map (f ∣_ Y.basicOpen r).op) ↔
P (@IsLocalization.Away.map (Y.presheaf.obj (Opposite.op ⊤)) _
(Y.presheaf.obj (Opposite.op <| Y.basicOpen r)) _ _ (X.presheaf.obj (Opposite.op ⊤)) _
(X.presheaf.obj (Opposite.op <| X.basicOpen (Scheme.Γ.map f.op r))) _ _
(Scheme.Γ.map f.op) r _ <| @isLocalization_away_of_isAffine X _ (Scheme.Γ.map f.op r)) := by |
rw [Γ_map_morphismRestrict, hP.cancel_left_isIso, hP.cancel_right_isIso,
← hP.cancel_right_isIso (f.val.c.app (Opposite.op (Y.basicOpen r)))
(X.presheaf.map (eqToHom (Scheme.preimage_basicOpen f r).symm).op), ← eq_iff_iff]
congr
delta IsLocalization.Away.map
refine IsLocalization.ringHom_ext (Submonoid.powers r) ?_
generalize_proofs
haveI i1 := @isLocalization_away_of_isAffine X _ (Scheme.Γ.map f.op r)
-- Porting note: needs to be very explicit here
convert
(@IsLocalization.map_comp (hy := ‹_ ≤ _›) (Y.presheaf.obj <| Opposite.op (Scheme.basicOpen Y r))
_ _ (isLocalization_away_of_isAffine _) _ _ _ i1).symm using 1
change Y.presheaf.map _ ≫ _ = _ ≫ X.presheaf.map _
rw [f.val.c.naturality_assoc]
simp only [TopCat.Presheaf.pushforwardObj_map, ← X.presheaf.map_comp]
congr 1
| 1,735 |
import Mathlib.AlgebraicGeometry.Morphisms.Basic
import Mathlib.RingTheory.LocalProperties
#align_import algebraic_geometry.morphisms.ring_hom_properties from "leanprover-community/mathlib"@"d39590fc8728fbf6743249802486f8c91ffe07bc"
-- Explicit universe annotations were used in this file to improve perfomance #12737
universe u
open CategoryTheory Opposite TopologicalSpace CategoryTheory.Limits AlgebraicGeometry
variable (P : ∀ {R S : Type u} [CommRing R] [CommRing S], (R →+* S) → Prop)
namespace RingHom
variable {P}
theorem RespectsIso.basicOpen_iff (hP : RespectsIso @P) {X Y : Scheme.{u}} [IsAffine X] [IsAffine Y]
(f : X ⟶ Y) (r : Y.presheaf.obj (Opposite.op ⊤)) :
P (Scheme.Γ.map (f ∣_ Y.basicOpen r).op) ↔
P (@IsLocalization.Away.map (Y.presheaf.obj (Opposite.op ⊤)) _
(Y.presheaf.obj (Opposite.op <| Y.basicOpen r)) _ _ (X.presheaf.obj (Opposite.op ⊤)) _
(X.presheaf.obj (Opposite.op <| X.basicOpen (Scheme.Γ.map f.op r))) _ _
(Scheme.Γ.map f.op) r _ <| @isLocalization_away_of_isAffine X _ (Scheme.Γ.map f.op r)) := by
rw [Γ_map_morphismRestrict, hP.cancel_left_isIso, hP.cancel_right_isIso,
← hP.cancel_right_isIso (f.val.c.app (Opposite.op (Y.basicOpen r)))
(X.presheaf.map (eqToHom (Scheme.preimage_basicOpen f r).symm).op), ← eq_iff_iff]
congr
delta IsLocalization.Away.map
refine IsLocalization.ringHom_ext (Submonoid.powers r) ?_
generalize_proofs
haveI i1 := @isLocalization_away_of_isAffine X _ (Scheme.Γ.map f.op r)
-- Porting note: needs to be very explicit here
convert
(@IsLocalization.map_comp (hy := ‹_ ≤ _›) (Y.presheaf.obj <| Opposite.op (Scheme.basicOpen Y r))
_ _ (isLocalization_away_of_isAffine _) _ _ _ i1).symm using 1
change Y.presheaf.map _ ≫ _ = _ ≫ X.presheaf.map _
rw [f.val.c.naturality_assoc]
simp only [TopCat.Presheaf.pushforwardObj_map, ← X.presheaf.map_comp]
congr 1
#align ring_hom.respects_iso.basic_open_iff RingHom.RespectsIso.basicOpen_iff
| Mathlib/AlgebraicGeometry/Morphisms/RingHomProperties.lean | 73 | 80 | theorem RespectsIso.basicOpen_iff_localization (hP : RespectsIso @P) {X Y : Scheme.{u}} [IsAffine X]
[IsAffine Y] (f : X ⟶ Y) (r : Y.presheaf.obj (Opposite.op ⊤)) :
P (Scheme.Γ.map (f ∣_ Y.basicOpen r).op) ↔ P (Localization.awayMap (Scheme.Γ.map f.op) r) := by |
refine (hP.basicOpen_iff _ _).trans ?_
-- Porting note: was a one line term mode proof, but this `dsimp` is vital so the term mode
-- one liner is not possible
dsimp
rw [← hP.is_localization_away_iff]
| 1,735 |
import Mathlib.AlgebraicGeometry.Morphisms.Basic
import Mathlib.RingTheory.LocalProperties
#align_import algebraic_geometry.morphisms.ring_hom_properties from "leanprover-community/mathlib"@"d39590fc8728fbf6743249802486f8c91ffe07bc"
-- Explicit universe annotations were used in this file to improve perfomance #12737
universe u
open CategoryTheory Opposite TopologicalSpace CategoryTheory.Limits AlgebraicGeometry
variable (P : ∀ {R S : Type u} [CommRing R] [CommRing S], (R →+* S) → Prop)
namespace RingHom
variable {P}
theorem RespectsIso.basicOpen_iff (hP : RespectsIso @P) {X Y : Scheme.{u}} [IsAffine X] [IsAffine Y]
(f : X ⟶ Y) (r : Y.presheaf.obj (Opposite.op ⊤)) :
P (Scheme.Γ.map (f ∣_ Y.basicOpen r).op) ↔
P (@IsLocalization.Away.map (Y.presheaf.obj (Opposite.op ⊤)) _
(Y.presheaf.obj (Opposite.op <| Y.basicOpen r)) _ _ (X.presheaf.obj (Opposite.op ⊤)) _
(X.presheaf.obj (Opposite.op <| X.basicOpen (Scheme.Γ.map f.op r))) _ _
(Scheme.Γ.map f.op) r _ <| @isLocalization_away_of_isAffine X _ (Scheme.Γ.map f.op r)) := by
rw [Γ_map_morphismRestrict, hP.cancel_left_isIso, hP.cancel_right_isIso,
← hP.cancel_right_isIso (f.val.c.app (Opposite.op (Y.basicOpen r)))
(X.presheaf.map (eqToHom (Scheme.preimage_basicOpen f r).symm).op), ← eq_iff_iff]
congr
delta IsLocalization.Away.map
refine IsLocalization.ringHom_ext (Submonoid.powers r) ?_
generalize_proofs
haveI i1 := @isLocalization_away_of_isAffine X _ (Scheme.Γ.map f.op r)
-- Porting note: needs to be very explicit here
convert
(@IsLocalization.map_comp (hy := ‹_ ≤ _›) (Y.presheaf.obj <| Opposite.op (Scheme.basicOpen Y r))
_ _ (isLocalization_away_of_isAffine _) _ _ _ i1).symm using 1
change Y.presheaf.map _ ≫ _ = _ ≫ X.presheaf.map _
rw [f.val.c.naturality_assoc]
simp only [TopCat.Presheaf.pushforwardObj_map, ← X.presheaf.map_comp]
congr 1
#align ring_hom.respects_iso.basic_open_iff RingHom.RespectsIso.basicOpen_iff
theorem RespectsIso.basicOpen_iff_localization (hP : RespectsIso @P) {X Y : Scheme.{u}} [IsAffine X]
[IsAffine Y] (f : X ⟶ Y) (r : Y.presheaf.obj (Opposite.op ⊤)) :
P (Scheme.Γ.map (f ∣_ Y.basicOpen r).op) ↔ P (Localization.awayMap (Scheme.Γ.map f.op) r) := by
refine (hP.basicOpen_iff _ _).trans ?_
-- Porting note: was a one line term mode proof, but this `dsimp` is vital so the term mode
-- one liner is not possible
dsimp
rw [← hP.is_localization_away_iff]
#align ring_hom.respects_iso.basic_open_iff_localization RingHom.RespectsIso.basicOpen_iff_localization
@[deprecated (since := "2024-03-02")] alias
RespectsIso.ofRestrict_morphismRestrict_iff_of_isAffine := RespectsIso.basicOpen_iff_localization
| Mathlib/AlgebraicGeometry/Morphisms/RingHomProperties.lean | 86 | 102 | theorem RespectsIso.ofRestrict_morphismRestrict_iff (hP : RingHom.RespectsIso @P) {X Y : Scheme.{u}}
[IsAffine Y] (f : X ⟶ Y) (r : Y.presheaf.obj (Opposite.op ⊤)) (U : Opens X.carrier)
(hU : IsAffineOpen U) {V : Opens _}
(e : V = (Scheme.ιOpens <| f ⁻¹ᵁ Y.basicOpen r) ⁻¹ᵁ U) :
P (Scheme.Γ.map (Scheme.ιOpens V ≫ f ∣_ Y.basicOpen r).op) ↔
P (Localization.awayMap (Scheme.Γ.map (Scheme.ιOpens U ≫ f).op) r) := by |
subst e
refine (hP.cancel_right_isIso _
(Scheme.Γ.mapIso (Scheme.restrictRestrictComm _ _ _).op).inv).symm.trans ?_
haveI : IsAffine _ := hU
rw [← hP.basicOpen_iff_localization, iff_iff_eq]
congr 1
simp only [Functor.mapIso_inv, Iso.op_inv, ← Functor.map_comp, ← op_comp, morphismRestrict_comp]
rw [← Category.assoc]
congr 3
rw [← cancel_mono (Scheme.ιOpens _), Category.assoc, Scheme.restrictRestrictComm,
IsOpenImmersion.isoOfRangeEq_inv_fac, morphismRestrict_ι]
| 1,735 |
import Mathlib.AlgebraicGeometry.Morphisms.Basic
import Mathlib.RingTheory.LocalProperties
#align_import algebraic_geometry.morphisms.ring_hom_properties from "leanprover-community/mathlib"@"d39590fc8728fbf6743249802486f8c91ffe07bc"
-- Explicit universe annotations were used in this file to improve perfomance #12737
universe u
open CategoryTheory Opposite TopologicalSpace CategoryTheory.Limits AlgebraicGeometry
variable (P : ∀ {R S : Type u} [CommRing R] [CommRing S], (R →+* S) → Prop)
namespace RingHom
variable {P}
theorem RespectsIso.basicOpen_iff (hP : RespectsIso @P) {X Y : Scheme.{u}} [IsAffine X] [IsAffine Y]
(f : X ⟶ Y) (r : Y.presheaf.obj (Opposite.op ⊤)) :
P (Scheme.Γ.map (f ∣_ Y.basicOpen r).op) ↔
P (@IsLocalization.Away.map (Y.presheaf.obj (Opposite.op ⊤)) _
(Y.presheaf.obj (Opposite.op <| Y.basicOpen r)) _ _ (X.presheaf.obj (Opposite.op ⊤)) _
(X.presheaf.obj (Opposite.op <| X.basicOpen (Scheme.Γ.map f.op r))) _ _
(Scheme.Γ.map f.op) r _ <| @isLocalization_away_of_isAffine X _ (Scheme.Γ.map f.op r)) := by
rw [Γ_map_morphismRestrict, hP.cancel_left_isIso, hP.cancel_right_isIso,
← hP.cancel_right_isIso (f.val.c.app (Opposite.op (Y.basicOpen r)))
(X.presheaf.map (eqToHom (Scheme.preimage_basicOpen f r).symm).op), ← eq_iff_iff]
congr
delta IsLocalization.Away.map
refine IsLocalization.ringHom_ext (Submonoid.powers r) ?_
generalize_proofs
haveI i1 := @isLocalization_away_of_isAffine X _ (Scheme.Γ.map f.op r)
-- Porting note: needs to be very explicit here
convert
(@IsLocalization.map_comp (hy := ‹_ ≤ _›) (Y.presheaf.obj <| Opposite.op (Scheme.basicOpen Y r))
_ _ (isLocalization_away_of_isAffine _) _ _ _ i1).symm using 1
change Y.presheaf.map _ ≫ _ = _ ≫ X.presheaf.map _
rw [f.val.c.naturality_assoc]
simp only [TopCat.Presheaf.pushforwardObj_map, ← X.presheaf.map_comp]
congr 1
#align ring_hom.respects_iso.basic_open_iff RingHom.RespectsIso.basicOpen_iff
theorem RespectsIso.basicOpen_iff_localization (hP : RespectsIso @P) {X Y : Scheme.{u}} [IsAffine X]
[IsAffine Y] (f : X ⟶ Y) (r : Y.presheaf.obj (Opposite.op ⊤)) :
P (Scheme.Γ.map (f ∣_ Y.basicOpen r).op) ↔ P (Localization.awayMap (Scheme.Γ.map f.op) r) := by
refine (hP.basicOpen_iff _ _).trans ?_
-- Porting note: was a one line term mode proof, but this `dsimp` is vital so the term mode
-- one liner is not possible
dsimp
rw [← hP.is_localization_away_iff]
#align ring_hom.respects_iso.basic_open_iff_localization RingHom.RespectsIso.basicOpen_iff_localization
@[deprecated (since := "2024-03-02")] alias
RespectsIso.ofRestrict_morphismRestrict_iff_of_isAffine := RespectsIso.basicOpen_iff_localization
theorem RespectsIso.ofRestrict_morphismRestrict_iff (hP : RingHom.RespectsIso @P) {X Y : Scheme.{u}}
[IsAffine Y] (f : X ⟶ Y) (r : Y.presheaf.obj (Opposite.op ⊤)) (U : Opens X.carrier)
(hU : IsAffineOpen U) {V : Opens _}
(e : V = (Scheme.ιOpens <| f ⁻¹ᵁ Y.basicOpen r) ⁻¹ᵁ U) :
P (Scheme.Γ.map (Scheme.ιOpens V ≫ f ∣_ Y.basicOpen r).op) ↔
P (Localization.awayMap (Scheme.Γ.map (Scheme.ιOpens U ≫ f).op) r) := by
subst e
refine (hP.cancel_right_isIso _
(Scheme.Γ.mapIso (Scheme.restrictRestrictComm _ _ _).op).inv).symm.trans ?_
haveI : IsAffine _ := hU
rw [← hP.basicOpen_iff_localization, iff_iff_eq]
congr 1
simp only [Functor.mapIso_inv, Iso.op_inv, ← Functor.map_comp, ← op_comp, morphismRestrict_comp]
rw [← Category.assoc]
congr 3
rw [← cancel_mono (Scheme.ιOpens _), Category.assoc, Scheme.restrictRestrictComm,
IsOpenImmersion.isoOfRangeEq_inv_fac, morphismRestrict_ι]
#align ring_hom.respects_iso.of_restrict_morphism_restrict_iff RingHom.RespectsIso.ofRestrict_morphismRestrict_iff
| Mathlib/AlgebraicGeometry/Morphisms/RingHomProperties.lean | 105 | 123 | theorem StableUnderBaseChange.Γ_pullback_fst (hP : StableUnderBaseChange @P) (hP' : RespectsIso @P)
{X Y S : Scheme} [IsAffine X] [IsAffine Y] [IsAffine S] (f : X ⟶ S) (g : Y ⟶ S)
(H : P (Scheme.Γ.map g.op)) : P (Scheme.Γ.map (pullback.fst : pullback f g ⟶ _).op) := by |
-- Porting note (#11224): change `rw` to `erw`
erw [← PreservesPullback.iso_inv_fst AffineScheme.forgetToScheme (AffineScheme.ofHom f)
(AffineScheme.ofHom g)]
rw [op_comp, Functor.map_comp, hP'.cancel_right_isIso, AffineScheme.forgetToScheme_map]
have :=
_root_.congr_arg Quiver.Hom.unop
(PreservesPullback.iso_hom_fst AffineScheme.Γ.rightOp (AffineScheme.ofHom f)
(AffineScheme.ofHom g))
simp only [Quiver.Hom.unop_op, Functor.rightOp_map, unop_comp] at this
delta AffineScheme.Γ at this
simp only [Quiver.Hom.unop_op, Functor.comp_map, AffineScheme.forgetToScheme_map,
Functor.op_map] at this
rw [← this, hP'.cancel_right_isIso,
← pushoutIsoUnopPullback_inl_hom (Quiver.Hom.unop _) (Quiver.Hom.unop _),
hP'.cancel_right_isIso]
exact hP.pushout_inl _ hP' _ _ H
| 1,735 |
import Mathlib.AlgebraicGeometry.Morphisms.Basic
import Mathlib.RingTheory.LocalProperties
#align_import algebraic_geometry.morphisms.ring_hom_properties from "leanprover-community/mathlib"@"d39590fc8728fbf6743249802486f8c91ffe07bc"
-- Explicit universe annotations were used in this file to improve perfomance #12737
universe u
open CategoryTheory Opposite TopologicalSpace CategoryTheory.Limits AlgebraicGeometry
variable (P : ∀ {R S : Type u} [CommRing R] [CommRing S], (R →+* S) → Prop)
namespace AlgebraicGeometry
def sourceAffineLocally : AffineTargetMorphismProperty := fun X _ f _ =>
∀ U : X.affineOpens, P (Scheme.Γ.map (X.ofRestrict U.1.openEmbedding ≫ f).op)
#align algebraic_geometry.source_affine_locally AlgebraicGeometry.sourceAffineLocally
abbrev affineLocally : MorphismProperty Scheme.{u} :=
targetAffineLocally (sourceAffineLocally @P)
#align algebraic_geometry.affine_locally AlgebraicGeometry.affineLocally
variable {P}
| Mathlib/AlgebraicGeometry/Morphisms/RingHomProperties.lean | 145 | 156 | theorem sourceAffineLocally_respectsIso (h₁ : RingHom.RespectsIso @P) :
(sourceAffineLocally @P).toProperty.RespectsIso := by |
apply AffineTargetMorphismProperty.respectsIso_mk
· introv H U
rw [← h₁.cancel_right_isIso _ (Scheme.Γ.map (Scheme.restrictMapIso e.inv U.1).hom.op), ←
Functor.map_comp, ← op_comp]
convert H ⟨_, U.prop.map_isIso e.inv⟩ using 3
rw [IsOpenImmersion.isoOfRangeEq_hom_fac_assoc, Category.assoc,
e.inv_hom_id_assoc]
· introv H U
rw [← Category.assoc, op_comp, Functor.map_comp, h₁.cancel_left_isIso]
exact H U
| 1,735 |
import Mathlib.AlgebraicGeometry.Morphisms.Basic
import Mathlib.RingTheory.LocalProperties
#align_import algebraic_geometry.morphisms.ring_hom_properties from "leanprover-community/mathlib"@"d39590fc8728fbf6743249802486f8c91ffe07bc"
-- Explicit universe annotations were used in this file to improve perfomance #12737
universe u
open CategoryTheory Opposite TopologicalSpace CategoryTheory.Limits AlgebraicGeometry
variable (P : ∀ {R S : Type u} [CommRing R] [CommRing S], (R →+* S) → Prop)
namespace AlgebraicGeometry
def sourceAffineLocally : AffineTargetMorphismProperty := fun X _ f _ =>
∀ U : X.affineOpens, P (Scheme.Γ.map (X.ofRestrict U.1.openEmbedding ≫ f).op)
#align algebraic_geometry.source_affine_locally AlgebraicGeometry.sourceAffineLocally
abbrev affineLocally : MorphismProperty Scheme.{u} :=
targetAffineLocally (sourceAffineLocally @P)
#align algebraic_geometry.affine_locally AlgebraicGeometry.affineLocally
variable {P}
theorem sourceAffineLocally_respectsIso (h₁ : RingHom.RespectsIso @P) :
(sourceAffineLocally @P).toProperty.RespectsIso := by
apply AffineTargetMorphismProperty.respectsIso_mk
· introv H U
rw [← h₁.cancel_right_isIso _ (Scheme.Γ.map (Scheme.restrictMapIso e.inv U.1).hom.op), ←
Functor.map_comp, ← op_comp]
convert H ⟨_, U.prop.map_isIso e.inv⟩ using 3
rw [IsOpenImmersion.isoOfRangeEq_hom_fac_assoc, Category.assoc,
e.inv_hom_id_assoc]
· introv H U
rw [← Category.assoc, op_comp, Functor.map_comp, h₁.cancel_left_isIso]
exact H U
#align algebraic_geometry.source_affine_locally_respects_iso AlgebraicGeometry.sourceAffineLocally_respectsIso
theorem affineLocally_respectsIso (h : RingHom.RespectsIso @P) : (affineLocally @P).RespectsIso :=
targetAffineLocally_respectsIso (sourceAffineLocally_respectsIso h)
#align algebraic_geometry.affine_locally_respects_iso AlgebraicGeometry.affineLocally_respectsIso
| Mathlib/AlgebraicGeometry/Morphisms/RingHomProperties.lean | 163 | 205 | theorem affineLocally_iff_affineOpens_le
(hP : RingHom.RespectsIso @P) {X Y : Scheme.{u}} (f : X ⟶ Y) :
affineLocally.{u} (@P) f ↔
∀ (U : Y.affineOpens) (V : X.affineOpens) (e : V.1 ≤ (Opens.map f.1.base).obj U.1),
P (Scheme.Hom.appLe f e) := by |
apply forall_congr'
intro U
delta sourceAffineLocally
simp_rw [op_comp, Scheme.Γ.map_comp, Γ_map_morphismRestrict, Category.assoc, Scheme.Γ_map_op,
hP.cancel_left_isIso (Y.presheaf.map (eqToHom _).op)]
constructor
· intro H V e
let U' := (Opens.map f.val.base).obj U.1
have e'' : (Scheme.Hom.opensFunctor (X.ofRestrict U'.openEmbedding)).obj
(X.ofRestrict U'.openEmbedding⁻¹ᵁ V) = V := by
ext1; refine Set.image_preimage_eq_inter_range.trans (Set.inter_eq_left.mpr ?_)
erw [Subtype.range_val]
exact e
have h : X.ofRestrict U'.openEmbedding ⁻¹ᵁ ↑V ∈ Scheme.affineOpens (X.restrict _) := by
apply (X.ofRestrict U'.openEmbedding).isAffineOpen_iff_of_isOpenImmersion.mp
-- Porting note: was convert V.2
rw [e'']
convert V.2
have := H ⟨(Opens.map (X.ofRestrict U'.openEmbedding).1.base).obj V.1, h⟩
rw [← hP.cancel_right_isIso _ (X.presheaf.map (eqToHom _)), Category.assoc,
← X.presheaf.map_comp]
· dsimp; convert this using 1
congr 1
rw [X.presheaf.map_comp]
swap
· dsimp only [Functor.op, unop_op]
rw [Opens.openEmbedding_obj_top]
congr 1
exact e''.symm
· simp only [Scheme.ofRestrict_val_c_app, Scheme.restrict_presheaf_map, ← X.presheaf.map_comp]
congr 1
· intro H V
specialize H ⟨_, V.2.imageIsOpenImmersion (X.ofRestrict _)⟩ (Subtype.coe_image_subset _ _)
rw [← hP.cancel_right_isIso _ (X.presheaf.map (eqToHom _)), Category.assoc]
· convert H
simp only [Scheme.ofRestrict_val_c_app, Scheme.restrict_presheaf_map, ← X.presheaf.map_comp]
congr 1
· dsimp only [Functor.op, unop_op]; rw [Opens.openEmbedding_obj_top]
| 1,735 |
import Mathlib.AlgebraicGeometry.Morphisms.RingHomProperties
import Mathlib.RingTheory.RingHom.FiniteType
#align_import algebraic_geometry.morphisms.finite_type from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
noncomputable section
open CategoryTheory CategoryTheory.Limits Opposite TopologicalSpace
universe v u
namespace AlgebraicGeometry
variable {X Y : Scheme.{u}} (f : X ⟶ Y)
@[mk_iff]
class LocallyOfFiniteType (f : X ⟶ Y) : Prop where
finiteType_of_affine_subset :
∀ (U : Y.affineOpens) (V : X.affineOpens) (e : V.1 ≤ (Opens.map f.1.base).obj U.1),
(Scheme.Hom.appLe f e).FiniteType
#align algebraic_geometry.locally_of_finite_type AlgebraicGeometry.LocallyOfFiniteType
| Mathlib/AlgebraicGeometry/Morphisms/FiniteType.lean | 44 | 47 | theorem locallyOfFiniteType_eq : @LocallyOfFiniteType = affineLocally @RingHom.FiniteType := by |
ext X Y f
rw [locallyOfFiniteType_iff, affineLocally_iff_affineOpens_le]
exact RingHom.finiteType_respectsIso
| 1,736 |
import Mathlib.AlgebraicGeometry.Morphisms.RingHomProperties
import Mathlib.RingTheory.RingHom.FiniteType
#align_import algebraic_geometry.morphisms.finite_type from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
noncomputable section
open CategoryTheory CategoryTheory.Limits Opposite TopologicalSpace
universe v u
namespace AlgebraicGeometry
variable {X Y : Scheme.{u}} (f : X ⟶ Y)
@[mk_iff]
class LocallyOfFiniteType (f : X ⟶ Y) : Prop where
finiteType_of_affine_subset :
∀ (U : Y.affineOpens) (V : X.affineOpens) (e : V.1 ≤ (Opens.map f.1.base).obj U.1),
(Scheme.Hom.appLe f e).FiniteType
#align algebraic_geometry.locally_of_finite_type AlgebraicGeometry.LocallyOfFiniteType
theorem locallyOfFiniteType_eq : @LocallyOfFiniteType = affineLocally @RingHom.FiniteType := by
ext X Y f
rw [locallyOfFiniteType_iff, affineLocally_iff_affineOpens_le]
exact RingHom.finiteType_respectsIso
#align algebraic_geometry.locally_of_finite_type_eq AlgebraicGeometry.locallyOfFiniteType_eq
instance (priority := 900) locallyOfFiniteTypeOfIsOpenImmersion {X Y : Scheme} (f : X ⟶ Y)
[IsOpenImmersion f] : LocallyOfFiniteType f :=
locallyOfFiniteType_eq.symm ▸ RingHom.finiteType_is_local.affineLocally_of_isOpenImmersion f
#align algebraic_geometry.locally_of_finite_type_of_is_open_immersion AlgebraicGeometry.locallyOfFiniteTypeOfIsOpenImmersion
instance locallyOfFiniteType_isStableUnderComposition :
MorphismProperty.IsStableUnderComposition @LocallyOfFiniteType :=
locallyOfFiniteType_eq.symm ▸ RingHom.finiteType_is_local.affineLocally_isStableUnderComposition
#align algebraic_geometry.locally_of_finite_type_stable_under_composition AlgebraicGeometry.locallyOfFiniteType_isStableUnderComposition
instance locallyOfFiniteTypeComp {X Y Z : Scheme} (f : X ⟶ Y) (g : Y ⟶ Z)
[hf : LocallyOfFiniteType f] [hg : LocallyOfFiniteType g] : LocallyOfFiniteType (f ≫ g) :=
MorphismProperty.comp_mem _ f g hf hg
#align algebraic_geometry.locally_of_finite_type_comp AlgebraicGeometry.locallyOfFiniteTypeComp
| Mathlib/AlgebraicGeometry/Morphisms/FiniteType.lean | 65 | 71 | theorem locallyOfFiniteTypeOfComp {X Y Z : Scheme} (f : X ⟶ Y) (g : Y ⟶ Z)
[hf : LocallyOfFiniteType (f ≫ g)] : LocallyOfFiniteType f := by |
revert hf
rw [locallyOfFiniteType_eq]
apply RingHom.finiteType_is_local.affineLocally_of_comp
introv H
exact RingHom.FiniteType.of_comp_finiteType H
| 1,736 |
import Mathlib.RingTheory.IsTensorProduct
import Mathlib.RingTheory.Localization.Module
variable {R : Type*} [CommSemiring R] (S : Submonoid R)
(A : Type*) [CommRing A] [Algebra R A] [IsLocalization S A]
{M : Type*} [AddCommMonoid M] [Module R M] [Module A M] [IsScalarTower R A M]
{M' : Type*} [AddCommMonoid M'] [Module R M'] [Module A M'] [IsScalarTower R A M']
(f : M →ₗ[R] M')
theorem IsLocalizedModule.isBaseChange [IsLocalizedModule S f] : IsBaseChange A f :=
.of_lift_unique _ fun Q _ _ _ _ g ↦ by
obtain ⟨ℓ, rfl, h₂⟩ := IsLocalizedModule.is_universal S f g fun s ↦ by
rw [← (Algebra.lsmul R (A := A) R Q).commutes]; exact (IsLocalization.map_units A s).map _
refine ⟨ℓ.extendScalarsOfIsLocalization S A, by simp, fun g'' h ↦ ?_⟩
cases h₂ (LinearMap.restrictScalars R g'') h; rfl
| Mathlib/RingTheory/Localization/BaseChange.lean | 41 | 49 | theorem isLocalizedModule_iff_isBaseChange : IsLocalizedModule S f ↔ IsBaseChange A f := by |
refine ⟨fun _ ↦ IsLocalizedModule.isBaseChange S A f, fun h ↦ ?_⟩
have : IsBaseChange A (LocalizedModule.mkLinearMap S M) := IsLocalizedModule.isBaseChange S A _
let e := (this.equiv.symm.trans h.equiv).restrictScalars R
convert IsLocalizedModule.of_linearEquiv S (LocalizedModule.mkLinearMap S M) e
ext
rw [LinearMap.coe_comp, LinearEquiv.coe_coe, Function.comp_apply,
LinearEquiv.restrictScalars_apply, LinearEquiv.trans_apply, IsBaseChange.equiv_symm_apply,
IsBaseChange.equiv_tmul, one_smul]
| 1,737 |
import Mathlib.RingTheory.Flat.Basic
import Mathlib.RingTheory.IsTensorProduct
import Mathlib.LinearAlgebra.TensorProduct.Tower
universe u v w t
open Function (Injective Surjective)
open LinearMap (lsmul rTensor lTensor)
open TensorProduct
namespace Module.Flat
section Composition
variable (R : Type u) (S : Type v) (M : Type w)
[CommRing R] [CommRing S] [Algebra R S]
[AddCommGroup M] [Module R M] [Module S M] [IsScalarTower R S M]
private noncomputable abbrev auxRightMul (I : Ideal R) : M ⊗[R] I →ₗ[S] M := by
letI i : M ⊗[R] I →ₗ[S] M ⊗[R] R := AlgebraTensorModule.map LinearMap.id I.subtype
letI e' : M ⊗[R] R →ₗ[S] M := AlgebraTensorModule.rid R S M
exact AlgebraTensorModule.rid R S M ∘ₗ i
private noncomputable abbrev J (I : Ideal R) : Ideal S := LinearMap.range (auxRightMul R S S I)
private noncomputable abbrev auxIso [Module.Flat R S] {I : Ideal R} :
S ⊗[R] I ≃ₗ[S] J R S I := by
apply LinearEquiv.ofInjective (auxRightMul R S S I)
simp only [LinearMap.coe_comp, LinearEquiv.coe_coe, EquivLike.comp_injective]
exact (Module.Flat.iff_lTensor_injective' R S).mp inferInstance I
private noncomputable abbrev auxLTensor [Module.Flat R S] (I : Ideal R) :
M ⊗[R] I →ₗ[S] M := by
letI e1 : M ⊗[R] I ≃ₗ[S] M ⊗[S] (S ⊗[R] I) :=
(AlgebraTensorModule.cancelBaseChange R S S M I).symm
letI e2 : M ⊗[S] (S ⊗[R] I) ≃ₗ[S] M ⊗[S] (J R S I) :=
TensorProduct.congr (LinearEquiv.refl S M) (auxIso R S)
letI e3 : M ⊗[S] (J R S I) →ₗ[S] M ⊗[S] S := lTensor M (J R S I).subtype
letI e4 : M ⊗[S] S →ₗ[S] M := TensorProduct.rid S M
exact e4 ∘ₗ e3 ∘ₗ (e1 ≪≫ₗ e2)
private lemma auxLTensor_eq [Module.Flat R S] {I : Ideal R} :
(auxLTensor R S M I : M ⊗[R] I →ₗ[R] M) =
TensorProduct.rid R M ∘ₗ lTensor M (I.subtype) := by
apply TensorProduct.ext'
intro m x
erw [TensorProduct.rid_tmul]
simp
| Mathlib/RingTheory/Flat/Stability.lean | 86 | 94 | theorem comp [Module.Flat R S] [Module.Flat S M] : Module.Flat R M := by |
rw [Module.Flat.iff_lTensor_injective']
intro I
rw [← EquivLike.comp_injective _ (TensorProduct.rid R M)]
haveI h : TensorProduct.rid R M ∘ lTensor M (Submodule.subtype I) =
TensorProduct.rid R M ∘ₗ lTensor M I.subtype := rfl
simp only [h, ← auxLTensor_eq R S M, LinearMap.coe_restrictScalars, LinearMap.coe_comp,
LinearEquiv.coe_coe, EquivLike.comp_injective, EquivLike.injective_comp]
exact (Module.Flat.iff_lTensor_injective' S M).mp inferInstance _
| 1,738 |
import Mathlib.Algebra.Exact
import Mathlib.RingTheory.TensorProduct.Basic
section Modules
open TensorProduct LinearMap
section Semiring
variable {R : Type*} [CommSemiring R] {M N P Q: Type*}
[AddCommMonoid M] [AddCommMonoid N] [AddCommMonoid P] [AddCommMonoid Q]
[Module R M] [Module R N] [Module R P] [Module R Q]
{f : M →ₗ[R] N} (g : N →ₗ[R] P)
lemma le_comap_range_lTensor (q : Q) :
LinearMap.range g ≤ (LinearMap.range (lTensor Q g)).comap (TensorProduct.mk R Q P q) := by
rintro x ⟨n, rfl⟩
exact ⟨q ⊗ₜ[R] n, rfl⟩
lemma le_comap_range_rTensor (q : Q) :
LinearMap.range g ≤ (LinearMap.range (rTensor Q g)).comap
((TensorProduct.mk R P Q).flip q) := by
rintro x ⟨n, rfl⟩
exact ⟨n ⊗ₜ[R] q, rfl⟩
variable (Q) {g}
| Mathlib/LinearAlgebra/TensorProduct/RightExactness.lean | 111 | 122 | theorem LinearMap.lTensor_surjective (hg : Function.Surjective g) :
Function.Surjective (lTensor Q g) := by |
intro z
induction z using TensorProduct.induction_on with
| zero => exact ⟨0, map_zero _⟩
| tmul q p =>
obtain ⟨n, rfl⟩ := hg p
exact ⟨q ⊗ₜ[R] n, rfl⟩
| add x y hx hy =>
obtain ⟨x, rfl⟩ := hx
obtain ⟨y, rfl⟩ := hy
exact ⟨x + y, map_add _ _ _⟩
| 1,739 |
import Mathlib.Algebra.Exact
import Mathlib.RingTheory.TensorProduct.Basic
section Modules
open TensorProduct LinearMap
section Semiring
variable {R : Type*} [CommSemiring R] {M N P Q: Type*}
[AddCommMonoid M] [AddCommMonoid N] [AddCommMonoid P] [AddCommMonoid Q]
[Module R M] [Module R N] [Module R P] [Module R Q]
{f : M →ₗ[R] N} (g : N →ₗ[R] P)
lemma le_comap_range_lTensor (q : Q) :
LinearMap.range g ≤ (LinearMap.range (lTensor Q g)).comap (TensorProduct.mk R Q P q) := by
rintro x ⟨n, rfl⟩
exact ⟨q ⊗ₜ[R] n, rfl⟩
lemma le_comap_range_rTensor (q : Q) :
LinearMap.range g ≤ (LinearMap.range (rTensor Q g)).comap
((TensorProduct.mk R P Q).flip q) := by
rintro x ⟨n, rfl⟩
exact ⟨n ⊗ₜ[R] q, rfl⟩
variable (Q) {g}
theorem LinearMap.lTensor_surjective (hg : Function.Surjective g) :
Function.Surjective (lTensor Q g) := by
intro z
induction z using TensorProduct.induction_on with
| zero => exact ⟨0, map_zero _⟩
| tmul q p =>
obtain ⟨n, rfl⟩ := hg p
exact ⟨q ⊗ₜ[R] n, rfl⟩
| add x y hx hy =>
obtain ⟨x, rfl⟩ := hx
obtain ⟨y, rfl⟩ := hy
exact ⟨x + y, map_add _ _ _⟩
| Mathlib/LinearAlgebra/TensorProduct/RightExactness.lean | 124 | 133 | theorem LinearMap.lTensor_range :
range (lTensor Q g) =
range (lTensor Q (Submodule.subtype (range g))) := by |
have : g = (Submodule.subtype _).comp g.rangeRestrict := rfl
nth_rewrite 1 [this]
rw [lTensor_comp]
apply range_comp_of_range_eq_top
rw [range_eq_top]
apply lTensor_surjective
rw [← range_eq_top, range_rangeRestrict]
| 1,739 |
import Mathlib.Algebra.Exact
import Mathlib.RingTheory.TensorProduct.Basic
section Modules
open TensorProduct LinearMap
section Semiring
variable {R : Type*} [CommSemiring R] {M N P Q: Type*}
[AddCommMonoid M] [AddCommMonoid N] [AddCommMonoid P] [AddCommMonoid Q]
[Module R M] [Module R N] [Module R P] [Module R Q]
{f : M →ₗ[R] N} (g : N →ₗ[R] P)
lemma le_comap_range_lTensor (q : Q) :
LinearMap.range g ≤ (LinearMap.range (lTensor Q g)).comap (TensorProduct.mk R Q P q) := by
rintro x ⟨n, rfl⟩
exact ⟨q ⊗ₜ[R] n, rfl⟩
lemma le_comap_range_rTensor (q : Q) :
LinearMap.range g ≤ (LinearMap.range (rTensor Q g)).comap
((TensorProduct.mk R P Q).flip q) := by
rintro x ⟨n, rfl⟩
exact ⟨n ⊗ₜ[R] q, rfl⟩
variable (Q) {g}
theorem LinearMap.lTensor_surjective (hg : Function.Surjective g) :
Function.Surjective (lTensor Q g) := by
intro z
induction z using TensorProduct.induction_on with
| zero => exact ⟨0, map_zero _⟩
| tmul q p =>
obtain ⟨n, rfl⟩ := hg p
exact ⟨q ⊗ₜ[R] n, rfl⟩
| add x y hx hy =>
obtain ⟨x, rfl⟩ := hx
obtain ⟨y, rfl⟩ := hy
exact ⟨x + y, map_add _ _ _⟩
theorem LinearMap.lTensor_range :
range (lTensor Q g) =
range (lTensor Q (Submodule.subtype (range g))) := by
have : g = (Submodule.subtype _).comp g.rangeRestrict := rfl
nth_rewrite 1 [this]
rw [lTensor_comp]
apply range_comp_of_range_eq_top
rw [range_eq_top]
apply lTensor_surjective
rw [← range_eq_top, range_rangeRestrict]
| Mathlib/LinearAlgebra/TensorProduct/RightExactness.lean | 136 | 147 | theorem LinearMap.rTensor_surjective (hg : Function.Surjective g) :
Function.Surjective (rTensor Q g) := by |
intro z
induction z using TensorProduct.induction_on with
| zero => exact ⟨0, map_zero _⟩
| tmul p q =>
obtain ⟨n, rfl⟩ := hg p
exact ⟨n ⊗ₜ[R] q, rfl⟩
| add x y hx hy =>
obtain ⟨x, rfl⟩ := hx
obtain ⟨y, rfl⟩ := hy
exact ⟨x + y, map_add _ _ _⟩
| 1,739 |
import Mathlib.Algebra.Exact
import Mathlib.RingTheory.TensorProduct.Basic
section Modules
open TensorProduct LinearMap
section Semiring
variable {R : Type*} [CommSemiring R] {M N P Q: Type*}
[AddCommMonoid M] [AddCommMonoid N] [AddCommMonoid P] [AddCommMonoid Q]
[Module R M] [Module R N] [Module R P] [Module R Q]
{f : M →ₗ[R] N} (g : N →ₗ[R] P)
lemma le_comap_range_lTensor (q : Q) :
LinearMap.range g ≤ (LinearMap.range (lTensor Q g)).comap (TensorProduct.mk R Q P q) := by
rintro x ⟨n, rfl⟩
exact ⟨q ⊗ₜ[R] n, rfl⟩
lemma le_comap_range_rTensor (q : Q) :
LinearMap.range g ≤ (LinearMap.range (rTensor Q g)).comap
((TensorProduct.mk R P Q).flip q) := by
rintro x ⟨n, rfl⟩
exact ⟨n ⊗ₜ[R] q, rfl⟩
variable (Q) {g}
theorem LinearMap.lTensor_surjective (hg : Function.Surjective g) :
Function.Surjective (lTensor Q g) := by
intro z
induction z using TensorProduct.induction_on with
| zero => exact ⟨0, map_zero _⟩
| tmul q p =>
obtain ⟨n, rfl⟩ := hg p
exact ⟨q ⊗ₜ[R] n, rfl⟩
| add x y hx hy =>
obtain ⟨x, rfl⟩ := hx
obtain ⟨y, rfl⟩ := hy
exact ⟨x + y, map_add _ _ _⟩
theorem LinearMap.lTensor_range :
range (lTensor Q g) =
range (lTensor Q (Submodule.subtype (range g))) := by
have : g = (Submodule.subtype _).comp g.rangeRestrict := rfl
nth_rewrite 1 [this]
rw [lTensor_comp]
apply range_comp_of_range_eq_top
rw [range_eq_top]
apply lTensor_surjective
rw [← range_eq_top, range_rangeRestrict]
theorem LinearMap.rTensor_surjective (hg : Function.Surjective g) :
Function.Surjective (rTensor Q g) := by
intro z
induction z using TensorProduct.induction_on with
| zero => exact ⟨0, map_zero _⟩
| tmul p q =>
obtain ⟨n, rfl⟩ := hg p
exact ⟨n ⊗ₜ[R] q, rfl⟩
| add x y hx hy =>
obtain ⟨x, rfl⟩ := hx
obtain ⟨y, rfl⟩ := hy
exact ⟨x + y, map_add _ _ _⟩
| Mathlib/LinearAlgebra/TensorProduct/RightExactness.lean | 149 | 158 | theorem LinearMap.rTensor_range :
range (rTensor Q g) =
range (rTensor Q (Submodule.subtype (range g))) := by |
have : g = (Submodule.subtype _).comp g.rangeRestrict := rfl
nth_rewrite 1 [this]
rw [rTensor_comp]
apply range_comp_of_range_eq_top
rw [range_eq_top]
apply rTensor_surjective
rw [← range_eq_top, range_rangeRestrict]
| 1,739 |
import Mathlib.LinearAlgebra.TensorProduct.RightExactness
import Mathlib.LinearAlgebra.TensorProduct.Finiteness
universe u
variable (R : Type u) [CommRing R]
variable {M : Type u} [AddCommGroup M] [Module R M]
variable {N : Type u} [AddCommGroup N] [Module R N]
open Classical DirectSum LinearMap Function Submodule
namespace TensorProduct
variable {ι : Type u} [Fintype ι] {m : ι → M} {n : ι → N}
variable (m n) in
abbrev VanishesTrivially : Prop :=
∃ (κ : Type u) (_ : Fintype κ) (a : ι → κ → R) (y : κ → N),
(∀ i, n i = ∑ j, a i j • y j) ∧ ∀ j, ∑ i, a i j • m i = 0
| Mathlib/LinearAlgebra/TensorProduct/Vanishing.lean | 89 | 94 | theorem sum_tmul_eq_zero_of_vanishesTrivially (hmn : VanishesTrivially R m n) :
∑ i, m i ⊗ₜ n i = (0 : M ⊗[R] N) := by |
obtain ⟨κ, _, a, y, h₁, h₂⟩ := hmn
simp_rw [h₁, tmul_sum, tmul_smul]
rw [Finset.sum_comm]
simp_rw [← tmul_smul, ← smul_tmul, ← sum_tmul, h₂, zero_tmul, Finset.sum_const_zero]
| 1,740 |
import Mathlib.LinearAlgebra.TensorProduct.RightExactness
import Mathlib.LinearAlgebra.TensorProduct.Finiteness
universe u
variable (R : Type u) [CommRing R]
variable {M : Type u} [AddCommGroup M] [Module R M]
variable {N : Type u} [AddCommGroup N] [Module R N]
open Classical DirectSum LinearMap Function Submodule
namespace TensorProduct
variable {ι : Type u} [Fintype ι] {m : ι → M} {n : ι → N}
variable (m n) in
abbrev VanishesTrivially : Prop :=
∃ (κ : Type u) (_ : Fintype κ) (a : ι → κ → R) (y : κ → N),
(∀ i, n i = ∑ j, a i j • y j) ∧ ∀ j, ∑ i, a i j • m i = 0
theorem sum_tmul_eq_zero_of_vanishesTrivially (hmn : VanishesTrivially R m n) :
∑ i, m i ⊗ₜ n i = (0 : M ⊗[R] N) := by
obtain ⟨κ, _, a, y, h₁, h₂⟩ := hmn
simp_rw [h₁, tmul_sum, tmul_smul]
rw [Finset.sum_comm]
simp_rw [← tmul_smul, ← smul_tmul, ← sum_tmul, h₂, zero_tmul, Finset.sum_const_zero]
| Mathlib/LinearAlgebra/TensorProduct/Vanishing.lean | 102 | 157 | theorem vanishesTrivially_of_sum_tmul_eq_zero (hm : Submodule.span R (Set.range m) = ⊤)
(hmn : ∑ i, m i ⊗ₜ n i = (0 : M ⊗[R] N)) : VanishesTrivially R m n := by |
-- Define a map $G \colon R^\iota \to M$ whose matrix entries are the $m_i$. It is surjective.
set G : (ι →₀ R) →ₗ[R] M := Finsupp.total ι M R m with hG
have G_basis_eq (i : ι) : G (Finsupp.single i 1) = m i := by simp [hG, toModule_lof]
have G_surjective : Surjective G := by
apply LinearMap.range_eq_top.mp
apply top_le_iff.mp
rw [← hm]
apply Submodule.span_le.mpr
rintro _ ⟨i, rfl⟩
use Finsupp.single i 1, G_basis_eq i
/- Consider the element $\sum_i e_i \otimes n_i$ of $R^\iota \otimes N$. It is in the kernel of
$R^\iota \otimes N \to M \otimes N$. -/
set en : (ι →₀ R) ⊗[R] N := ∑ i, Finsupp.single i 1 ⊗ₜ n i with hen
have en_mem_ker : en ∈ ker (rTensor N G) := by simp [hen, G_basis_eq, hmn]
-- We have an exact sequence $\ker G \to R^\iota \to M \to 0$.
have exact_ker_subtype : Exact (ker G).subtype G := G.exact_subtype_ker_map
-- Tensor the exact sequence with $N$.
have exact_rTensor_ker_subtype : Exact (rTensor N (ker G).subtype) (rTensor N G) :=
rTensor_exact (M := ↥(ker G)) N exact_ker_subtype G_surjective
/- We conclude that $\sum_i e_i \otimes n_i$ is in the range of
$\ker G \otimes N \to R^\iota \otimes N$. -/
have en_mem_range : en ∈ range (rTensor N (ker G).subtype) :=
exact_rTensor_ker_subtype.linearMap_ker_eq ▸ en_mem_ker
/- There is an element of in $\ker G \otimes N$ that maps to $\sum_i e_i \otimes n_i$.
Write it as a finite sum of pure tensors. -/
obtain ⟨kn, hkn⟩ := en_mem_range
obtain ⟨ma, rfl : kn = ∑ kj ∈ ma, kj.1 ⊗ₜ[R] kj.2⟩ := exists_finset kn
use ↑↑ma, FinsetCoe.fintype ma
/- Let $\sum_j k_j \otimes y_j$ be the sum obtained in the previous step.
In order to show that $\sum_i m_i \otimes n_i$ vanishes trivially, it suffices to prove that there
exist $(a_{ij})_{i, j}$ such that for all $i$,
$$n_i = \sum_j a_{ij} y_j$$
and for all $j$,
$$\sum_{i} a_{ij} m_i = 0.$$
For this, take $a_{ij}$ to be the coefficient of $e_i$ in $k_j$. -/
use fun i ⟨⟨kj, _⟩, _⟩ ↦ (kj : ι →₀ R) i
use fun ⟨⟨_, yj⟩, _⟩ ↦ yj
constructor
· intro i
apply_fun finsuppScalarLeft R N ι at hkn
apply_fun (· i) at hkn
symm at hkn
simp only [map_sum, finsuppScalarLeft_apply_tmul, zero_smul, Finsupp.single_zero,
Finsupp.sum_single_index, one_smul, Finsupp.finset_sum_apply, Finsupp.single_apply,
Finset.sum_ite_eq', Finset.mem_univ, ↓reduceIte, rTensor_tmul, coeSubtype, Finsupp.sum_apply,
Finsupp.sum_ite_eq', Finsupp.mem_support_iff, ne_eq, ite_not, en] at hkn
simp only [Finset.univ_eq_attach, Finset.sum_attach ma (fun x ↦ (x.1 : ι →₀ R) i • x.2)]
convert hkn using 2 with x _
split
· next h'x => rw [h'x, zero_smul]
· rfl
· rintro ⟨⟨⟨k, hk⟩, _⟩, _⟩
simpa only [hG, Finsupp.total_apply, zero_smul, implies_true, Finsupp.sum_fintype] using
mem_ker.mp hk
| 1,740 |
import Mathlib.LinearAlgebra.TensorProduct.RightExactness
import Mathlib.LinearAlgebra.TensorProduct.Finiteness
universe u
variable (R : Type u) [CommRing R]
variable {M : Type u} [AddCommGroup M] [Module R M]
variable {N : Type u} [AddCommGroup N] [Module R N]
open Classical DirectSum LinearMap Function Submodule
namespace TensorProduct
variable {ι : Type u} [Fintype ι] {m : ι → M} {n : ι → N}
variable (m n) in
abbrev VanishesTrivially : Prop :=
∃ (κ : Type u) (_ : Fintype κ) (a : ι → κ → R) (y : κ → N),
(∀ i, n i = ∑ j, a i j • y j) ∧ ∀ j, ∑ i, a i j • m i = 0
theorem sum_tmul_eq_zero_of_vanishesTrivially (hmn : VanishesTrivially R m n) :
∑ i, m i ⊗ₜ n i = (0 : M ⊗[R] N) := by
obtain ⟨κ, _, a, y, h₁, h₂⟩ := hmn
simp_rw [h₁, tmul_sum, tmul_smul]
rw [Finset.sum_comm]
simp_rw [← tmul_smul, ← smul_tmul, ← sum_tmul, h₂, zero_tmul, Finset.sum_const_zero]
theorem vanishesTrivially_of_sum_tmul_eq_zero (hm : Submodule.span R (Set.range m) = ⊤)
(hmn : ∑ i, m i ⊗ₜ n i = (0 : M ⊗[R] N)) : VanishesTrivially R m n := by
-- Define a map $G \colon R^\iota \to M$ whose matrix entries are the $m_i$. It is surjective.
set G : (ι →₀ R) →ₗ[R] M := Finsupp.total ι M R m with hG
have G_basis_eq (i : ι) : G (Finsupp.single i 1) = m i := by simp [hG, toModule_lof]
have G_surjective : Surjective G := by
apply LinearMap.range_eq_top.mp
apply top_le_iff.mp
rw [← hm]
apply Submodule.span_le.mpr
rintro _ ⟨i, rfl⟩
use Finsupp.single i 1, G_basis_eq i
set en : (ι →₀ R) ⊗[R] N := ∑ i, Finsupp.single i 1 ⊗ₜ n i with hen
have en_mem_ker : en ∈ ker (rTensor N G) := by simp [hen, G_basis_eq, hmn]
-- We have an exact sequence $\ker G \to R^\iota \to M \to 0$.
have exact_ker_subtype : Exact (ker G).subtype G := G.exact_subtype_ker_map
-- Tensor the exact sequence with $N$.
have exact_rTensor_ker_subtype : Exact (rTensor N (ker G).subtype) (rTensor N G) :=
rTensor_exact (M := ↥(ker G)) N exact_ker_subtype G_surjective
have en_mem_range : en ∈ range (rTensor N (ker G).subtype) :=
exact_rTensor_ker_subtype.linearMap_ker_eq ▸ en_mem_ker
obtain ⟨kn, hkn⟩ := en_mem_range
obtain ⟨ma, rfl : kn = ∑ kj ∈ ma, kj.1 ⊗ₜ[R] kj.2⟩ := exists_finset kn
use ↑↑ma, FinsetCoe.fintype ma
use fun i ⟨⟨kj, _⟩, _⟩ ↦ (kj : ι →₀ R) i
use fun ⟨⟨_, yj⟩, _⟩ ↦ yj
constructor
· intro i
apply_fun finsuppScalarLeft R N ι at hkn
apply_fun (· i) at hkn
symm at hkn
simp only [map_sum, finsuppScalarLeft_apply_tmul, zero_smul, Finsupp.single_zero,
Finsupp.sum_single_index, one_smul, Finsupp.finset_sum_apply, Finsupp.single_apply,
Finset.sum_ite_eq', Finset.mem_univ, ↓reduceIte, rTensor_tmul, coeSubtype, Finsupp.sum_apply,
Finsupp.sum_ite_eq', Finsupp.mem_support_iff, ne_eq, ite_not, en] at hkn
simp only [Finset.univ_eq_attach, Finset.sum_attach ma (fun x ↦ (x.1 : ι →₀ R) i • x.2)]
convert hkn using 2 with x _
split
· next h'x => rw [h'x, zero_smul]
· rfl
· rintro ⟨⟨⟨k, hk⟩, _⟩, _⟩
simpa only [hG, Finsupp.total_apply, zero_smul, implies_true, Finsupp.sum_fintype] using
mem_ker.mp hk
theorem vanishesTrivially_iff_sum_tmul_eq_zero (hm : Submodule.span R (Set.range m) = ⊤) :
VanishesTrivially R m n ↔ ∑ i, m i ⊗ₜ n i = (0 : M ⊗[R] N) :=
⟨sum_tmul_eq_zero_of_vanishesTrivially R, vanishesTrivially_of_sum_tmul_eq_zero R hm⟩
| Mathlib/LinearAlgebra/TensorProduct/Vanishing.lean | 175 | 192 | theorem vanishesTrivially_of_sum_tmul_eq_zero_of_rTensor_injective
(hm : Injective (rTensor N (span R (Set.range m)).subtype))
(hmn : ∑ i, m i ⊗ₜ n i = (0 : M ⊗[R] N)) : VanishesTrivially R m n := by |
-- Restrict `m` on the codomain to $M'$, then apply `vanishesTrivially_of_sum_tmul_eq_zero`.
have mem_M' i : m i ∈ span R (Set.range m) := subset_span ⟨i, rfl⟩
set m' : ι → span R (Set.range m) := Subtype.coind m mem_M' with m'_eq
have hm' : span R (Set.range m') = ⊤ := by
apply map_injective_of_injective (injective_subtype (span R (Set.range m)))
rw [Submodule.map_span, Submodule.map_top, range_subtype, coeSubtype, ← Set.range_comp]
rfl
have hm'n : ∑ i, m' i ⊗ₜ n i = (0 : span R (Set.range m) ⊗[R] N) := by
apply hm
simp only [m'_eq, map_sum, rTensor_tmul, coeSubtype, Subtype.coind_coe, _root_.map_zero, hmn]
have : VanishesTrivially R m' n := vanishesTrivially_of_sum_tmul_eq_zero R hm' hm'n
unfold VanishesTrivially at this ⊢
convert this with κ _ a y j
convert (injective_iff_map_eq_zero' _).mp (injective_subtype (span R (Set.range m))) _
simp [m'_eq]
| 1,740 |
import Mathlib.RingTheory.Flat.Basic
import Mathlib.LinearAlgebra.TensorProduct.Vanishing
import Mathlib.Algebra.Module.FinitePresentation
universe u
variable {R M : Type u} [CommRing R] [AddCommGroup M] [Module R M]
open Classical DirectSum LinearMap TensorProduct Finsupp
open scoped BigOperators
namespace Module
variable {ι : Type u} [Fintype ι] (f : ι → R) (x : ι → M)
abbrev IsTrivialRelation : Prop :=
∃ (κ : Type u) (_ : Fintype κ) (a : ι → κ → R) (y : κ → M),
(∀ i, x i = ∑ j, a i j • y j) ∧ ∀ j, ∑ i, f i * a i j = 0
variable {f x}
| Mathlib/RingTheory/Flat/EquationalCriterion.lean | 81 | 83 | theorem isTrivialRelation_iff_vanishesTrivially :
IsTrivialRelation f x ↔ VanishesTrivially R f x := by |
simp only [IsTrivialRelation, VanishesTrivially, smul_eq_mul, mul_comm]
| 1,741 |
import Mathlib.RingTheory.Flat.Basic
import Mathlib.LinearAlgebra.TensorProduct.Vanishing
import Mathlib.Algebra.Module.FinitePresentation
universe u
variable {R M : Type u} [CommRing R] [AddCommGroup M] [Module R M]
open Classical DirectSum LinearMap TensorProduct Finsupp
open scoped BigOperators
namespace Module
variable {ι : Type u} [Fintype ι] (f : ι → R) (x : ι → M)
abbrev IsTrivialRelation : Prop :=
∃ (κ : Type u) (_ : Fintype κ) (a : ι → κ → R) (y : κ → M),
(∀ i, x i = ∑ j, a i j • y j) ∧ ∀ j, ∑ i, f i * a i j = 0
variable {f x}
theorem isTrivialRelation_iff_vanishesTrivially :
IsTrivialRelation f x ↔ VanishesTrivially R f x := by
simp only [IsTrivialRelation, VanishesTrivially, smul_eq_mul, mul_comm]
| Mathlib/RingTheory/Flat/EquationalCriterion.lean | 88 | 92 | theorem sum_smul_eq_zero_of_isTrivialRelation (h : IsTrivialRelation f x) :
∑ i, f i • x i = 0 := by |
simpa using
congr_arg (TensorProduct.lid R M) <|
sum_tmul_eq_zero_of_vanishesTrivially R (isTrivialRelation_iff_vanishesTrivially.mp h)
| 1,741 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.