Theorem: IsNilpotent.isUnit_quotient_mk_iff
File: Mathlib/RingTheory/QuotientNilpotent.lean

tactic: refine' ⟨_, fun h => h.map <| Ideal.Quotient.mk I⟩
state_before: R✝ : Type ?u.10312
S : Type ?u.10315
inst✝³ : CommSemiring R✝
inst✝² : CommRing S
inst✝¹ : Algebra R✝ S
I✝ : Ideal S
R : Type u_1
inst✝ : CommRing R
I : Ideal R
hI : IsNilpotent I
x : R
⊢ IsUnit (↑(Ideal.Quotient.mk I) x) ↔ IsUnit x

tactic: revert x
state_before: R✝ : Type ?u.10312
S : Type ?u.10315
inst✝³ : CommSemiring R✝
inst✝² : CommRing S
inst✝¹ : Algebra R✝ S
I✝ : Ideal S
R : Type u_1
inst✝ : CommRing R
I : Ideal R
hI : IsNilpotent I
x : R
⊢ IsUnit (↑(Ideal.Quotient.mk I) x) → IsUnit x

tactic: apply Ideal.IsNilpotent.induction_on (R := R) (S := R) I hI <;> clear hI I
state_before: R✝ : Type ?u.10312
S : Type ?u.10315
inst✝³ : CommSemiring R✝
inst✝² : CommRing S
inst✝¹ : Algebra R✝ S
I✝ : Ideal S
R : Type u_1
inst✝ : CommRing R
I : Ideal R
hI : IsNilpotent I
⊢ ∀ {x : R}, IsUnit (↑(Ideal.Quotient.mk I) x) → IsUnit x

tactic: swap
state_before: case h₁
R✝ : Type ?u.10312
S : Type ?u.10315
inst✝³ : CommSemiring R✝
inst✝² : CommRing S
inst✝¹ : Algebra R✝ S
I : Ideal S
R : Type u_1
inst✝ : CommRing R
⊢ ∀ ⦃S : Type u_1⦄ [inst : CommRing S] (I : Ideal S),
    I ^ 2 = ⊥ → ∀ {x : S}, IsUnit (↑(Ideal.Quotient.mk I) x) → IsUnit x

case h₂
R✝ : Type ?u.10312
S : Type ?u.10315
inst✝³ : CommSemiring R✝
inst✝² : CommRing S
inst✝¹ : Algebra R✝ S
I : Ideal S
R : Type u_1
inst✝ : CommRing R
⊢ ∀ ⦃S : Type u_1⦄ [inst : CommRing S] (I J : Ideal S),
    I ≤ J →
      (∀ {x : S}, IsUnit (↑(Ideal.Quotient.mk I) x) → IsUnit x) →
        (∀ {x : S ⧸ I}, IsUnit (↑(Ideal.Quotient.mk (Ideal.map (Ideal.Quotient.mk I) J)) x) → IsUnit x) →
          ∀ {x : S}, IsUnit (↑(Ideal.Quotient.mk J) x) → IsUnit x

tactic: introv e h₁ h₂ h₃
state_before: case h₂
R✝ : Type ?u.10312
S : Type ?u.10315
inst✝³ : CommSemiring R✝
inst✝² : CommRing S
inst✝¹ : Algebra R✝ S
I : Ideal S
R : Type u_1
inst✝ : CommRing R
⊢ ∀ ⦃S : Type u_1⦄ [inst : CommRing S] (I J : Ideal S),
    I ≤ J →
      (∀ {x : S}, IsUnit (↑(Ideal.Quotient.mk I) x) → IsUnit x) →
        (∀ {x : S ⧸ I}, IsUnit (↑(Ideal.Quotient.mk (Ideal.map (Ideal.Quotient.mk I) J)) x) → IsUnit x) →
          ∀ {x : S}, IsUnit (↑(Ideal.Quotient.mk J) x) → IsUnit x

tactic: apply h₁
state_before: case h₂
R✝ : Type ?u.10312
S✝ : Type ?u.10315
inst✝⁴ : CommSemiring R✝
inst✝³ : CommRing S✝
inst✝² : Algebra R✝ S✝
I✝ : Ideal S✝
R : Type u_1
inst✝¹ : CommRing R
S : Type u_1
inst✝ : CommRing S
I J : Ideal S
e : I ≤ J
h₁ : ∀ {x : S}, IsUnit (↑(Ideal.Quotient.mk I) x) → IsUnit x
h₂ : ∀ {x : S ⧸ I}, IsUnit (↑(Ideal.Quotient.mk (Ideal.map (Ideal.Quotient.mk I) J)) x) → IsUnit x
x : S
h₃ : IsUnit (↑(Ideal.Quotient.mk J) x)
⊢ IsUnit x

tactic: apply h₂
state_before: case h₂.a
R✝ : Type ?u.10312
S✝ : Type ?u.10315
inst✝⁴ : CommSemiring R✝
inst✝³ : CommRing S✝
inst✝² : Algebra R✝ S✝
I✝ : Ideal S✝
R : Type u_1
inst✝¹ : CommRing R
S : Type u_1
inst✝ : CommRing S
I J : Ideal S
e : I ≤ J
h₁ : ∀ {x : S}, IsUnit (↑(Ideal.Quotient.mk I) x) → IsUnit x
h₂ : ∀ {x : S ⧸ I}, IsUnit (↑(Ideal.Quotient.mk (Ideal.map (Ideal.Quotient.mk I) J)) x) → IsUnit x
x : S
h₃ : IsUnit (↑(Ideal.Quotient.mk J) x)
⊢ IsUnit (↑(Ideal.Quotient.mk I) x)

tactic: exact
  h₃.map
    ((DoubleQuot.quotQuotEquivQuotSup I J).trans
          (Ideal.quotEquivOfEq (sup_eq_right.mpr e))).symm.toRingHom
state_before: case h₂.a.a
R✝ : Type ?u.10312
S✝ : Type ?u.10315
inst✝⁴ : CommSemiring R✝
inst✝³ : CommRing S✝
inst✝² : Algebra R✝ S✝
I✝ : Ideal S✝
R : Type u_1
inst✝¹ : CommRing R
S : Type u_1
inst✝ : CommRing S
I J : Ideal S
e : I ≤ J
h₁ : ∀ {x : S}, IsUnit (↑(Ideal.Quotient.mk I) x) → IsUnit x
h₂ : ∀ {x : S ⧸ I}, IsUnit (↑(Ideal.Quotient.mk (Ideal.map (Ideal.Quotient.mk I) J)) x) → IsUnit x
x : S
h₃ : IsUnit (↑(Ideal.Quotient.mk J) x)
⊢ IsUnit (↑(Ideal.Quotient.mk (Ideal.map (Ideal.Quotient.mk I) J)) (↑(Ideal.Quotient.mk I) x))

tactic: introv e H
state_before: case h₁
R✝ : Type ?u.10312
S : Type ?u.10315
inst✝³ : CommSemiring R✝
inst✝² : CommRing S
inst✝¹ : Algebra R✝ S
I : Ideal S
R : Type u_1
inst✝ : CommRing R
⊢ ∀ ⦃S : Type u_1⦄ [inst : CommRing S] (I : Ideal S),
    I ^ 2 = ⊥ → ∀ {x : S}, IsUnit (↑(Ideal.Quotient.mk I) x) → IsUnit x

tactic: skip
state_before: case h₁
R✝ : Type ?u.10312
S✝ : Type ?u.10315
inst✝⁴ : CommSemiring R✝
inst✝³ : CommRing S✝
inst✝² : Algebra R✝ S✝
I✝ : Ideal S✝
R : Type u_1
inst✝¹ : CommRing R
S : Type u_1
inst✝ : CommRing S
I : Ideal S
e : I ^ 2 = ⊥
x : S
H : IsUnit (↑(Ideal.Quotient.mk I) x)
⊢ IsUnit x

tactic: obtain ⟨y, hy⟩ := Ideal.Quotient.mk_surjective (↑H.unit⁻¹ : S ⧸ I)
state_before: case h₁
R✝ : Type ?u.10312
S✝ : Type ?u.10315
inst✝⁴ : CommSemiring R✝
inst✝³ : CommRing S✝
inst✝² : Algebra R✝ S✝
I✝ : Ideal S✝
R : Type u_1
inst✝¹ : CommRing R
S : Type u_1
inst✝ : CommRing S
I : Ideal S
e : I ^ 2 = ⊥
x : S
H : IsUnit (↑(Ideal.Quotient.mk I) x)
⊢ IsUnit x

tactic: have : Ideal.Quotient.mk I (x * y) = Ideal.Quotient.mk I 1 := by
  rw [map_one, _root_.map_mul, hy, IsUnit.mul_val_inv]
state_before: case h₁.intro
R✝ : Type ?u.10312
S✝ : Type ?u.10315
inst✝⁴ : CommSemiring R✝
inst✝³ : CommRing S✝
inst✝² : Algebra R✝ S✝
I✝ : Ideal S✝
R : Type u_1
inst✝¹ : CommRing R
S : Type u_1
inst✝ : CommRing S
I : Ideal S
e : I ^ 2 = ⊥
x : S
H : IsUnit (↑(Ideal.Quotient.mk I) x)
y : S
hy : ↑(Ideal.Quotient.mk I) y = ↑(IsUnit.unit H)⁻¹
⊢ IsUnit x

tactic: rw [Ideal.Quotient.eq] at this
state_before: case h₁.intro
R✝ : Type ?u.10312
S✝ : Type ?u.10315
inst✝⁴ : CommSemiring R✝
inst✝³ : CommRing S✝
inst✝² : Algebra R✝ S✝
I✝ : Ideal S✝
R : Type u_1
inst✝¹ : CommRing R
S : Type u_1
inst✝ : CommRing S
I : Ideal S
e : I ^ 2 = ⊥
x : S
H : IsUnit (↑(Ideal.Quotient.mk I) x)
y : S
hy : ↑(Ideal.Quotient.mk I) y = ↑(IsUnit.unit H)⁻¹
this : ↑(Ideal.Quotient.mk I) (x * y) = ↑(Ideal.Quotient.mk I) 1
⊢ IsUnit x

tactic: have : (x * y - 1) ^ 2 = 0 := by
  rw [← Ideal.mem_bot, ← e]
  exact Ideal.pow_mem_pow this _
state_before: case h₁.intro
R✝ : Type ?u.10312
S✝ : Type ?u.10315
inst✝⁴ : CommSemiring R✝
inst✝³ : CommRing S✝
inst✝² : Algebra R✝ S✝
I✝ : Ideal S✝
R : Type u_1
inst✝¹ : CommRing R
S : Type u_1
inst✝ : CommRing S
I : Ideal S
e : I ^ 2 = ⊥
x : S
H : IsUnit (↑(Ideal.Quotient.mk I) x)
y : S
hy : ↑(Ideal.Quotient.mk I) y = ↑(IsUnit.unit H)⁻¹
this : x * y - 1 ∈ I
⊢ IsUnit x

tactic: have : x * (y * (2 - x * y)) = 1 := by
  rw [eq_comm, ← sub_eq_zero, ← this]
  ring
state_before: case h₁.intro
R✝ : Type ?u.10312
S✝ : Type ?u.10315
inst✝⁴ : CommSemiring R✝
inst✝³ : CommRing S✝
inst✝² : Algebra R✝ S✝
I✝ : Ideal S✝
R : Type u_1
inst✝¹ : CommRing R
S : Type u_1
inst✝ : CommRing S
I : Ideal S
e : I ^ 2 = ⊥
x : S
H : IsUnit (↑(Ideal.Quotient.mk I) x)
y : S
hy : ↑(Ideal.Quotient.mk I) y = ↑(IsUnit.unit H)⁻¹
this✝ : x * y - 1 ∈ I
this : (x * y - 1) ^ 2 = 0
⊢ IsUnit x

tactic: exact isUnit_of_mul_eq_one _ _ this
state_before: case h₁.intro
R✝ : Type ?u.10312
S✝ : Type ?u.10315
inst✝⁴ : CommSemiring R✝
inst✝³ : CommRing S✝
inst✝² : Algebra R✝ S✝
I✝ : Ideal S✝
R : Type u_1
inst✝¹ : CommRing R
S : Type u_1
inst✝ : CommRing S
I : Ideal S
e : I ^ 2 = ⊥
x : S
H : IsUnit (↑(Ideal.Quotient.mk I) x)
y : S
hy : ↑(Ideal.Quotient.mk I) y = ↑(IsUnit.unit H)⁻¹
this✝¹ : x * y - 1 ∈ I
this✝ : (x * y - 1) ^ 2 = 0
this : x * (y * (2 - x * y)) = 1
⊢ IsUnit x

tactic: rw [map_one, _root_.map_mul, hy, IsUnit.mul_val_inv]
state_before: R✝ : Type ?u.10312
S✝ : Type ?u.10315
inst✝⁴ : CommSemiring R✝
inst✝³ : CommRing S✝
inst✝² : Algebra R✝ S✝
I✝ : Ideal S✝
R : Type u_1
inst✝¹ : CommRing R
S : Type u_1
inst✝ : CommRing S
I : Ideal S
e : I ^ 2 = ⊥
x : S
H : IsUnit (↑(Ideal.Quotient.mk I) x)
y : S
hy : ↑(Ideal.Quotient.mk I) y = ↑(IsUnit.unit H)⁻¹
⊢ ↑(Ideal.Quotient.mk I) (x * y) = ↑(Ideal.Quotient.mk I) 1

tactic: rw [← Ideal.mem_bot, ← e]
state_before: R✝ : Type ?u.10312
S✝ : Type ?u.10315
inst✝⁴ : CommSemiring R✝
inst✝³ : CommRing S✝
inst✝² : Algebra R✝ S✝
I✝ : Ideal S✝
R : Type u_1
inst✝¹ : CommRing R
S : Type u_1
inst✝ : CommRing S
I : Ideal S
e : I ^ 2 = ⊥
x : S
H : IsUnit (↑(Ideal.Quotient.mk I) x)
y : S
hy : ↑(Ideal.Quotient.mk I) y = ↑(IsUnit.unit H)⁻¹
this : x * y - 1 ∈ I
⊢ (x * y - 1) ^ 2 = 0

tactic: exact Ideal.pow_mem_pow this _
state_before: R✝ : Type ?u.10312
S✝ : Type ?u.10315
inst✝⁴ : CommSemiring R✝
inst✝³ : CommRing S✝
inst✝² : Algebra R✝ S✝
I✝ : Ideal S✝
R : Type u_1
inst✝¹ : CommRing R
S : Type u_1
inst✝ : CommRing S
I : Ideal S
e : I ^ 2 = ⊥
x : S
H : IsUnit (↑(Ideal.Quotient.mk I) x)
y : S
hy : ↑(Ideal.Quotient.mk I) y = ↑(IsUnit.unit H)⁻¹
this : x * y - 1 ∈ I
⊢ (x * y - 1) ^ 2 ∈ I ^ 2

tactic: rw [eq_comm, ← sub_eq_zero, ← this]
state_before: R✝ : Type ?u.10312
S✝ : Type ?u.10315
inst✝⁴ : CommSemiring R✝
inst✝³ : CommRing S✝
inst✝² : Algebra R✝ S✝
I✝ : Ideal S✝
R : Type u_1
inst✝¹ : CommRing R
S : Type u_1
inst✝ : CommRing S
I : Ideal S
e : I ^ 2 = ⊥
x : S
H : IsUnit (↑(Ideal.Quotient.mk I) x)
y : S
hy : ↑(Ideal.Quotient.mk I) y = ↑(IsUnit.unit H)⁻¹
this✝ : x * y - 1 ∈ I
this : (x * y - 1) ^ 2 = 0
⊢ x * (y * (2 - x * y)) = 1

tactic: ring
state_before: R✝ : Type ?u.10312
S✝ : Type ?u.10315
inst✝⁴ : CommSemiring R✝
inst✝³ : CommRing S✝
inst✝² : Algebra R✝ S✝
I✝ : Ideal S✝
R : Type u_1
inst✝¹ : CommRing R
S : Type u_1
inst✝ : CommRing S
I : Ideal S
e : I ^ 2 = ⊥
x : S
H : IsUnit (↑(Ideal.Quotient.mk I) x)
y : S
hy : ↑(Ideal.Quotient.mk I) y = ↑(IsUnit.unit H)⁻¹
this✝ : x * y - 1 ∈ I
this : (x * y - 1) ^ 2 = 0
⊢ 1 - x * (y * (2 - x * y)) = (x * y - 1) ^ 2