File: Mathlib/RingTheory/SurjectiveOnStalks.lean

full_name: RingHom.SurjectiveOnStalks
code: /--
A ring homomorphism `R →+* S` is surjective on stalks if `R_p →+* S_q` is surjective for all pairs
of primes `p = f⁻¹(q)`.
-/
def SurjectiveOnStalks (f : R →+* S) : Prop 
goal: Prop

full_name: RingHom.surjective_localRingHom_iff
code: /--
`R_p →+* S_q` is surjective if and only if
every `x : S` is of the form `f x / f r` for some `f r ∉ q`.
This is useful when proving `SurjectiveOnStalks`.
-/
lemma surjective_localRingHom_iff (P : Ideal S) [P.IsPrime] :
    Function.Surjective (Localization.localRingHom _ P f rfl) ↔
      ∀ s : S, ∃ x r : R, ∃ c ∉ P, f r ∉ P ∧ c * f r * s = c * f x 
goal: Function.Surjective ⇑(Localization.localRingHom (Ideal.comap f P) P f ⋯) ↔
  ∀ (s : S), ∃ x r, ∃ c ∉ P, f r ∉ P ∧ c * f r * s = c * f x

full_name: RingHom.surjectiveOnStalks_iff_forall_ideal
code: lemma surjectiveOnStalks_iff_forall_ideal :
    f.SurjectiveOnStalks ↔
      ∀ I : Ideal S, I ≠ ⊤ → ∀ s : S, ∃ x r : R, ∃ c ∉ I, f r ∉ I ∧ c * f r * s = c * f x 
goal: f.SurjectiveOnStalks ↔ ∀ (I : Ideal S), I ≠ ⊤ → ∀ (s : S), ∃ x r, ∃ c ∉ I, f r ∉ I ∧ c * f r * s = c * f x

full_name: RingHom.surjectiveOnStalks_iff_forall_maximal
code: lemma surjectiveOnStalks_iff_forall_maximal :
    f.SurjectiveOnStalks ↔ ∀ (I : Ideal S) (_ : I.IsMaximal),
      Function.Surjective (Localization.localRingHom _ I f rfl) 
goal: f.SurjectiveOnStalks ↔
  ∀ (I : Ideal S) (x : I.IsMaximal), Function.Surjective ⇑(Localization.localRingHom (Ideal.comap f I) I f ⋯)

full_name: RingHom.surjectiveOnStalks_iff_forall_maximal'
code: lemma surjectiveOnStalks_iff_forall_maximal' :
    f.SurjectiveOnStalks ↔ ∀ I : Ideal S, I.IsMaximal →
      ∀ s : S, ∃ x r : R, ∃ c ∉ I, f r ∉ I ∧ c * f r * s = c * f x 
goal: f.SurjectiveOnStalks ↔ ∀ (I : Ideal S), I.IsMaximal → ∀ (s : S), ∃ x r, ∃ c ∉ I, f r ∉ I ∧ c * f r * s = c * f x

full_name: RingHom.surjectiveOnStalks_of_exists_div
code: lemma surjectiveOnStalks_of_exists_div (h : ∀ x : S, ∃ r s : R, IsUnit (f s) ∧ f s * x = f r) :
    SurjectiveOnStalks f 
goal: f.SurjectiveOnStalks

full_name: RingHom.surjectiveOnStalks_of_surjective
code: lemma surjectiveOnStalks_of_surjective (h : Function.Surjective f) :
    SurjectiveOnStalks f 
goal: f.SurjectiveOnStalks

full_name: RingHom.surjectiveOnStalks_of_isLocalization
code: lemma surjectiveOnStalks_of_isLocalization [IsLocalization M S] :
    SurjectiveOnStalks (algebraMap R S) 
goal: (algebraMap R S).SurjectiveOnStalks

full_name: RingHom.SurjectiveOnStalks.comp
code: lemma SurjectiveOnStalks.comp (hg : SurjectiveOnStalks g) (hf : SurjectiveOnStalks f) :
    SurjectiveOnStalks (g.comp f) 
goal: (g.comp f).SurjectiveOnStalks

full_name: RingHom.SurjectiveOnStalks.of_comp
code: lemma SurjectiveOnStalks.of_comp (hg : SurjectiveOnStalks (g.comp f)) :
    SurjectiveOnStalks g 
goal: g.SurjectiveOnStalks

full_name: RingHom.SurjectiveOnStalks.exists_mul_eq_tmul
code: /--
If `R → T` is surjective on stalks, and `J` is some prime of `T`,
then every element `x` in `S ⊗[R] T` satisfies `(1 ⊗ r • t) * x = a ⊗ t` for some
`r : R`, `a : S`, and `t : T` such that `r • t ∉ J`.
-/
lemma SurjectiveOnStalks.exists_mul_eq_tmul
    (hf₂ : (algebraMap R T).SurjectiveOnStalks)
    (x : S ⊗[R] T) (J : Ideal T) (hJ : J.IsPrime) :
    ∃ (t : T) (r : R) (a : S), (r • t ∉ J) ∧
      (1 : S) ⊗ₜ[R] (r • t) * x = a ⊗ₜ[R] t 
goal: ∃ t r a, r • t ∉ J ∧ 1 ⊗ₜ[R] (r • t) * x = a ⊗ₜ[R] t

full_name: RingHom.SurjectiveOnStalks.baseChange
code: lemma SurjectiveOnStalks.baseChange
    (hf : (algebraMap R T).SurjectiveOnStalks) :
    (algebraMap S (S ⊗[R] T)).SurjectiveOnStalks 
goal: (algebraMap S (TensorProduct R S T)).SurjectiveOnStalks

full_name: RingHom.surjectiveOnStalks_iff_of_isLocalRingHom
code: lemma surjectiveOnStalks_iff_of_isLocalRingHom [LocalRing S] [IsLocalRingHom f] :
    f.SurjectiveOnStalks ↔ Function.Surjective f 
goal: f.SurjectiveOnStalks ↔ Function.Surjective ⇑f