Theorem: Ideal.sup_eq_top_iff_isCoprime
File: Mathlib/RingTheory/Ideal/Operations.lean

tactic: rw [eq_top_iff_one, Submodule.mem_sup]
state_before: R✝ : Type u
ι : Type u_1
inst✝¹ : CommSemiring R✝
I J K L : Ideal R✝
R : Type u_2
inst✝ : CommSemiring R
x y : R
⊢ span {x} ⊔ span {y} = ⊤ ↔ IsCoprime x y
state_after: R✝ : Type u
ι : Type u_1
inst✝¹ : CommSemiring R✝
I J K L : Ideal R✝
R : Type u_2
inst✝ : CommSemiring R
x y : R
⊢ (∃ y_1 ∈ span {x}, ∃ z ∈ span {y}, y_1 + z = 1) ↔ IsCoprime x y

tactic: constructor
state_before: R✝ : Type u
ι : Type u_1
inst✝¹ : CommSemiring R✝
I J K L : Ideal R✝
R : Type u_2
inst✝ : CommSemiring R
x y : R
⊢ (∃ y_1 ∈ span {x}, ∃ z ∈ span {y}, y_1 + z = 1) ↔ IsCoprime x y
state_after: case mp
R✝ : Type u
ι : Type u_1
inst✝¹ : CommSemiring R✝
I J K L : Ideal R✝
R : Type u_2
inst✝ : CommSemiring R
x y : R
⊢ (∃ y_1 ∈ span {x}, ∃ z ∈ span {y}, y_1 + z = 1) → IsCoprime x y

case mpr
R✝ : Type u
ι : Type u_1
inst✝¹ : CommSemiring R✝
I J K L : Ideal R✝
R : Type u_2
inst✝ : CommSemiring R
x y : R
⊢ IsCoprime x y → ∃ y_1 ∈ span {x}, ∃ z ∈ span {y}, y_1 + z = 1

tactic: rintro ⟨u, hu, v, hv, h1⟩
state_before: case mp
R✝ : Type u
ι : Type u_1
inst✝¹ : CommSemiring R✝
I J K L : Ideal R✝
R : Type u_2
inst✝ : CommSemiring R
x y : R
⊢ (∃ y_1 ∈ span {x}, ∃ z ∈ span {y}, y_1 + z = 1) → IsCoprime x y
state_after: case mp.intro.intro.intro.intro
R✝ : Type u
ι : Type u_1
inst✝¹ : CommSemiring R✝
I J K L : Ideal R✝
R : Type u_2
inst✝ : CommSemiring R
x y u : R
hu : u ∈ span {x}
v : R
hv : v ∈ span {y}
h1 : u + v = 1
⊢ IsCoprime x y

tactic: rw [mem_span_singleton'] at hu hv
state_before: case mp.intro.intro.intro.intro
R✝ : Type u
ι : Type u_1
inst✝¹ : CommSemiring R✝
I J K L : Ideal R✝
R : Type u_2
inst✝ : CommSemiring R
x y u : R
hu : u ∈ span {x}
v : R
hv : v ∈ span {y}
h1 : u + v = 1
⊢ IsCoprime x y
state_after: case mp.intro.intro.intro.intro
R✝ : Type u
ι : Type u_1
inst✝¹ : CommSemiring R✝
I J K L : Ideal R✝
R : Type u_2
inst✝ : CommSemiring R
x y u : R
hu : ∃ a, a * x = u
v : R
hv : ∃ a, a * y = v
h1 : u + v = 1
⊢ IsCoprime x y

tactic: rw [← hu.choose_spec, ← hv.choose_spec] at h1
state_before: case mp.intro.intro.intro.intro
R✝ : Type u
ι : Type u_1
inst✝¹ : CommSemiring R✝
I J K L : Ideal R✝
R : Type u_2
inst✝ : CommSemiring R
x y u : R
hu : ∃ a, a * x = u
v : R
hv : ∃ a, a * y = v
h1 : u + v = 1
⊢ IsCoprime x y
state_after: case mp.intro.intro.intro.intro
R✝ : Type u
ι : Type u_1
inst✝¹ : CommSemiring R✝
I J K L : Ideal R✝
R : Type u_2
inst✝ : CommSemiring R
x y u : R
hu : ∃ a, a * x = u
v : R
hv : ∃ a, a * y = v
h1 : hu.choose * x + hv.choose * y = 1
⊢ IsCoprime x y

tactic: exact ⟨_, _, h1⟩
state_before: case mp.intro.intro.intro.intro
R✝ : Type u
ι : Type u_1
inst✝¹ : CommSemiring R✝
I J K L : Ideal R✝
R : Type u_2
inst✝ : CommSemiring R
x y u : R
hu : ∃ a, a * x = u
v : R
hv : ∃ a, a * y = v
h1 : hu.choose * x + hv.choose * y = 1
⊢ IsCoprime x y
state_after: no goals

tactic: exact fun ⟨u, v, h1⟩ =>
  ⟨_, mem_span_singleton'.mpr ⟨_, rfl⟩, _, mem_span_singleton'.mpr ⟨_, rfl⟩, h1⟩
state_before: case mpr
R✝ : Type u
ι : Type u_1
inst✝¹ : CommSemiring R✝
I J K L : Ideal R✝
R : Type u_2
inst✝ : CommSemiring R
x y : R
⊢ IsCoprime x y → ∃ y_1 ∈ span {x}, ∃ z ∈ span {y}, y_1 + z = 1
state_after: no goals