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.1440
inst✝² : CommRing R
inst✝¹ : CommRing S
I J : Ideal R
inst✝ : IsPrime J
e : I ≤ J
⊢ ∃ p, p ∈ Ideal.minimalPrimes I ∧ p ≤ J

tactic: apply zorn_nonempty_partialOrder₀
state_before: R : Type u_1
S : Type ?u.1440
inst✝² : CommRing R
inst✝¹ : CommRing S
I J : Ideal R
inst✝ : IsPrime J
e : I ≤ J
⊢ ∃ m,
    m ∈ {p | IsPrime p ∧ I ≤ ↑OrderDual.ofDual p} ∧
      ↑OrderDual.toDual J ≤ m ∧ ∀ (z : (Ideal R)ᵒᵈ), z ∈ {p | IsPrime p ∧ I ≤ p} → m ≤ z → z = m

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

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

tactic: rintro (c : Set (Ideal R)) hc hc' J' hJ'
state_before: case ih
R : Type u_1
S : Type ?u.1440
inst✝² : CommRing R
inst✝¹ : CommRing S
I J : Ideal R
inst✝ : IsPrime J
e : I ≤ J
⊢ ∀ (c : Set (Ideal R)ᵒᵈ),
    c ⊆ {p | IsPrime p ∧ I ≤ ↑OrderDual.ofDual p} →
      IsChain (fun x x_1 => x ≤ x_1) c →
        ∀ (y : (Ideal R)ᵒᵈ),
          y ∈ c → ∃ ub, ub ∈ {p | IsPrime p ∧ I ≤ ↑OrderDual.ofDual p} ∧ ∀ (z : (Ideal R)ᵒᵈ), 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.1440
inst✝² : CommRing R
inst✝¹ : CommRing S
I J : Ideal R
inst✝ : IsPrime J
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, ub ∈ {p | IsPrime p ∧ I ≤ ↑OrderDual.ofDual p} ∧ ∀ (z : (Ideal R)ᵒᵈ), z ∈ c → z ≤ ub

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

tactic: simp_rw [← @eq_comm _ p] at h₃
state_before: case intro.intro.intro
R : Type u_1
S : Type ?u.1440
inst✝² : CommRing R
inst✝¹ : CommRing S
I J : Ideal R
inst✝ : IsPrime J
e : I ≤ J
p : (Ideal R)ᵒᵈ
h₁ : p ∈ {p | IsPrime p ∧ I ≤ ↑OrderDual.ofDual p}
h₂ : ↑OrderDual.toDual J ≤ p
h₃ : ∀ (z : (Ideal R)ᵒᵈ), z ∈ {p | IsPrime p ∧ I ≤ p} → p ≤ z → z = p
⊢ ∃ p, p ∈ Ideal.minimalPrimes I ∧ 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.1440
inst✝² : CommRing R
inst✝¹ : CommRing S
I J : Ideal R
inst✝ : IsPrime J
e : I ≤ J
p : (Ideal R)ᵒᵈ
h₁ : p ∈ {p | IsPrime p ∧ I ≤ ↑OrderDual.ofDual p}
h₂ : ↑OrderDual.toDual J ≤ p
h₃ : ∀ (z : (Ideal R)ᵒᵈ), z ∈ {p | IsPrime p ∧ I ≤ p} → p ≤ z → p = z
⊢ ∃ p, p ∈ Ideal.minimalPrimes I ∧ p ≤ J

tactic: refine' ⟨show J.IsPrime by infer_instance, e⟩
state_before: case hxs
R : Type u_1
S : Type ?u.1440
inst✝² : CommRing R
inst✝¹ : CommRing S
I J : Ideal R
inst✝ : IsPrime J
e : I ≤ J
⊢ ↑OrderDual.toDual J ∈ {p | IsPrime p ∧ I ≤ ↑OrderDual.ofDual p}

tactic: infer_instance
state_before: R : Type u_1
S : Type ?u.1440
inst✝² : CommRing R
inst✝¹ : CommRing S
I J : Ideal R
inst✝ : IsPrime J
e : I ≤ J
⊢ IsPrime J

tactic: rw [OrderDual.ofDual_toDual, le_sInf_iff]
state_before: case ih.refine'_1
R : Type u_1
S : Type ?u.1440
inst✝² : CommRing R
inst✝¹ : CommRing S
I J : Ideal R
inst✝ : IsPrime J
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))

tactic: exact fun _ hx => (hc hx).2
state_before: case ih.refine'_1
R : Type u_1
S : Type ?u.1440
inst✝² : CommRing R
inst✝¹ : CommRing S
I J : Ideal R
inst✝ : IsPrime J
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 : Ideal R), b ∈ c → I ≤ b

tactic: rintro z hz
state_before: case ih.refine'_2
R : Type u_1
S : Type ?u.1440
inst✝² : CommRing R
inst✝¹ : CommRing S
I J : Ideal R
inst✝ : IsPrime J
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)ᵒᵈ), 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.1440
inst✝² : CommRing R
inst✝¹ : CommRing S
I J : Ideal R
inst✝ : IsPrime J
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: exact sInf_le hz
state_before: case ih.refine'_2
R : Type u_1
S : Type ?u.1440
inst✝² : CommRing R
inst✝¹ : CommRing S
I J : Ideal R
inst✝ : IsPrime J
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