File: Mathlib/RingTheory/Localization/Away/Basic.lean

full_name: IsLocalization.Away
code: /-- Given `x : R`, the typeclass `IsLocalization.Away x S` states that `S` is
isomorphic to the localization of `R` at the submonoid generated by `x`. -/
abbrev Away (S : Type*) [CommSemiring S] [Algebra R S] 
goal: Prop

full_name: IsLocalization.Away.invSelf
code: /-- Given `x : R` and a localization map `F : R →+* S` away from `x`, `invSelf` is `(F x)⁻¹`. -/
noncomputable def invSelf : S 
goal: S

full_name: IsLocalization.Away.mul_invSelf
code: @[simp]
theorem mul_invSelf : algebraMap R S x * invSelf x = 1 
goal: (algebraMap R S) x * IsLocalization.Away.invSelf x = 1

full_name: IsLocalization.Away.sec
code: /-- For `s : S` with `S` being the localization of `R` away from `x`,
this is a choice of `(r, n) : R × ℕ` such that `s * algebraMap R S (x ^ n) = algebraMap R S r`. -/
noncomputable def sec (s : S) : R × ℕ 
goal: R × ℕ

full_name: IsLocalization.Away.sec_spec
code: lemma sec_spec (s : S) : s * (algebraMap R S) (x ^ (IsLocalization.Away.sec x s).2) =
    algebraMap R S (IsLocalization.Away.sec x s).1 
goal: s * (algebraMap R S) (x ^ (IsLocalization.Away.sec x s).2) = (algebraMap R S) (IsLocalization.Away.sec x s).1

full_name: IsLocalization.Away.lift
code: /-- Given `x : R`, a localization map `F : R →+* S` away from `x`, and a map of `CommSemiring`s
`g : R →+* P` such that `g x` is invertible, the homomorphism induced from `S` to `P` sending
`z : S` to `g y * (g x)⁻ⁿ`, where `y : R, n : ℕ` are such that `z = F y * (F x)⁻ⁿ`. -/
noncomputable def lift (hg : IsUnit (g x)) : S →+* P 
goal: S →+* P

full_name: IsLocalization.Away.AwayMap.lift_eq
code: @[simp]
theorem AwayMap.lift_eq (hg : IsUnit (g x)) (a : R) : lift x hg ((algebraMap R S) a) = g a 
goal: (IsLocalization.Away.lift x hg) ((algebraMap R S) a) = g a

full_name: IsLocalization.Away.AwayMap.lift_comp
code: @[simp]
theorem AwayMap.lift_comp (hg : IsUnit (g x)) : (lift x hg).comp (algebraMap R S) = g 
goal: (IsLocalization.Away.lift x hg).comp (algebraMap R S) = g

full_name: IsLocalization.Away.awayToAwayRight
code: /-- Given `x y : R` and localizations `S`, `P` away from `x` and `x * y`
respectively, the homomorphism induced from `S` to `P`. -/
noncomputable def awayToAwayRight (y : R) [Algebra R P] [IsLocalization.Away (x * y) P] : S →+* P 
goal: S →+* P

full_name: IsLocalization.Away.map
code: /-- Given a map `f : R →+* S` and an element `r : R`, we may construct a map `Rᵣ →+* Sᵣ`. -/
noncomputable def map (f : R →+* P) (r : R) [IsLocalization.Away r S]
    [IsLocalization.Away (f r) Q] : S →+* Q 
goal: S →+* Q

full_name: IsLocalization.Away.instMapRingHomPowersOfCoe
code: instance {f : A →+* B} (a : A) [Away (f a) Bₚ] : IsLocalization (.map f (.powers a)) Bₚ 
goal: IsLocalization (Submonoid.map f (Submonoid.powers a)) Bₚ

full_name: IsLocalization.Away.mapₐ
code: /-- Given a algebra map `f : A →ₐ[R] B` and an element `a : A`, we may construct a map
`Aₐ →ₐ[R] Bₐ`. -/
noncomputable def mapₐ (f : A →ₐ[R] B) (a : A) [Away a Aₚ] [Away (f a) Bₚ] : Aₚ →ₐ[R] Bₚ 
goal: Aₚ →ₐ[R] Bₚ

full_name: IsLocalization.Away.mapₐ_apply
code: @[simp]
lemma mapₐ_apply (f : A →ₐ[R] B) (a : A) [Away a Aₚ] [Away (f a) Bₚ] (x : Aₚ) :
    mapₐ Aₚ Bₚ f a x = map Aₚ Bₚ f.toRingHom a x 
goal: (IsLocalization.Away.mapₐ Aₚ Bₚ f a) x = (IsLocalization.Away.map Aₚ Bₚ f.toRingHom a) x

full_name: IsLocalization.Away.mapₐ_injective_of_injective
code: lemma mapₐ_injective_of_injective {f : A →ₐ[R] B} (a : A) [Away a Aₚ] [Away (f a) Bₚ]
    (hf : Function.Injective f) : Function.Injective (mapₐ Aₚ Bₚ f a) 
goal: Function.Injective ⇑(IsLocalization.Away.mapₐ Aₚ Bₚ f a)

full_name: IsLocalization.Away.mapₐ_surjective_of_surjective
code: lemma mapₐ_surjective_of_surjective {f : A →ₐ[R] B} (a : A) [Away a Aₚ] [Away (f a) Bₚ]
    (hf : Function.Surjective f) : Function.Surjective (mapₐ Aₚ Bₚ f a) 
goal: Function.Surjective ⇑(IsLocalization.Away.mapₐ Aₚ Bₚ f a)

full_name: IsLocalization.atUnit
code: /-- The localization away from a unit is isomorphic to the ring. -/
noncomputable def atUnit (x : R) (e : IsUnit x) [IsLocalization.Away x S] : R ≃ₐ[R] S 
goal: R ≃ₐ[R] S

full_name: IsLocalization.atOne
code: /-- The localization at one is isomorphic to the ring. -/
noncomputable def atOne [IsLocalization.Away (1 : R) S] : R ≃ₐ[R] S 
goal: R ≃ₐ[R] S

full_name: IsLocalization.away_of_isUnit_of_bijective
code: theorem away_of_isUnit_of_bijective {R : Type*} (S : Type*) [CommRing R] [CommRing S]
    [Algebra R S] {r : R} (hr : IsUnit r) (H : Function.Bijective (algebraMap R S)) :
    IsLocalization.Away r S 
goal: IsLocalization.Away r S

full_name: IsLocalization.away_of_isIdempotentElem
code: lemma away_of_isIdempotentElem {R S} [CommRing R] [CommRing S] [Algebra R S]
    {e : R} (he : IsIdempotentElem e)
    (H : RingHom.ker (algebraMap R S) = Ideal.span {1 - e})
    (H' : Function.Surjective (algebraMap R S)) :
    IsLocalization.Away e S 
goal: IsLocalization.Away e S

full_name: IsLocalization.away_fst
code: instance away_fst {R S} [CommRing R] [CommRing S] :
    letI := (RingHom.fst R S).toAlgebra
    IsLocalization.Away (R := R × S) (1, 0) R 
goal: IsLocalization.Away (1, 0) R

full_name: IsLocalization.away_snd
code: instance away_snd {R S} [CommRing R] [CommRing S] :
    letI := (RingHom.snd R S).toAlgebra
    IsLocalization.Away (R := R × S) (0, 1) S 
goal: IsLocalization.Away (0, 1) S

full_name: Localization.awayLift
code: /-- Given a map `f : R →+* S` and an element `r : R`, such that `f r` is invertible,
  we may construct a map `Rᵣ →+* S`. -/
noncomputable abbrev awayLift (f : R →+* P) (r : R) (hr : IsUnit (f r)) :
    Localization.Away r →+* P 
goal: Localization.Away r →+* P

full_name: Localization.awayMap
code: /-- Given a map `f : R →+* S` and an element `r : R`, we may construct a map `Rᵣ →+* Sᵣ`. -/
noncomputable abbrev awayMap (f : R →+* P) (r : R) :
    Localization.Away r →+* Localization.Away (f r) 
goal: Localization.Away r →+* Localization.Away (f r)

full_name: Localization.awayMapₐ
code: /-- Given a map `f : A →ₐ[R] B` and an element `a : A`, we may construct a map `Aₐ →ₐ[R] Bₐ`. -/
noncomputable abbrev awayMapₐ (f : A →ₐ[R] B) (a : A) :
    Localization.Away a →ₐ[R] Localization.Away (f a) 
goal: Localization.Away a →ₐ[R] Localization.Away (f a)

full_name: selfZPow
code: /-- `selfZPow x (m : ℤ)` is `x ^ m` as an element of the localization away from `x`. -/
noncomputable def selfZPow (m : ℤ) : B 
goal: B

full_name: selfZPow_of_nonneg
code: theorem selfZPow_of_nonneg {n : ℤ} (hn : 0 ≤ n) : selfZPow x B n = algebraMap R B x ^ n.natAbs 
goal: selfZPow x B n = (algebraMap R B) x ^ n.natAbs

full_name: selfZPow_natCast
code: @[simp]
theorem selfZPow_natCast (d : ℕ) : selfZPow x B d = algebraMap R B x ^ d 
goal: selfZPow x B ↑d = (algebraMap R B) x ^ d

full_name: selfZPow_zero
code: @[simp]
theorem selfZPow_zero : selfZPow x B 0 = 1 
goal: selfZPow x B 0 = 1

full_name: selfZPow_of_neg
code: theorem selfZPow_of_neg {n : ℤ} (hn : n < 0) :
    selfZPow x B n = mk' _ (1 : R) (Submonoid.pow x n.natAbs) 
goal: selfZPow x B n = IsLocalization.mk' B 1 (Submonoid.pow x n.natAbs)

full_name: selfZPow_of_nonpos
code: theorem selfZPow_of_nonpos {n : ℤ} (hn : n ≤ 0) :
    selfZPow x B n = mk' _ (1 : R) (Submonoid.pow x n.natAbs) 
goal: selfZPow x B n = IsLocalization.mk' B 1 (Submonoid.pow x n.natAbs)

full_name: selfZPow_neg_natCast
code: @[simp]
theorem selfZPow_neg_natCast (d : ℕ) : selfZPow x B (-d) = mk' _ (1 : R) (Submonoid.pow x d) 
goal: selfZPow x B (-↑d) = IsLocalization.mk' B 1 (Submonoid.pow x d)

full_name: selfZPow_sub_natCast
code: @[simp]
theorem selfZPow_sub_natCast {n m : ℕ} :
    selfZPow x B (n - m) = mk' _ (x ^ n) (Submonoid.pow x m) 
goal: selfZPow x B (↑n - ↑m) = IsLocalization.mk' B (x ^ n) (Submonoid.pow x m)

full_name: selfZPow_add
code: @[simp]
theorem selfZPow_add {n m : ℤ} : selfZPow x B (n + m) = selfZPow x B n * selfZPow x B m 
goal: selfZPow x B (n + m) = selfZPow x B n * selfZPow x B m

full_name: selfZPow_mul_neg
code: theorem selfZPow_mul_neg (d : ℤ) : selfZPow x B d * selfZPow x B (-d) = 1 
goal: selfZPow x B d * selfZPow x B (-d) = 1

full_name: selfZPow_neg_mul
code: theorem selfZPow_neg_mul (d : ℤ) : selfZPow x B (-d) * selfZPow x B d = 1 
goal: selfZPow x B (-d) * selfZPow x B d = 1

full_name: selfZPow_pow_sub
code: theorem selfZPow_pow_sub (a : R) (b : B) (m d : ℤ) :
    selfZPow x B (m - d) * mk' B a (1 : Submonoid.powers x) = b ↔
      selfZPow x B m * mk' B a (1 : Submonoid.powers x) = selfZPow x B d * b 
goal: selfZPow x B (m - d) * IsLocalization.mk' B a 1 = b ↔ selfZPow x B m * IsLocalization.mk' B a 1 = selfZPow x B d * b

full_name: exists_reduced_fraction'
code: theorem exists_reduced_fraction' {b : B} (hb : b ≠ 0) (hx : Irreducible x) :
    ∃ (a : R) (n : ℤ), ¬x ∣ a ∧ selfZPow x B n * algebraMap R B a = b 
goal: ∃ a n, ¬x ∣ a ∧ selfZPow x B n * (algebraMap R B) a = b