Theorem: Surreal.dyadic_aux
File: Mathlib/SetTheory/Surreal/Dyadic.lean

tactic: revert m₁ m₂
state_before: m₁ m₂ : ℤ
y₁ y₂ : ℕ
h₂ : m₁ * 2 ^ y₁ = m₂ * 2 ^ y₂
⊢ ↑m₁ * powHalf y₂ = ↑m₂ * powHalf y₁
state_after: y₁ y₂ : ℕ
⊢ ∀ {m₁ m₂ : ℤ}, m₁ * 2 ^ y₁ = m₂ * 2 ^ y₂ → ↑m₁ * powHalf y₂ = ↑m₂ * powHalf y₁

tactic: wlog h : y₁ ≤ y₂
state_before: y₁ y₂ : ℕ
⊢ ∀ {m₁ m₂ : ℤ}, m₁ * 2 ^ y₁ = m₂ * 2 ^ y₂ → ↑m₁ * powHalf y₂ = ↑m₂ * powHalf y₁
state_after: case inr
y₁ y₂ : ℕ
this : ∀ {y₁ y₂ : ℕ}, y₁ ≤ y₂ → ∀ {m₁ m₂ : ℤ}, m₁ * 2 ^ y₁ = m₂ * 2 ^ y₂ → ↑m₁ * powHalf y₂ = ↑m₂ * powHalf y₁
h : ¬y₁ ≤ y₂
⊢ ∀ {m₁ m₂ : ℤ}, m₁ * 2 ^ y₁ = m₂ * 2 ^ y₂ → ↑m₁ * powHalf y₂ = ↑m₂ * powHalf y₁

y₁ y₂ : ℕ
h : y₁ ≤ y₂
⊢ ∀ {m₁ m₂ : ℤ}, m₁ * 2 ^ y₁ = m₂ * 2 ^ y₂ → ↑m₁ * powHalf y₂ = ↑m₂ * powHalf y₁

tactic: intro m₁ m₂ h₂
state_before: y₁ y₂ : ℕ
h : y₁ ≤ y₂
⊢ ∀ {m₁ m₂ : ℤ}, m₁ * 2 ^ y₁ = m₂ * 2 ^ y₂ → ↑m₁ * powHalf y₂ = ↑m₂ * powHalf y₁
state_after: y₁ y₂ : ℕ
h : y₁ ≤ y₂
m₁ m₂ : ℤ
h₂ : m₁ * 2 ^ y₁ = m₂ * 2 ^ y₂
⊢ ↑m₁ * powHalf y₂ = ↑m₂ * powHalf y₁

tactic: obtain ⟨c, rfl⟩ := le_iff_exists_add.mp h
state_before: y₁ y₂ : ℕ
h : y₁ ≤ y₂
m₁ m₂ : ℤ
h₂ : m₁ * 2 ^ y₁ = m₂ * 2 ^ y₂
⊢ ↑m₁ * powHalf y₂ = ↑m₂ * powHalf y₁
state_after: case intro
y₁ : ℕ
m₁ m₂ : ℤ
c : ℕ
h : y₁ ≤ y₁ + c
h₂ : m₁ * 2 ^ y₁ = m₂ * 2 ^ (y₁ + c)
⊢ ↑m₁ * powHalf (y₁ + c) = ↑m₂ * powHalf y₁

tactic: rw [add_comm, pow_add, ← mul_assoc, mul_eq_mul_right_iff] at h₂
state_before: case intro
y₁ : ℕ
m₁ m₂ : ℤ
c : ℕ
h : y₁ ≤ y₁ + c
h₂ : m₁ * 2 ^ y₁ = m₂ * 2 ^ (y₁ + c)
⊢ ↑m₁ * powHalf (y₁ + c) = ↑m₂ * powHalf y₁
state_after: case intro
y₁ : ℕ
m₁ m₂ : ℤ
c : ℕ
h : y₁ ≤ y₁ + c
h₂ : m₁ = m₂ * 2 ^ c ∨ 2 ^ y₁ = 0
⊢ ↑m₁ * powHalf (y₁ + c) = ↑m₂ * powHalf y₁

tactic: cases' h₂ with h₂ h₂
state_before: case intro
y₁ : ℕ
m₁ m₂ : ℤ
c : ℕ
h : y₁ ≤ y₁ + c
h₂ : m₁ = m₂ * 2 ^ c ∨ 2 ^ y₁ = 0
⊢ ↑m₁ * powHalf (y₁ + c) = ↑m₂ * powHalf y₁
state_after: case intro.inl
y₁ : ℕ
m₁ m₂ : ℤ
c : ℕ
h : y₁ ≤ y₁ + c
h₂ : m₁ = m₂ * 2 ^ c
⊢ ↑m₁ * powHalf (y₁ + c) = ↑m₂ * powHalf y₁

case intro.inr
y₁ : ℕ
m₁ m₂ : ℤ
c : ℕ
h : y₁ ≤ y₁ + c
h₂ : 2 ^ y₁ = 0
⊢ ↑m₁ * powHalf (y₁ + c) = ↑m₂ * powHalf y₁

tactic: intro m₁ m₂ aux
state_before: case inr
y₁ y₂ : ℕ
this : ∀ {y₁ y₂ : ℕ}, y₁ ≤ y₂ → ∀ {m₁ m₂ : ℤ}, m₁ * 2 ^ y₁ = m₂ * 2 ^ y₂ → ↑m₁ * powHalf y₂ = ↑m₂ * powHalf y₁
h : ¬y₁ ≤ y₂
⊢ ∀ {m₁ m₂ : ℤ}, m₁ * 2 ^ y₁ = m₂ * 2 ^ y₂ → ↑m₁ * powHalf y₂ = ↑m₂ * powHalf y₁
state_after: case inr
y₁ y₂ : ℕ
this : ∀ {y₁ y₂ : ℕ}, y₁ ≤ y₂ → ∀ {m₁ m₂ : ℤ}, m₁ * 2 ^ y₁ = m₂ * 2 ^ y₂ → ↑m₁ * powHalf y₂ = ↑m₂ * powHalf y₁
h : ¬y₁ ≤ y₂
m₁ m₂ : ℤ
aux : m₁ * 2 ^ y₁ = m₂ * 2 ^ y₂
⊢ ↑m₁ * powHalf y₂ = ↑m₂ * powHalf y₁

tactic: exact (this (le_of_not_le h) aux.symm).symm
state_before: case inr
y₁ y₂ : ℕ
this : ∀ {y₁ y₂ : ℕ}, y₁ ≤ y₂ → ∀ {m₁ m₂ : ℤ}, m₁ * 2 ^ y₁ = m₂ * 2 ^ y₂ → ↑m₁ * powHalf y₂ = ↑m₂ * powHalf y₁
h : ¬y₁ ≤ y₂
m₁ m₂ : ℤ
aux : m₁ * 2 ^ y₁ = m₂ * 2 ^ y₂
⊢ ↑m₁ * powHalf y₂ = ↑m₂ * powHalf y₁
state_after: no goals

tactic: rw [h₂, add_comm]
state_before: case intro.inl
y₁ : ℕ
m₁ m₂ : ℤ
c : ℕ
h : y₁ ≤ y₁ + c
h₂ : m₁ = m₂ * 2 ^ c
⊢ ↑m₁ * powHalf (y₁ + c) = ↑m₂ * powHalf y₁
state_after: case intro.inl
y₁ : ℕ
m₁ m₂ : ℤ
c : ℕ
h : y₁ ≤ y₁ + c
h₂ : m₁ = m₂ * 2 ^ c
⊢ ↑(m₂ * 2 ^ c) * powHalf (c + y₁) = ↑m₂ * powHalf y₁

tactic: simp_rw [Int.cast_mul, Int.cast_pow, Int.cast_ofNat, zsmul_pow_two_powHalf m₂ c y₁]
state_before: case intro.inl
y₁ : ℕ
m₁ m₂ : ℤ
c : ℕ
h : y₁ ≤ y₁ + c
h₂ : m₁ = m₂ * 2 ^ c
⊢ ↑(m₂ * 2 ^ c) * powHalf (c + y₁) = ↑m₂ * powHalf y₁
state_after: no goals

tactic: have := Nat.one_le_pow y₁ 2 Nat.succ_pos'
state_before: case intro.inr
y₁ : ℕ
m₁ m₂ : ℤ
c : ℕ
h : y₁ ≤ y₁ + c
h₂ : 2 ^ y₁ = 0
⊢ ↑m₁ * powHalf (y₁ + c) = ↑m₂ * powHalf y₁
state_after: case intro.inr
y₁ : ℕ
m₁ m₂ : ℤ
c : ℕ
h : y₁ ≤ y₁ + c
h₂ : 2 ^ y₁ = 0
this : 1 ≤ 2 ^ y₁
⊢ ↑m₁ * powHalf (y₁ + c) = ↑m₂ * powHalf y₁

tactic: norm_cast at h₂
state_before: case intro.inr
y₁ : ℕ
m₁ m₂ : ℤ
c : ℕ
h : y₁ ≤ y₁ + c
h₂ : 2 ^ y₁ = 0
this : 1 ≤ 2 ^ y₁
⊢ ↑m₁ * powHalf (y₁ + c) = ↑m₂ * powHalf y₁
state_after: case intro.inr
y₁ : ℕ
m₁ m₂ : ℤ
c : ℕ
h : y₁ ≤ y₁ + c
this : 1 ≤ 2 ^ y₁
h₂ : 2 ^ y₁ = 0
⊢ ↑m₁ * powHalf (y₁ + c) = ↑m₂ * powHalf y₁

tactic: omega
state_before: case intro.inr
y₁ : ℕ
m₁ m₂ : ℤ
c : ℕ
h : y₁ ≤ y₁ + c
this : 1 ≤ 2 ^ y₁
h₂ : 2 ^ y₁ = 0
⊢ ↑m₁ * powHalf (y₁ + c) = ↑m₂ * powHalf y₁
state_after: no goals