Theorem: Ideal.exists_minimalPrimes_le
File: Mathlib/RingTheory/Ideal/MinimalPrime.lean

tactic: suffices
  ∃ m ∈ { p : (Ideal R)ᵒᵈ | Ideal.IsPrime p ∧ I ≤ OrderDual.ofDual p },
    OrderDual.toDual J ≤ m ∧ ∀ z ∈ { p : (Ideal R)ᵒᵈ | Ideal.IsPrime p ∧ I ≤ p }, m ≤ z → z = m by
  obtain ⟨p, h₁, h₂, h₃⟩ := this
  simp_rw [← @eq_comm _ p] at h₃
  exact ⟨p, ⟨h₁, fun a b c => le_of_eq (h₃ a b c)⟩, h₂⟩
state_before: R : Type u_1
S : Type u_2
inst✝² : CommSemiring R
inst✝¹ : CommSemiring S
I J : Ideal R
inst✝ : J.IsPrime
e : I ≤ J
⊢ ∃ p ∈ I.minimalPrimes, p ≤ J
state_after: R : Type u_1
S : Type u_2
inst✝² : CommSemiring R
inst✝¹ : CommSemiring S
I J : Ideal R
inst✝ : J.IsPrime
e : I ≤ J
⊢ ∃ m ∈ {p | IsPrime p ∧ I ≤ OrderDual.ofDual p}, OrderDual.toDual J ≤ m ∧ ∀ z ∈ {p | IsPrime p ∧ I ≤ p}, m ≤ z → z = m

tactic: apply zorn_nonempty_partialOrder₀
state_before: R : Type u_1
S : Type u_2
inst✝² : CommSemiring R
inst✝¹ : CommSemiring S
I J : Ideal R
inst✝ : J.IsPrime
e : I ≤ J
⊢ ∃ m ∈ {p | IsPrime p ∧ I ≤ OrderDual.ofDual p}, OrderDual.toDual J ≤ m ∧ ∀ z ∈ {p | IsPrime p ∧ I ≤ p}, m ≤ z → z = m
state_after: case ih
R : Type u_1
S : Type u_2
inst✝² : CommSemiring R
inst✝¹ : CommSemiring S
I J : Ideal R
inst✝ : J.IsPrime
e : I ≤ J
⊢ ∀ c ⊆ {p | IsPrime p ∧ I ≤ OrderDual.ofDual p},
    IsChain (fun x x_1 => x ≤ x_1) c → ∀ y ∈ c, ∃ ub ∈ {p | IsPrime p ∧ I ≤ OrderDual.ofDual p}, ∀ z ∈ c, z ≤ ub

case hxs
R : Type u_1
S : Type u_2
inst✝² : CommSemiring R
inst✝¹ : CommSemiring S
I J : Ideal R
inst✝ : J.IsPrime
e : I ≤ J
⊢ OrderDual.toDual J ∈ {p | IsPrime p ∧ I ≤ OrderDual.ofDual p}

tactic: swap
state_before: case ih
R : Type u_1
S : Type u_2
inst✝² : CommSemiring R
inst✝¹ : CommSemiring S
I J : Ideal R
inst✝ : J.IsPrime
e : I ≤ J
⊢ ∀ c ⊆ {p | IsPrime p ∧ I ≤ OrderDual.ofDual p},
    IsChain (fun x x_1 => x ≤ x_1) c → ∀ y ∈ c, ∃ ub ∈ {p | IsPrime p ∧ I ≤ OrderDual.ofDual p}, ∀ z ∈ c, z ≤ ub

case hxs
R : Type u_1
S : Type u_2
inst✝² : CommSemiring R
inst✝¹ : CommSemiring S
I J : Ideal R
inst✝ : J.IsPrime
e : I ≤ J
⊢ OrderDual.toDual J ∈ {p | IsPrime p ∧ I ≤ OrderDual.ofDual p}
state_after: case hxs
R : Type u_1
S : Type u_2
inst✝² : CommSemiring R
inst✝¹ : CommSemiring S
I J : Ideal R
inst✝ : J.IsPrime
e : I ≤ J
⊢ OrderDual.toDual J ∈ {p | IsPrime p ∧ I ≤ OrderDual.ofDual p}

case ih
R : Type u_1
S : Type u_2
inst✝² : CommSemiring R
inst✝¹ : CommSemiring S
I J : Ideal R
inst✝ : J.IsPrime
e : I ≤ J
⊢ ∀ c ⊆ {p | IsPrime p ∧ I ≤ OrderDual.ofDual p},
    IsChain (fun x x_1 => x ≤ x_1) c → ∀ y ∈ c, ∃ ub ∈ {p | IsPrime p ∧ I ≤ OrderDual.ofDual p}, ∀ z ∈ c, z ≤ ub

tactic: rintro (c : Set (Ideal R)) hc hc' J' hJ'
state_before: case ih
R : Type u_1
S : Type u_2
inst✝² : CommSemiring R
inst✝¹ : CommSemiring S
I J : Ideal R
inst✝ : J.IsPrime
e : I ≤ J
⊢ ∀ c ⊆ {p | IsPrime p ∧ I ≤ OrderDual.ofDual p},
    IsChain (fun x x_1 => x ≤ x_1) c → ∀ y ∈ c, ∃ ub ∈ {p | IsPrime p ∧ I ≤ OrderDual.ofDual p}, ∀ z ∈ c, z ≤ ub
state_after: case ih
R : Type u_1
S : Type u_2
inst✝² : CommSemiring R
inst✝¹ : CommSemiring S
I J : Ideal R
inst✝ : J.IsPrime
e : I ≤ J
c : Set (Ideal R)
hc : c ⊆ {p | IsPrime p ∧ I ≤ OrderDual.ofDual p}
hc' : IsChain (fun x x_1 => x ≤ x_1) c
J' : (Ideal R)ᵒᵈ
hJ' : J' ∈ c
⊢ ∃ ub ∈ {p | IsPrime p ∧ I ≤ OrderDual.ofDual p}, ∀ z ∈ c, z ≤ ub

tactic: refine
  ⟨OrderDual.toDual (sInf c),
    ⟨Ideal.sInf_isPrime_of_isChain ⟨J', hJ'⟩ hc'.symm fun x hx => (hc hx).1, ?_⟩, ?_⟩
state_before: case ih
R : Type u_1
S : Type u_2
inst✝² : CommSemiring R
inst✝¹ : CommSemiring S
I J : Ideal R
inst✝ : J.IsPrime
e : I ≤ J
c : Set (Ideal R)
hc : c ⊆ {p | IsPrime p ∧ I ≤ OrderDual.ofDual p}
hc' : IsChain (fun x x_1 => x ≤ x_1) c
J' : (Ideal R)ᵒᵈ
hJ' : J' ∈ c
⊢ ∃ ub ∈ {p | IsPrime p ∧ I ≤ OrderDual.ofDual p}, ∀ z ∈ c, z ≤ ub
state_after: case ih.refine_1
R : Type u_1
S : Type u_2
inst✝² : CommSemiring R
inst✝¹ : CommSemiring S
I J : Ideal R
inst✝ : J.IsPrime
e : I ≤ J
c : Set (Ideal R)
hc : c ⊆ {p | IsPrime p ∧ I ≤ OrderDual.ofDual p}
hc' : IsChain (fun x x_1 => x ≤ x_1) c
J' : (Ideal R)ᵒᵈ
hJ' : J' ∈ c
⊢ I ≤ OrderDual.ofDual (OrderDual.toDual (sInf c))

case ih.refine_2
R : Type u_1
S : Type u_2
inst✝² : CommSemiring R
inst✝¹ : CommSemiring S
I J : Ideal R
inst✝ : J.IsPrime
e : I ≤ J
c : Set (Ideal R)
hc : c ⊆ {p | IsPrime p ∧ I ≤ OrderDual.ofDual p}
hc' : IsChain (fun x x_1 => x ≤ x_1) c
J' : (Ideal R)ᵒᵈ
hJ' : J' ∈ c
⊢ ∀ z ∈ c, z ≤ OrderDual.toDual (sInf c)

tactic: obtain ⟨p, h₁, h₂, h₃⟩ := this
state_before: R : Type u_1
S : Type u_2
inst✝² : CommSemiring R
inst✝¹ : CommSemiring S
I J : Ideal R
inst✝ : J.IsPrime
e : I ≤ J
this :
  ∃ m ∈ {p | IsPrime p ∧ I ≤ OrderDual.ofDual p}, OrderDual.toDual J ≤ m ∧ ∀ z ∈ {p | IsPrime p ∧ I ≤ p}, m ≤ z → z = m
⊢ ∃ p ∈ I.minimalPrimes, p ≤ J
state_after: case intro.intro.intro
R : Type u_1
S : Type u_2
inst✝² : CommSemiring R
inst✝¹ : CommSemiring S
I J : Ideal R
inst✝ : J.IsPrime
e : I ≤ J
p : (Ideal R)ᵒᵈ
h₁ : p ∈ {p | IsPrime p ∧ I ≤ OrderDual.ofDual p}
h₂ : OrderDual.toDual J ≤ p
h₃ : ∀ z ∈ {p | IsPrime p ∧ I ≤ p}, p ≤ z → z = p
⊢ ∃ p ∈ I.minimalPrimes, p ≤ J

tactic: simp_rw [← @eq_comm _ p] at h₃
state_before: case intro.intro.intro
R : Type u_1
S : Type u_2
inst✝² : CommSemiring R
inst✝¹ : CommSemiring S
I J : Ideal R
inst✝ : J.IsPrime
e : I ≤ J
p : (Ideal R)ᵒᵈ
h₁ : p ∈ {p | IsPrime p ∧ I ≤ OrderDual.ofDual p}
h₂ : OrderDual.toDual J ≤ p
h₃ : ∀ z ∈ {p | IsPrime p ∧ I ≤ p}, p ≤ z → z = p
⊢ ∃ p ∈ I.minimalPrimes, p ≤ J
state_after: case intro.intro.intro
R : Type u_1
S : Type u_2
inst✝² : CommSemiring R
inst✝¹ : CommSemiring S
I J : Ideal R
inst✝ : J.IsPrime
e : I ≤ J
p : (Ideal R)ᵒᵈ
h₁ : p ∈ {p | IsPrime p ∧ I ≤ OrderDual.ofDual p}
h₂ : OrderDual.toDual J ≤ p
h₃ : ∀ z ∈ {p | IsPrime p ∧ I ≤ p}, p ≤ z → p = z
⊢ ∃ p ∈ I.minimalPrimes, p ≤ J

tactic: exact ⟨p, ⟨h₁, fun a b c => le_of_eq (h₃ a b c)⟩, h₂⟩
state_before: case intro.intro.intro
R : Type u_1
S : Type u_2
inst✝² : CommSemiring R
inst✝¹ : CommSemiring S
I J : Ideal R
inst✝ : J.IsPrime
e : I ≤ J
p : (Ideal R)ᵒᵈ
h₁ : p ∈ {p | IsPrime p ∧ I ≤ OrderDual.ofDual p}
h₂ : OrderDual.toDual J ≤ p
h₃ : ∀ z ∈ {p | IsPrime p ∧ I ≤ p}, p ≤ z → p = z
⊢ ∃ p ∈ I.minimalPrimes, p ≤ J
state_after: no goals

tactic: refine ⟨show J.IsPrime by infer_instance, e⟩
state_before: case hxs
R : Type u_1
S : Type u_2
inst✝² : CommSemiring R
inst✝¹ : CommSemiring S
I J : Ideal R
inst✝ : J.IsPrime
e : I ≤ J
⊢ OrderDual.toDual J ∈ {p | IsPrime p ∧ I ≤ OrderDual.ofDual p}
state_after: no goals

tactic: infer_instance
state_before: R : Type u_1
S : Type u_2
inst✝² : CommSemiring R
inst✝¹ : CommSemiring S
I J : Ideal R
inst✝ : J.IsPrime
e : I ≤ J
⊢ J.IsPrime
state_after: no goals

tactic: rw [OrderDual.ofDual_toDual, le_sInf_iff]
state_before: case ih.refine_1
R : Type u_1
S : Type u_2
inst✝² : CommSemiring R
inst✝¹ : CommSemiring S
I J : Ideal R
inst✝ : J.IsPrime
e : I ≤ J
c : Set (Ideal R)
hc : c ⊆ {p | IsPrime p ∧ I ≤ OrderDual.ofDual p}
hc' : IsChain (fun x x_1 => x ≤ x_1) c
J' : (Ideal R)ᵒᵈ
hJ' : J' ∈ c
⊢ I ≤ OrderDual.ofDual (OrderDual.toDual (sInf c))
state_after: case ih.refine_1
R : Type u_1
S : Type u_2
inst✝² : CommSemiring R
inst✝¹ : CommSemiring S
I J : Ideal R
inst✝ : J.IsPrime
e : I ≤ J
c : Set (Ideal R)
hc : c ⊆ {p | IsPrime p ∧ I ≤ OrderDual.ofDual p}
hc' : IsChain (fun x x_1 => x ≤ x_1) c
J' : (Ideal R)ᵒᵈ
hJ' : J' ∈ c
⊢ ∀ b ∈ c, I ≤ b

tactic: exact fun _ hx => (hc hx).2
state_before: case ih.refine_1
R : Type u_1
S : Type u_2
inst✝² : CommSemiring R
inst✝¹ : CommSemiring S
I J : Ideal R
inst✝ : J.IsPrime
e : I ≤ J
c : Set (Ideal R)
hc : c ⊆ {p | IsPrime p ∧ I ≤ OrderDual.ofDual p}
hc' : IsChain (fun x x_1 => x ≤ x_1) c
J' : (Ideal R)ᵒᵈ
hJ' : J' ∈ c
⊢ ∀ b ∈ c, I ≤ b
state_after: no goals

tactic: rintro z hz
state_before: case ih.refine_2
R : Type u_1
S : Type u_2
inst✝² : CommSemiring R
inst✝¹ : CommSemiring S
I J : Ideal R
inst✝ : J.IsPrime
e : I ≤ J
c : Set (Ideal R)
hc : c ⊆ {p | IsPrime p ∧ I ≤ OrderDual.ofDual p}
hc' : IsChain (fun x x_1 => x ≤ x_1) c
J' : (Ideal R)ᵒᵈ
hJ' : J' ∈ c
⊢ ∀ z ∈ c, z ≤ OrderDual.toDual (sInf c)
state_after: case ih.refine_2
R : Type u_1
S : Type u_2
inst✝² : CommSemiring R
inst✝¹ : CommSemiring S
I J : Ideal R
inst✝ : J.IsPrime
e : I ≤ J
c : Set (Ideal R)
hc : c ⊆ {p | IsPrime p ∧ I ≤ OrderDual.ofDual p}
hc' : IsChain (fun x x_1 => x ≤ x_1) c
J' : (Ideal R)ᵒᵈ
hJ' : J' ∈ c
z : (Ideal R)ᵒᵈ
hz : z ∈ c
⊢ z ≤ OrderDual.toDual (sInf c)

tactic: rw [OrderDual.le_toDual]
state_before: case ih.refine_2
R : Type u_1
S : Type u_2
inst✝² : CommSemiring R
inst✝¹ : CommSemiring S
I J : Ideal R
inst✝ : J.IsPrime
e : I ≤ J
c : Set (Ideal R)
hc : c ⊆ {p | IsPrime p ∧ I ≤ OrderDual.ofDual p}
hc' : IsChain (fun x x_1 => x ≤ x_1) c
J' : (Ideal R)ᵒᵈ
hJ' : J' ∈ c
z : (Ideal R)ᵒᵈ
hz : z ∈ c
⊢ z ≤ OrderDual.toDual (sInf c)
state_after: case ih.refine_2
R : Type u_1
S : Type u_2
inst✝² : CommSemiring R
inst✝¹ : CommSemiring S
I J : Ideal R
inst✝ : J.IsPrime
e : I ≤ J
c : Set (Ideal R)
hc : c ⊆ {p | IsPrime p ∧ I ≤ OrderDual.ofDual p}
hc' : IsChain (fun x x_1 => x ≤ x_1) c
J' : (Ideal R)ᵒᵈ
hJ' : J' ∈ c
z : (Ideal R)ᵒᵈ
hz : z ∈ c
⊢ sInf c ≤ OrderDual.ofDual z

tactic: exact sInf_le hz
state_before: case ih.refine_2
R : Type u_1
S : Type u_2
inst✝² : CommSemiring R
inst✝¹ : CommSemiring S
I J : Ideal R
inst✝ : J.IsPrime
e : I ≤ J
c : Set (Ideal R)
hc : c ⊆ {p | IsPrime p ∧ I ≤ OrderDual.ofDual p}
hc' : IsChain (fun x x_1 => x ≤ x_1) c
J' : (Ideal R)ᵒᵈ
hJ' : J' ∈ c
z : (Ideal R)ᵒᵈ
hz : z ∈ c
⊢ sInf c ≤ OrderDual.ofDual z
state_after: no goals