Theorem: map_prime_of_factor_orderIso
File: Mathlib/RingTheory/ChainOfDivisors.lean

tactic: rw [← irreducible_iff_prime]
state_before: M : Type u_1
inst✝⁴ : CancelCommMonoidWithZero M
N : Type u_2
inst✝³ : CancelCommMonoidWithZero N
inst✝² : UniqueFactorizationMonoid N
inst✝¹ : UniqueFactorizationMonoid M
inst✝ : DecidableEq (Associates M)
m p : Associates M
n : Associates N
hn : n ≠ 0
hp : p ∈ normalizedFactors m
d : ↑(Set.Iic m) ≃o ↑(Set.Iic n)
⊢ Prime ↑(↑d { val := p, property := (_ : p ∣ m) })

tactic: refine' (Associates.isAtom_iff <| ne_zero_of_dvd_ne_zero hn (d ⟨p, _⟩).prop).mp ⟨_, fun b hb => _⟩
state_before: M : Type u_1
inst✝⁴ : CancelCommMonoidWithZero M
N : Type u_2
inst✝³ : CancelCommMonoidWithZero N
inst✝² : UniqueFactorizationMonoid N
inst✝¹ : UniqueFactorizationMonoid M
inst✝ : DecidableEq (Associates M)
m p : Associates M
n : Associates N
hn : n ≠ 0
hp : p ∈ normalizedFactors m
d : ↑(Set.Iic m) ≃o ↑(Set.Iic n)
⊢ Irreducible ↑(↑d { val := p, property := (_ : p ∣ m) })

tactic: rw [Ne.def, ← Associates.isUnit_iff_eq_bot, Associates.isUnit_iff_eq_one,
  coe_factor_orderIso_map_eq_one_iff _ d]
state_before: case refine'_1
M : Type u_1
inst✝⁴ : CancelCommMonoidWithZero M
N : Type u_2
inst✝³ : CancelCommMonoidWithZero N
inst✝² : UniqueFactorizationMonoid N
inst✝¹ : UniqueFactorizationMonoid M
inst✝ : DecidableEq (Associates M)
m p : Associates M
n : Associates N
hn : n ≠ 0
hp : p ∈ normalizedFactors m
d : ↑(Set.Iic m) ≃o ↑(Set.Iic n)
⊢ ↑(↑d { val := p, property := (_ : p ∣ m) }) ≠ ⊥

tactic: rintro rfl
state_before: case refine'_1
M : Type u_1
inst✝⁴ : CancelCommMonoidWithZero M
N : Type u_2
inst✝³ : CancelCommMonoidWithZero N
inst✝² : UniqueFactorizationMonoid N
inst✝¹ : UniqueFactorizationMonoid M
inst✝ : DecidableEq (Associates M)
m p : Associates M
n : Associates N
hn : n ≠ 0
hp : p ∈ normalizedFactors m
d : ↑(Set.Iic m) ≃o ↑(Set.Iic n)
⊢ ¬p = 1

tactic: exact (prime_of_normalized_factor 1 hp).not_unit isUnit_one
state_before: case refine'_1
M : Type u_1
inst✝⁴ : CancelCommMonoidWithZero M
N : Type u_2
inst✝³ : CancelCommMonoidWithZero N
inst✝² : UniqueFactorizationMonoid N
inst✝¹ : UniqueFactorizationMonoid M
inst✝ : DecidableEq (Associates M)
m : Associates M
n : Associates N
hn : n ≠ 0
d : ↑(Set.Iic m) ≃o ↑(Set.Iic n)
hp : 1 ∈ normalizedFactors m
⊢ False

tactic: obtain ⟨x, hx⟩ :=
  d.surjective ⟨b, le_trans (le_of_lt hb) (d ⟨p, dvd_of_mem_normalizedFactors hp⟩).prop⟩
state_before: case refine'_2
M : Type u_1
inst✝⁴ : CancelCommMonoidWithZero M
N : Type u_2
inst✝³ : CancelCommMonoidWithZero N
inst✝² : UniqueFactorizationMonoid N
inst✝¹ : UniqueFactorizationMonoid M
inst✝ : DecidableEq (Associates M)
m p : Associates M
n : Associates N
hn : n ≠ 0
hp : p ∈ normalizedFactors m
d : ↑(Set.Iic m) ≃o ↑(Set.Iic n)
b : Associates N
hb : b < ↑(↑d { val := p, property := (_ : p ∣ m) })
⊢ b = ⊥

tactic: rw [← Subtype.coe_mk b _, ← hx] at hb
state_before: case refine'_2.intro
M : Type u_1
inst✝⁴ : CancelCommMonoidWithZero M
N : Type u_2
inst✝³ : CancelCommMonoidWithZero N
inst✝² : UniqueFactorizationMonoid N
inst✝¹ : UniqueFactorizationMonoid M
inst✝ : DecidableEq (Associates M)
m p : Associates M
n : Associates N
hn : n ≠ 0
hp : p ∈ normalizedFactors m
d : ↑(Set.Iic m) ≃o ↑(Set.Iic n)
b : Associates N
hb : b < ↑(↑d { val := p, property := (_ : p ∣ m) })
x : ↑(Set.Iic m)
hx : ↑d x = { val := b, property := (_ : b ≤ n) }
⊢ b = ⊥

tactic: letI : OrderBot { l : Associates M // l ≤ m } := Subtype.orderBot bot_le
state_before: case refine'_2.intro
M : Type u_1
inst✝⁴ : CancelCommMonoidWithZero M
N : Type u_2
inst✝³ : CancelCommMonoidWithZero N
inst✝² : UniqueFactorizationMonoid N
inst✝¹ : UniqueFactorizationMonoid M
inst✝ : DecidableEq (Associates M)
m p : Associates M
n : Associates N
hn : n ≠ 0
hp : p ∈ normalizedFactors m
d : ↑(Set.Iic m) ≃o ↑(Set.Iic n)
b : Associates N
hb✝ : b < ↑(↑d { val := p, property := (_ : p ∣ m) })
x : ↑(Set.Iic m)
hb : ↑(↑d x) < ↑(↑d { val := p, property := (_ : p ∣ m) })
hx : ↑d x = { val := b, property := (_ : b ≤ n) }
⊢ b = ⊥

tactic: letI : OrderBot { l : Associates N // l ≤ n } := Subtype.orderBot bot_le
state_before: case refine'_2.intro
M : Type u_1
inst✝⁴ : CancelCommMonoidWithZero M
N : Type u_2
inst✝³ : CancelCommMonoidWithZero N
inst✝² : UniqueFactorizationMonoid N
inst✝¹ : UniqueFactorizationMonoid M
inst✝ : DecidableEq (Associates M)
m p : Associates M
n : Associates N
hn : n ≠ 0
hp : p ∈ normalizedFactors m
d : ↑(Set.Iic m) ≃o ↑(Set.Iic n)
b : Associates N
hb✝ : b < ↑(↑d { val := p, property := (_ : p ∣ m) })
x : ↑(Set.Iic m)
hb : ↑(↑d x) < ↑(↑d { val := p, property := (_ : p ∣ m) })
hx : ↑d x = { val := b, property := (_ : b ≤ n) }
this : OrderBot { l // l ≤ m } := Subtype.orderBot (_ : ⊥ ≤ m)
⊢ b = ⊥

tactic: suffices x = ⊥ by
  rw [this, OrderIso.map_bot d] at hx
  refine' (Subtype.mk_eq_bot_iff _ _).mp hx.symm
  simp
state_before: case refine'_2.intro
M : Type u_1
inst✝⁴ : CancelCommMonoidWithZero M
N : Type u_2
inst✝³ : CancelCommMonoidWithZero N
inst✝² : UniqueFactorizationMonoid N
inst✝¹ : UniqueFactorizationMonoid M
inst✝ : DecidableEq (Associates M)
m p : Associates M
n : Associates N
hn : n ≠ 0
hp : p ∈ normalizedFactors m
d : ↑(Set.Iic m) ≃o ↑(Set.Iic n)
b : Associates N
hb✝ : b < ↑(↑d { val := p, property := (_ : p ∣ m) })
x : ↑(Set.Iic m)
hb : ↑(↑d x) < ↑(↑d { val := p, property := (_ : p ∣ m) })
hx : ↑d x = { val := b, property := (_ : b ≤ n) }
this✝ : OrderBot { l // l ≤ m } := Subtype.orderBot (_ : ⊥ ≤ m)
this : OrderBot { l // l ≤ n } := Subtype.orderBot (_ : ⊥ ≤ n)
⊢ b = ⊥

tactic: obtain ⟨a, ha⟩ := x
state_before: case refine'_2.intro
M : Type u_1
inst✝⁴ : CancelCommMonoidWithZero M
N : Type u_2
inst✝³ : CancelCommMonoidWithZero N
inst✝² : UniqueFactorizationMonoid N
inst✝¹ : UniqueFactorizationMonoid M
inst✝ : DecidableEq (Associates M)
m p : Associates M
n : Associates N
hn : n ≠ 0
hp : p ∈ normalizedFactors m
d : ↑(Set.Iic m) ≃o ↑(Set.Iic n)
b : Associates N
hb✝ : b < ↑(↑d { val := p, property := (_ : p ∣ m) })
x : ↑(Set.Iic m)
hb : ↑(↑d x) < ↑(↑d { val := p, property := (_ : p ∣ m) })
hx : ↑d x = { val := b, property := (_ : b ≤ n) }
this✝ : OrderBot { l // l ≤ m } := Subtype.orderBot (_ : ⊥ ≤ m)
this : OrderBot { l // l ≤ n } := Subtype.orderBot (_ : ⊥ ≤ n)
⊢ x = ⊥

tactic: rw [Subtype.mk_eq_bot_iff]
state_before: case refine'_2.intro.mk
M : Type u_1
inst✝⁴ : CancelCommMonoidWithZero M
N : Type u_2
inst✝³ : CancelCommMonoidWithZero N
inst✝² : UniqueFactorizationMonoid N
inst✝¹ : UniqueFactorizationMonoid M
inst✝ : DecidableEq (Associates M)
m p : Associates M
n : Associates N
hn : n ≠ 0
hp : p ∈ normalizedFactors m
d : ↑(Set.Iic m) ≃o ↑(Set.Iic n)
b : Associates N
hb✝ : b < ↑(↑d { val := p, property := (_ : p ∣ m) })
this✝ : OrderBot { l // l ≤ m } := Subtype.orderBot (_ : ⊥ ≤ m)
this : OrderBot { l // l ≤ n } := Subtype.orderBot (_ : ⊥ ≤ n)
a : Associates M
ha : a ∈ Set.Iic m
hb : ↑(↑d { val := a, property := ha }) < ↑(↑d { val := p, property := (_ : p ∣ m) })
hx : ↑d { val := a, property := ha } = { val := b, property := (_ : b ≤ n) }
⊢ { val := a, property := ha } = ⊥

tactic: simp
state_before: case refine'_2.intro.mk.hbot
M : Type u_1
inst✝⁴ : CancelCommMonoidWithZero M
N : Type u_2
inst✝³ : CancelCommMonoidWithZero N
inst✝² : UniqueFactorizationMonoid N
inst✝¹ : UniqueFactorizationMonoid M
inst✝ : DecidableEq (Associates M)
m p : Associates M
n : Associates N
hn : n ≠ 0
hp : p ∈ normalizedFactors m
d : ↑(Set.Iic m) ≃o ↑(Set.Iic n)
b : Associates N
hb✝ : b < ↑(↑d { val := p, property := (_ : p ∣ m) })
this✝ : OrderBot { l // l ≤ m } := Subtype.orderBot (_ : ⊥ ≤ m)
this : OrderBot { l // l ≤ n } := Subtype.orderBot (_ : ⊥ ≤ n)
a : Associates M
ha : a ∈ Set.Iic m
hb : ↑(↑d { val := a, property := ha }) < ↑(↑d { val := p, property := (_ : p ∣ m) })
hx : ↑d { val := a, property := ha } = { val := b, property := (_ : b ≤ n) }
⊢ ⊥ ∈ Set.Iic m

tactic: rw [this, OrderIso.map_bot d] at hx
state_before: M : Type u_1
inst✝⁴ : CancelCommMonoidWithZero M
N : Type u_2
inst✝³ : CancelCommMonoidWithZero N
inst✝² : UniqueFactorizationMonoid N
inst✝¹ : UniqueFactorizationMonoid M
inst✝ : DecidableEq (Associates M)
m p : Associates M
n : Associates N
hn : n ≠ 0
hp : p ∈ normalizedFactors m
d : ↑(Set.Iic m) ≃o ↑(Set.Iic n)
b : Associates N
hb✝ : b < ↑(↑d { val := p, property := (_ : p ∣ m) })
x : ↑(Set.Iic m)
hb : ↑(↑d x) < ↑(↑d { val := p, property := (_ : p ∣ m) })
hx : ↑d x = { val := b, property := (_ : b ≤ n) }
this✝¹ : OrderBot { l // l ≤ m } := Subtype.orderBot (_ : ⊥ ≤ m)
this✝ : OrderBot { l // l ≤ n } := Subtype.orderBot (_ : ⊥ ≤ n)
this : x = ⊥
⊢ b = ⊥

tactic: refine' (Subtype.mk_eq_bot_iff _ _).mp hx.symm
state_before: M : Type u_1
inst✝⁴ : CancelCommMonoidWithZero M
N : Type u_2
inst✝³ : CancelCommMonoidWithZero N
inst✝² : UniqueFactorizationMonoid N
inst✝¹ : UniqueFactorizationMonoid M
inst✝ : DecidableEq (Associates M)
m p : Associates M
n : Associates N
hn : n ≠ 0
hp : p ∈ normalizedFactors m
d : ↑(Set.Iic m) ≃o ↑(Set.Iic n)
b : Associates N
hb✝ : b < ↑(↑d { val := p, property := (_ : p ∣ m) })
x : ↑(Set.Iic m)
hb : ↑(↑d x) < ↑(↑d { val := p, property := (_ : p ∣ m) })
hx : ⊥ = { val := b, property := (_ : b ≤ n) }
this✝¹ : OrderBot { l // l ≤ m } := Subtype.orderBot (_ : ⊥ ≤ m)
this✝ : OrderBot { l // l ≤ n } := Subtype.orderBot (_ : ⊥ ≤ n)
this : x = ⊥
⊢ b = ⊥

tactic: simp
state_before: M : Type u_1
inst✝⁴ : CancelCommMonoidWithZero M
N : Type u_2
inst✝³ : CancelCommMonoidWithZero N
inst✝² : UniqueFactorizationMonoid N
inst✝¹ : UniqueFactorizationMonoid M
inst✝ : DecidableEq (Associates M)
m p : Associates M
n : Associates N
hn : n ≠ 0
hp : p ∈ normalizedFactors m
d : ↑(Set.Iic m) ≃o ↑(Set.Iic n)
b : Associates N
hb✝ : b < ↑(↑d { val := p, property := (_ : p ∣ m) })
x : ↑(Set.Iic m)
hb : ↑(↑d x) < ↑(↑d { val := p, property := (_ : p ∣ m) })
hx : ⊥ = { val := b, property := (_ : b ≤ n) }
this✝¹ : OrderBot { l // l ≤ m } := Subtype.orderBot (_ : ⊥ ≤ m)
this✝ : OrderBot { l // l ≤ n } := Subtype.orderBot (_ : ⊥ ≤ n)
this : x = ⊥
⊢ ⊥ ∈ Set.Iic n

tactic: exact
  ((Associates.isAtom_iff <| Prime.ne_zero <| prime_of_normalized_factor p hp).mpr <|
        irreducible_of_normalized_factor p hp).right
    a (Subtype.mk_lt_mk.mp <| d.lt_iff_lt.mp hb)
state_before: case refine'_2.intro.mk
M : Type u_1
inst✝⁴ : CancelCommMonoidWithZero M
N : Type u_2
inst✝³ : CancelCommMonoidWithZero N
inst✝² : UniqueFactorizationMonoid N
inst✝¹ : UniqueFactorizationMonoid M
inst✝ : DecidableEq (Associates M)
m p : Associates M
n : Associates N
hn : n ≠ 0
hp : p ∈ normalizedFactors m
d : ↑(Set.Iic m) ≃o ↑(Set.Iic n)
b : Associates N
hb✝ : b < ↑(↑d { val := p, property := (_ : p ∣ m) })
this✝ : OrderBot { l // l ≤ m } := Subtype.orderBot (_ : ⊥ ≤ m)
this : OrderBot { l // l ≤ n } := Subtype.orderBot (_ : ⊥ ≤ n)
a : Associates M
ha : a ∈ Set.Iic m
hb : ↑(↑d { val := a, property := ha }) < ↑(↑d { val := p, property := (_ : p ∣ m) })
hx : ↑d { val := a, property := ha } = { val := b, property := (_ : b ≤ n) }
⊢ a = ⊥