Theorem: Lean4Axiomatic.Rational.pow_flatten (Lean4Axiomatic/Rational/Exponentiation.lean)

State before:
ℕ ℤ : Type
inst✝¹¹ : Natural ℕ
inst✝¹⁰ : Integer ℤ
ℚ : Type
inst✝⁹ : Core ℚ
inst✝⁸ : Addition ℚ
inst✝⁷ : Multiplication ℚ
inst✝⁶ : Negation ℚ
inst✝⁵ : Reciprocation ℚ
inst✝⁴ : Division ℚ
inst✝³ : Sign ℚ
inst✝² : Natural.Exponentiation ℕ fun x x_1 => x * x_1
inst✝¹ : Exponentiation ℚ
p : ℚ
inst✝ : AP (p ≄ 0)
a b : ℤ
⊢ (p ^ a) ^ b ≃ p ^ (a * b)
Tactic:
have Exists.intro (n : ℕ) (Exists.intro (m : ℕ) (a_eqv : a ≃ n - m)) :=
  Integer.as_diff a
State after:
ℕ ℤ : Type
inst✝¹¹ : Natural ℕ
inst✝¹⁰ : Integer ℤ
ℚ : Type
inst✝⁹ : Core ℚ
inst✝⁸ : Addition ℚ
inst✝⁷ : Multiplication ℚ
inst✝⁶ : Negation ℚ
inst✝⁵ : Reciprocation ℚ
inst✝⁴ : Division ℚ
inst✝³ : Sign ℚ
inst✝² : Natural.Exponentiation ℕ fun x x_1 => x * x_1
inst✝¹ : Exponentiation ℚ
p : ℚ
inst✝ : AP (p ≄ 0)
a b : ℤ
n m : ℕ
a_eqv : a ≃ Coe.coe n - Coe.coe m
⊢ (p ^ a) ^ b ≃ p ^ (a * b)

State before:
ℕ ℤ : Type
inst✝¹¹ : Natural ℕ
inst✝¹⁰ : Integer ℤ
ℚ : Type
inst✝⁹ : Core ℚ
inst✝⁸ : Addition ℚ
inst✝⁷ : Multiplication ℚ
inst✝⁶ : Negation ℚ
inst✝⁵ : Reciprocation ℚ
inst✝⁴ : Division ℚ
inst✝³ : Sign ℚ
inst✝² : Natural.Exponentiation ℕ fun x x_1 => x * x_1
inst✝¹ : Exponentiation ℚ
p : ℚ
inst✝ : AP (p ≄ 0)
a b : ℤ
n m : ℕ
a_eqv : a ≃ Coe.coe n - Coe.coe m
⊢ (p ^ a) ^ b ≃ p ^ (a * b)
Tactic:
have Exists.intro (k : ℕ) (Exists.intro (j : ℕ) (b_eqv : b ≃ k - j)) :=
  Integer.as_diff b
State after:
ℕ ℤ : Type
inst✝¹¹ : Natural ℕ
inst✝¹⁰ : Integer ℤ
ℚ : Type
inst✝⁹ : Core ℚ
inst✝⁸ : Addition ℚ
inst✝⁷ : Multiplication ℚ
inst✝⁶ : Negation ℚ
inst✝⁵ : Reciprocation ℚ
inst✝⁴ : Division ℚ
inst✝³ : Sign ℚ
inst✝² : Natural.Exponentiation ℕ fun x x_1 => x * x_1
inst✝¹ : Exponentiation ℚ
p : ℚ
inst✝ : AP (p ≄ 0)
a b : ℤ
n m : ℕ
a_eqv : a ≃ Coe.coe n - Coe.coe m
k j : ℕ
b_eqv : b ≃ Coe.coe k - Coe.coe j
⊢ (p ^ a) ^ b ≃ p ^ (a * b)

State before:
ℕ ℤ : Type
inst✝¹¹ : Natural ℕ
inst✝¹⁰ : Integer ℤ
ℚ : Type
inst✝⁹ : Core ℚ
inst✝⁸ : Addition ℚ
inst✝⁷ : Multiplication ℚ
inst✝⁶ : Negation ℚ
inst✝⁵ : Reciprocation ℚ
inst✝⁴ : Division ℚ
inst✝³ : Sign ℚ
inst✝² : Natural.Exponentiation ℕ fun x x_1 => x * x_1
inst✝¹ : Exponentiation ℚ
p : ℚ
inst✝ : AP (p ≄ 0)
a b : ℤ
n m : ℕ
a_eqv : a ≃ Coe.coe n - Coe.coe m
k j : ℕ
b_eqv : b ≃ Coe.coe k - Coe.coe j
⊢ (p ^ a) ^ b ≃ p ^ (a * b)
Tactic:
have pow_expand : (p^a)^b ≃ ((p^n)^k/(p^m)^k) / ((p^n)^j/(p^m)^j) := calc
  _ = (p^a)^b                               := rfl
  _ ≃ (p^((n:ℤ)-m))^b                       := pow_substL (pow_substR a_eqv)
  _ ≃ (p^n/p^m)^b                           := pow_substL pow_diff
  _ ≃ (p^n/p^m)^((k:ℤ)-j)                   := pow_substR b_eqv
  _ ≃ (p^n/p^m)^k / (p^n/p^m)^j             := pow_diff
  _ ≃ ((p^n)^k/(p^m)^k) / (p^n/p^m)^j       := div_substL pow_distribR_div
  _ ≃ ((p^n)^k/(p^m)^k) / ((p^n)^j/(p^m)^j) := div_substR pow_distribR_div
State after:
ℕ ℤ : Type
inst✝¹¹ : Natural ℕ
inst✝¹⁰ : Integer ℤ
ℚ : Type
inst✝⁹ : Core ℚ
inst✝⁸ : Addition ℚ
inst✝⁷ : Multiplication ℚ
inst✝⁶ : Negation ℚ
inst✝⁵ : Reciprocation ℚ
inst✝⁴ : Division ℚ
inst✝³ : Sign ℚ
inst✝² : Natural.Exponentiation ℕ fun x x_1 => x * x_1
inst✝¹ : Exponentiation ℚ
p : ℚ
inst✝ : AP (p ≄ 0)
a b : ℤ
n m : ℕ
a_eqv : a ≃ Coe.coe n - Coe.coe m
k j : ℕ
b_eqv : b ≃ Coe.coe k - Coe.coe j
pow_expand : (p ^ a) ^ b ≃ (p ^ n) ^ k / (p ^ m) ^ k / ((p ^ n) ^ j / (p ^ m) ^ j)
⊢ (p ^ a) ^ b ≃ p ^ (a * b)

State before:
ℕ ℤ : Type
inst✝¹¹ : Natural ℕ
inst✝¹⁰ : Integer ℤ
ℚ : Type
inst✝⁹ : Core ℚ
inst✝⁸ : Addition ℚ
inst✝⁷ : Multiplication ℚ
inst✝⁶ : Negation ℚ
inst✝⁵ : Reciprocation ℚ
inst✝⁴ : Division ℚ
inst✝³ : Sign ℚ
inst✝² : Natural.Exponentiation ℕ fun x x_1 => x * x_1
inst✝¹ : Exponentiation ℚ
p : ℚ
inst✝ : AP (p ≄ 0)
a b : ℤ
n m : ℕ
a_eqv : a ≃ Coe.coe n - Coe.coe m
k j : ℕ
b_eqv : b ≃ Coe.coe k - Coe.coe j
pow_expand : (p ^ a) ^ b ≃ (p ^ n) ^ k / (p ^ m) ^ k / ((p ^ n) ^ j / (p ^ m) ^ j)
⊢ (p ^ a) ^ b ≃ p ^ (a * b)
Tactic:
have pow_combine {w x y z : ℕ} : (p^w)^x*(p^y)^z ≃ p^(w*x + y*z) := calc
  _ = (p^w)^x*(p^y)^z := rfl
  _ ≃ p^(w*x)*(p^y)^z := mul_substL Natural.pow_flatten
  _ ≃ p^(w*x)*p^(y*z) := mul_substR Natural.pow_flatten
  _ ≃ p^(w*x + y*z)   := Rel.symm Natural.pow_compatL_add
State after:
ℕ ℤ : Type
inst✝¹¹ : Natural ℕ
inst✝¹⁰ : Integer ℤ
ℚ : Type
inst✝⁹ : Core ℚ
inst✝⁸ : Addition ℚ
inst✝⁷ : Multiplication ℚ
inst✝⁶ : Negation ℚ
inst✝⁵ : Reciprocation ℚ
inst✝⁴ : Division ℚ
inst✝³ : Sign ℚ
inst✝² : Natural.Exponentiation ℕ fun x x_1 => x * x_1
inst✝¹ : Exponentiation ℚ
p : ℚ
inst✝ : AP (p ≄ 0)
a b : ℤ
n m : ℕ
a_eqv : a ≃ Coe.coe n - Coe.coe m
k j : ℕ
b_eqv : b ≃ Coe.coe k - Coe.coe j
pow_expand : (p ^ a) ^ b ≃ (p ^ n) ^ k / (p ^ m) ^ k / ((p ^ n) ^ j / (p ^ m) ^ j)
pow_combine : ∀ {w x y z : ℕ}, (p ^ w) ^ x * (p ^ y) ^ z ≃ p ^ (w * x + y * z)
⊢ (p ^ a) ^ b ≃ p ^ (a * b)

State before:
ℕ ℤ : Type
inst✝¹¹ : Natural ℕ
inst✝¹⁰ : Integer ℤ
ℚ : Type
inst✝⁹ : Core ℚ
inst✝⁸ : Addition ℚ
inst✝⁷ : Multiplication ℚ
inst✝⁶ : Negation ℚ
inst✝⁵ : Reciprocation ℚ
inst✝⁴ : Division ℚ
inst✝³ : Sign ℚ
inst✝² : Natural.Exponentiation ℕ fun x x_1 => x * x_1
inst✝¹ : Exponentiation ℚ
p : ℚ
inst✝ : AP (p ≄ 0)
a b : ℤ
n m : ℕ
a_eqv : a ≃ Coe.coe n - Coe.coe m
k j : ℕ
b_eqv : b ≃ Coe.coe k - Coe.coe j
pow_expand : (p ^ a) ^ b ≃ (p ^ n) ^ k / (p ^ m) ^ k / ((p ^ n) ^ j / (p ^ m) ^ j)
pow_combine : ∀ {w x y z : ℕ}, (p ^ w) ^ x * (p ^ y) ^ z ≃ p ^ (w * x + y * z)
⊢ (p ^ a) ^ b ≃ p ^ (a * b)
Tactic:
have multi_compat {w x y z : ℕ} : ((w*x + y*z : ℕ):ℤ) ≃ (w:ℤ)*x + y*z := calc
  _ = ((w*x + y*z : ℕ):ℤ)           := rfl
  _ ≃ ((w*x : ℕ):ℤ) + ((y*z : ℕ):ℤ) := AA.compat₂
  _ ≃ (w:ℤ)*x + ((y*z : ℕ):ℤ)       := AA.substL AA.compat₂
  _ ≃ (w:ℤ)*x + y*z                 := AA.substR AA.compat₂
State after:
ℕ ℤ : Type
inst✝¹¹ : Natural ℕ
inst✝¹⁰ : Integer ℤ
ℚ : Type
inst✝⁹ : Core ℚ
inst✝⁸ : Addition ℚ
inst✝⁷ : Multiplication ℚ
inst✝⁶ : Negation ℚ
inst✝⁵ : Reciprocation ℚ
inst✝⁴ : Division ℚ
inst✝³ : Sign ℚ
inst✝² : Natural.Exponentiation ℕ fun x x_1 => x * x_1
inst✝¹ : Exponentiation ℚ
p : ℚ
inst✝ : AP (p ≄ 0)
a b : ℤ
n m : ℕ
a_eqv : a ≃ Coe.coe n - Coe.coe m
k j : ℕ
b_eqv : b ≃ Coe.coe k - Coe.coe j
pow_expand : (p ^ a) ^ b ≃ (p ^ n) ^ k / (p ^ m) ^ k / ((p ^ n) ^ j / (p ^ m) ^ j)
pow_combine : ∀ {w x y z : ℕ}, (p ^ w) ^ x * (p ^ y) ^ z ≃ p ^ (w * x + y * z)
multi_compat : ∀ {w x y z : ℕ}, Coe.coe (w * x + y * z) ≃ Coe.coe w * Coe.coe x + Coe.coe y * Coe.coe z
⊢ (p ^ a) ^ b ≃ p ^ (a * b)

State before:
ℕ ℤ : Type
inst✝¹¹ : Natural ℕ
inst✝¹⁰ : Integer ℤ
ℚ : Type
inst✝⁹ : Core ℚ
inst✝⁸ : Addition ℚ
inst✝⁷ : Multiplication ℚ
inst✝⁶ : Negation ℚ
inst✝⁵ : Reciprocation ℚ
inst✝⁴ : Division ℚ
inst✝³ : Sign ℚ
inst✝² : Natural.Exponentiation ℕ fun x x_1 => x * x_1
inst✝¹ : Exponentiation ℚ
p : ℚ
inst✝ : AP (p ≄ 0)
a b : ℤ
n m : ℕ
a_eqv : a ≃ Coe.coe n - Coe.coe m
k j : ℕ
b_eqv : b ≃ Coe.coe k - Coe.coe j
pow_expand : (p ^ a) ^ b ≃ (p ^ n) ^ k / (p ^ m) ^ k / ((p ^ n) ^ j / (p ^ m) ^ j)
pow_combine : ∀ {w x y z : ℕ}, (p ^ w) ^ x * (p ^ y) ^ z ≃ p ^ (w * x + y * z)
multi_compat : ∀ {w x y z : ℕ}, Coe.coe (w * x + y * z) ≃ Coe.coe w * Coe.coe x + Coe.coe y * Coe.coe z
⊢ (p ^ a) ^ b ≃ p ^ (a * b)
Tactic:
have diff_expand
    {w x y z : ℤ} : (w-x) * (y-z) ≃ (w*y + x*z) - (x*y + w*z)
    := by
  let wy := w*y; let wz := w*z; let xy := x*y; let xz := x*z
  calc
    _ = (w-x) * (y-z)           := rfl
    _ ≃ w * (y-z) - x * (y-z)   := AA.distribR
    _ ≃ (wy - wz) - x * (y-z)   := AA.substL AA.distribL
    _ ≃ (wy - wz) - (xy - xz)   := AA.substR AA.distribL
    _ ≃ (wy - wz) + -(xy - xz)  := Integer.sub_defn
    _ ≃ (wy - wz) + (xz - xy)   := AA.substR Integer.sub_neg_flip
    _ ≃ (wy + -wz) + (xz - xy)  := AA.substL Integer.sub_defn
    _ ≃ (wy + -wz) + (xz + -xy) := AA.substR Integer.sub_defn
    _ ≃ (wy + xz) + (-wz + -xy) := AA.expr_xxfxxff_lr_swap_rl
    _ ≃ (wy + xz) + (-xy + -wz) := AA.substR AA.comm
    _ ≃ (wy + xz) + -(xy + wz)  := AA.substR (Rel.symm Integer.neg_compat_add)
    _ ≃ (wy + xz) - (xy + wz)   := Rel.symm Integer.sub_defn
State after:
ℕ ℤ : Type
inst✝¹¹ : Natural ℕ
inst✝¹⁰ : Integer ℤ
ℚ : Type
inst✝⁹ : Core ℚ
inst✝⁸ : Addition ℚ
inst✝⁷ : Multiplication ℚ
inst✝⁶ : Negation ℚ
inst✝⁵ : Reciprocation ℚ
inst✝⁴ : Division ℚ
inst✝³ : Sign ℚ
inst✝² : Natural.Exponentiation ℕ fun x x_1 => x * x_1
inst✝¹ : Exponentiation ℚ
p : ℚ
inst✝ : AP (p ≄ 0)
a b : ℤ
n m : ℕ
a_eqv : a ≃ Coe.coe n - Coe.coe m
k j : ℕ
b_eqv : b ≃ Coe.coe k - Coe.coe j
pow_expand : (p ^ a) ^ b ≃ (p ^ n) ^ k / (p ^ m) ^ k / ((p ^ n) ^ j / (p ^ m) ^ j)
pow_combine : ∀ {w x y z : ℕ}, (p ^ w) ^ x * (p ^ y) ^ z ≃ p ^ (w * x + y * z)
multi_compat : ∀ {w x y z : ℕ}, Coe.coe (w * x + y * z) ≃ Coe.coe w * Coe.coe x + Coe.coe y * Coe.coe z
diff_expand : ∀ {w x y z : ℤ}, (w - x) * (y - z) ≃ w * y + x * z - (x * y + w * z)
⊢ (p ^ a) ^ b ≃ p ^ (a * b)

State before:
ℕ ℤ : Type
inst✝¹¹ : Natural ℕ
inst✝¹⁰ : Integer ℤ
ℚ : Type
inst✝⁹ : Core ℚ
inst✝⁸ : Addition ℚ
inst✝⁷ : Multiplication ℚ
inst✝⁶ : Negation ℚ
inst✝⁵ : Reciprocation ℚ
inst✝⁴ : Division ℚ
inst✝³ : Sign ℚ
inst✝² : Natural.Exponentiation ℕ fun x x_1 => x * x_1
inst✝¹ : Exponentiation ℚ
p : ℚ
inst✝ : AP (p ≄ 0)
a b : ℤ
n m : ℕ
a_eqv : a ≃ Coe.coe n - Coe.coe m
k j : ℕ
b_eqv : b ≃ Coe.coe k - Coe.coe j
pow_expand : (p ^ a) ^ b ≃ (p ^ n) ^ k / (p ^ m) ^ k / ((p ^ n) ^ j / (p ^ m) ^ j)
pow_combine : ∀ {w x y z : ℕ}, (p ^ w) ^ x * (p ^ y) ^ z ≃ p ^ (w * x + y * z)
multi_compat : ∀ {w x y z : ℕ}, Coe.coe (w * x + y * z) ≃ Coe.coe w * Coe.coe x + Coe.coe y * Coe.coe z
diff_expand : ∀ {w x y z : ℤ}, (w - x) * (y - z) ≃ w * y + x * z - (x * y + w * z)
⊢ (p ^ a) ^ b ≃ p ^ (a * b)
Tactic:
have pow_reduce : ((n*k + m*j : ℕ):ℤ) - ((m*k + n*j : ℕ):ℤ) ≃ a * b := calc
  _ = ((n*k + m*j : ℕ):ℤ) - ((m*k + n*j : ℕ):ℤ) := rfl
  _ ≃ ((n:ℤ)*k + m*j) - ((m*k + n*j : ℕ):ℤ)     := AA.substL multi_compat
  _ ≃ ((n:ℤ)*k + m*j) - (m*k + n*j)             := AA.substR multi_compat
  _ ≃ ((n:ℤ) - m) * (k - j)                     := Rel.symm diff_expand
  _ ≃ a * (k - j)                               := AA.substL (Rel.symm a_eqv)
  _ ≃ a * b                                     := AA.substR (Rel.symm b_eqv)
State after:
ℕ ℤ : Type
inst✝¹¹ : Natural ℕ
inst✝¹⁰ : Integer ℤ
ℚ : Type
inst✝⁹ : Core ℚ
inst✝⁸ : Addition ℚ
inst✝⁷ : Multiplication ℚ
inst✝⁶ : Negation ℚ
inst✝⁵ : Reciprocation ℚ
inst✝⁴ : Division ℚ
inst✝³ : Sign ℚ
inst✝² : Natural.Exponentiation ℕ fun x x_1 => x * x_1
inst✝¹ : Exponentiation ℚ
p : ℚ
inst✝ : AP (p ≄ 0)
a b : ℤ
n m : ℕ
a_eqv : a ≃ Coe.coe n - Coe.coe m
k j : ℕ
b_eqv : b ≃ Coe.coe k - Coe.coe j
pow_expand : (p ^ a) ^ b ≃ (p ^ n) ^ k / (p ^ m) ^ k / ((p ^ n) ^ j / (p ^ m) ^ j)
pow_combine : ∀ {w x y z : ℕ}, (p ^ w) ^ x * (p ^ y) ^ z ≃ p ^ (w * x + y * z)
multi_compat : ∀ {w x y z : ℕ}, Coe.coe (w * x + y * z) ≃ Coe.coe w * Coe.coe x + Coe.coe y * Coe.coe z
diff_expand : ∀ {w x y z : ℤ}, (w - x) * (y - z) ≃ w * y + x * z - (x * y + w * z)
pow_reduce : Coe.coe (n * k + m * j) - Coe.coe (m * k + n * j) ≃ a * b
⊢ (p ^ a) ^ b ≃ p ^ (a * b)

State before:
ℕ ℤ : Type
inst✝¹¹ : Natural ℕ
inst✝¹⁰ : Integer ℤ
ℚ : Type
inst✝⁹ : Core ℚ
inst✝⁸ : Addition ℚ
inst✝⁷ : Multiplication ℚ
inst✝⁶ : Negation ℚ
inst✝⁵ : Reciprocation ℚ
inst✝⁴ : Division ℚ
inst✝³ : Sign ℚ
inst✝² : Natural.Exponentiation ℕ fun x x_1 => x * x_1
inst✝¹ : Exponentiation ℚ
p : ℚ
inst✝ : AP (p ≄ 0)
a b : ℤ
n m : ℕ
a_eqv : a ≃ Coe.coe n - Coe.coe m
k j : ℕ
b_eqv : b ≃ Coe.coe k - Coe.coe j
pow_expand : (p ^ a) ^ b ≃ (p ^ n) ^ k / (p ^ m) ^ k / ((p ^ n) ^ j / (p ^ m) ^ j)
pow_combine : ∀ {w x y z : ℕ}, (p ^ w) ^ x * (p ^ y) ^ z ≃ p ^ (w * x + y * z)
multi_compat : ∀ {w x y z : ℕ}, Coe.coe (w * x + y * z) ≃ Coe.coe w * Coe.coe x + Coe.coe y * Coe.coe z
diff_expand : ∀ {w x y z : ℤ}, (w - x) * (y - z) ≃ w * y + x * z - (x * y + w * z)
pow_reduce : Coe.coe (n * k + m * j) - Coe.coe (m * k + n * j) ≃ a * b
⊢ (p ^ a) ^ b ≃ p ^ (a * b)
Tactic:
calc
  _ = (p^a)^b                                       := rfl
  _ ≃ ((p^n)^k/(p^m)^k) / ((p^n)^j/(p^m)^j)         := pow_expand
  _ ≃ ((p^n)^k*(p^m)^j) / ((p^m)^k*(p^n)^j)         := div_div_div
  _ ≃ p^(n*k + m*j) / ((p^m)^k*(p^n)^j)             := div_substL pow_combine
  _ ≃ p^(n*k + m*j) / p^(m*k + n*j)                 := div_substR pow_combine
  _ ≃ p^(((n*k + m*j : ℕ):ℤ) - ((m*k + n*j : ℕ):ℤ)) := eqv_symm pow_diff
  _ ≃ p^(a * b)                                     := pow_substR pow_reduce
State after:
no goals

State before:
ℕ ℤ : Type
inst✝¹¹ : Natural ℕ
inst✝¹⁰ : Integer ℤ
ℚ : Type
inst✝⁹ : Core ℚ
inst✝⁸ : Addition ℚ
inst✝⁷ : Multiplication ℚ
inst✝⁶ : Negation ℚ
inst✝⁵ : Reciprocation ℚ
inst✝⁴ : Division ℚ
inst✝³ : Sign ℚ
inst✝² : Natural.Exponentiation ℕ fun x x_1 => x * x_1
inst✝¹ : Exponentiation ℚ
p : ℚ
inst✝ : AP (p ≄ 0)
a b : ℤ
n m : ℕ
a_eqv : a ≃ Coe.coe n - Coe.coe m
k j : ℕ
b_eqv : b ≃ Coe.coe k - Coe.coe j
pow_expand : (p ^ a) ^ b ≃ (p ^ n) ^ k / (p ^ m) ^ k / ((p ^ n) ^ j / (p ^ m) ^ j)
pow_combine : ∀ {w x y z : ℕ}, (p ^ w) ^ x * (p ^ y) ^ z ≃ p ^ (w * x + y * z)
multi_compat : ∀ {w x y z : ℕ}, Coe.coe (w * x + y * z) ≃ Coe.coe w * Coe.coe x + Coe.coe y * Coe.coe z
w x y z : ℤ
⊢ (w - x) * (y - z) ≃ w * y + x * z - (x * y + w * z)
Tactic:
let wy := w*y
State after:
ℕ ℤ : Type
inst✝¹¹ : Natural ℕ
inst✝¹⁰ : Integer ℤ
ℚ : Type
inst✝⁹ : Core ℚ
inst✝⁸ : Addition ℚ
inst✝⁷ : Multiplication ℚ
inst✝⁶ : Negation ℚ
inst✝⁵ : Reciprocation ℚ
inst✝⁴ : Division ℚ
inst✝³ : Sign ℚ
inst✝² : Natural.Exponentiation ℕ fun x x_1 => x * x_1
inst✝¹ : Exponentiation ℚ
p : ℚ
inst✝ : AP (p ≄ 0)
a b : ℤ
n m : ℕ
a_eqv : a ≃ Coe.coe n - Coe.coe m
k j : ℕ
b_eqv : b ≃ Coe.coe k - Coe.coe j
pow_expand : (p ^ a) ^ b ≃ (p ^ n) ^ k / (p ^ m) ^ k / ((p ^ n) ^ j / (p ^ m) ^ j)
pow_combine : ∀ {w x y z : ℕ}, (p ^ w) ^ x * (p ^ y) ^ z ≃ p ^ (w * x + y * z)
multi_compat : ∀ {w x y z : ℕ}, Coe.coe (w * x + y * z) ≃ Coe.coe w * Coe.coe x + Coe.coe y * Coe.coe z
w x y z : ℤ
wy : ℤ := w * y
⊢ (w - x) * (y - z) ≃ w * y + x * z - (x * y + w * z)

State before:
ℕ ℤ : Type
inst✝¹¹ : Natural ℕ
inst✝¹⁰ : Integer ℤ
ℚ : Type
inst✝⁹ : Core ℚ
inst✝⁸ : Addition ℚ
inst✝⁷ : Multiplication ℚ
inst✝⁶ : Negation ℚ
inst✝⁵ : Reciprocation ℚ
inst✝⁴ : Division ℚ
inst✝³ : Sign ℚ
inst✝² : Natural.Exponentiation ℕ fun x x_1 => x * x_1
inst✝¹ : Exponentiation ℚ
p : ℚ
inst✝ : AP (p ≄ 0)
a b : ℤ
n m : ℕ
a_eqv : a ≃ Coe.coe n - Coe.coe m
k j : ℕ
b_eqv : b ≃ Coe.coe k - Coe.coe j
pow_expand : (p ^ a) ^ b ≃ (p ^ n) ^ k / (p ^ m) ^ k / ((p ^ n) ^ j / (p ^ m) ^ j)
pow_combine : ∀ {w x y z : ℕ}, (p ^ w) ^ x * (p ^ y) ^ z ≃ p ^ (w * x + y * z)
multi_compat : ∀ {w x y z : ℕ}, Coe.coe (w * x + y * z) ≃ Coe.coe w * Coe.coe x + Coe.coe y * Coe.coe z
w x y z : ℤ
wy : ℤ := w * y
⊢ (w - x) * (y - z) ≃ w * y + x * z - (x * y + w * z)
Tactic:
let wz := w*z
State after:
ℕ ℤ : Type
inst✝¹¹ : Natural ℕ
inst✝¹⁰ : Integer ℤ
ℚ : Type
inst✝⁹ : Core ℚ
inst✝⁸ : Addition ℚ
inst✝⁷ : Multiplication ℚ
inst✝⁶ : Negation ℚ
inst✝⁵ : Reciprocation ℚ
inst✝⁴ : Division ℚ
inst✝³ : Sign ℚ
inst✝² : Natural.Exponentiation ℕ fun x x_1 => x * x_1
inst✝¹ : Exponentiation ℚ
p : ℚ
inst✝ : AP (p ≄ 0)
a b : ℤ
n m : ℕ
a_eqv : a ≃ Coe.coe n - Coe.coe m
k j : ℕ
b_eqv : b ≃ Coe.coe k - Coe.coe j
pow_expand : (p ^ a) ^ b ≃ (p ^ n) ^ k / (p ^ m) ^ k / ((p ^ n) ^ j / (p ^ m) ^ j)
pow_combine : ∀ {w x y z : ℕ}, (p ^ w) ^ x * (p ^ y) ^ z ≃ p ^ (w * x + y * z)
multi_compat : ∀ {w x y z : ℕ}, Coe.coe (w * x + y * z) ≃ Coe.coe w * Coe.coe x + Coe.coe y * Coe.coe z
w x y z : ℤ
wy : ℤ := w * y
wz : ℤ := w * z
⊢ (w - x) * (y - z) ≃ w * y + x * z - (x * y + w * z)

State before:
ℕ ℤ : Type
inst✝¹¹ : Natural ℕ
inst✝¹⁰ : Integer ℤ
ℚ : Type
inst✝⁹ : Core ℚ
inst✝⁸ : Addition ℚ
inst✝⁷ : Multiplication ℚ
inst✝⁶ : Negation ℚ
inst✝⁵ : Reciprocation ℚ
inst✝⁴ : Division ℚ
inst✝³ : Sign ℚ
inst✝² : Natural.Exponentiation ℕ fun x x_1 => x * x_1
inst✝¹ : Exponentiation ℚ
p : ℚ
inst✝ : AP (p ≄ 0)
a b : ℤ
n m : ℕ
a_eqv : a ≃ Coe.coe n - Coe.coe m
k j : ℕ
b_eqv : b ≃ Coe.coe k - Coe.coe j
pow_expand : (p ^ a) ^ b ≃ (p ^ n) ^ k / (p ^ m) ^ k / ((p ^ n) ^ j / (p ^ m) ^ j)
pow_combine : ∀ {w x y z : ℕ}, (p ^ w) ^ x * (p ^ y) ^ z ≃ p ^ (w * x + y * z)
multi_compat : ∀ {w x y z : ℕ}, Coe.coe (w * x + y * z) ≃ Coe.coe w * Coe.coe x + Coe.coe y * Coe.coe z
w x y z : ℤ
wy : ℤ := w * y
wz : ℤ := w * z
⊢ (w - x) * (y - z) ≃ w * y + x * z - (x * y + w * z)
Tactic:
let xy := x*y
State after:
ℕ ℤ : Type
inst✝¹¹ : Natural ℕ
inst✝¹⁰ : Integer ℤ
ℚ : Type
inst✝⁹ : Core ℚ
inst✝⁸ : Addition ℚ
inst✝⁷ : Multiplication ℚ
inst✝⁶ : Negation ℚ
inst✝⁵ : Reciprocation ℚ
inst✝⁴ : Division ℚ
inst✝³ : Sign ℚ
inst✝² : Natural.Exponentiation ℕ fun x x_1 => x * x_1
inst✝¹ : Exponentiation ℚ
p : ℚ
inst✝ : AP (p ≄ 0)
a b : ℤ
n m : ℕ
a_eqv : a ≃ Coe.coe n - Coe.coe m
k j : ℕ
b_eqv : b ≃ Coe.coe k - Coe.coe j
pow_expand : (p ^ a) ^ b ≃ (p ^ n) ^ k / (p ^ m) ^ k / ((p ^ n) ^ j / (p ^ m) ^ j)
pow_combine : ∀ {w x y z : ℕ}, (p ^ w) ^ x * (p ^ y) ^ z ≃ p ^ (w * x + y * z)
multi_compat : ∀ {w x y z : ℕ}, Coe.coe (w * x + y * z) ≃ Coe.coe w * Coe.coe x + Coe.coe y * Coe.coe z
w x y z : ℤ
wy : ℤ := w * y
wz : ℤ := w * z
xy : ℤ := x * y
⊢ (w - x) * (y - z) ≃ w * y + x * z - (x * y + w * z)

State before:
ℕ ℤ : Type
inst✝¹¹ : Natural ℕ
inst✝¹⁰ : Integer ℤ
ℚ : Type
inst✝⁹ : Core ℚ
inst✝⁸ : Addition ℚ
inst✝⁷ : Multiplication ℚ
inst✝⁶ : Negation ℚ
inst✝⁵ : Reciprocation ℚ
inst✝⁴ : Division ℚ
inst✝³ : Sign ℚ
inst✝² : Natural.Exponentiation ℕ fun x x_1 => x * x_1
inst✝¹ : Exponentiation ℚ
p : ℚ
inst✝ : AP (p ≄ 0)
a b : ℤ
n m : ℕ
a_eqv : a ≃ Coe.coe n - Coe.coe m
k j : ℕ
b_eqv : b ≃ Coe.coe k - Coe.coe j
pow_expand : (p ^ a) ^ b ≃ (p ^ n) ^ k / (p ^ m) ^ k / ((p ^ n) ^ j / (p ^ m) ^ j)
pow_combine : ∀ {w x y z : ℕ}, (p ^ w) ^ x * (p ^ y) ^ z ≃ p ^ (w * x + y * z)
multi_compat : ∀ {w x y z : ℕ}, Coe.coe (w * x + y * z) ≃ Coe.coe w * Coe.coe x + Coe.coe y * Coe.coe z
w x y z : ℤ
wy : ℤ := w * y
wz : ℤ := w * z
xy : ℤ := x * y
⊢ (w - x) * (y - z) ≃ w * y + x * z - (x * y + w * z)
Tactic:
let xz := x*z
State after:
ℕ ℤ : Type
inst✝¹¹ : Natural ℕ
inst✝¹⁰ : Integer ℤ
ℚ : Type
inst✝⁹ : Core ℚ
inst✝⁸ : Addition ℚ
inst✝⁷ : Multiplication ℚ
inst✝⁶ : Negation ℚ
inst✝⁵ : Reciprocation ℚ
inst✝⁴ : Division ℚ
inst✝³ : Sign ℚ
inst✝² : Natural.Exponentiation ℕ fun x x_1 => x * x_1
inst✝¹ : Exponentiation ℚ
p : ℚ
inst✝ : AP (p ≄ 0)
a b : ℤ
n m : ℕ
a_eqv : a ≃ Coe.coe n - Coe.coe m
k j : ℕ
b_eqv : b ≃ Coe.coe k - Coe.coe j
pow_expand : (p ^ a) ^ b ≃ (p ^ n) ^ k / (p ^ m) ^ k / ((p ^ n) ^ j / (p ^ m) ^ j)
pow_combine : ∀ {w x y z : ℕ}, (p ^ w) ^ x * (p ^ y) ^ z ≃ p ^ (w * x + y * z)
multi_compat : ∀ {w x y z : ℕ}, Coe.coe (w * x + y * z) ≃ Coe.coe w * Coe.coe x + Coe.coe y * Coe.coe z
w x y z : ℤ
wy : ℤ := w * y
wz : ℤ := w * z
xy : ℤ := x * y
xz : ℤ := x * z
⊢ (w - x) * (y - z) ≃ w * y + x * z - (x * y + w * z)

State before:
ℕ ℤ : Type
inst✝¹¹ : Natural ℕ
inst✝¹⁰ : Integer ℤ
ℚ : Type
inst✝⁹ : Core ℚ
inst✝⁸ : Addition ℚ
inst✝⁷ : Multiplication ℚ
inst✝⁶ : Negation ℚ
inst✝⁵ : Reciprocation ℚ
inst✝⁴ : Division ℚ
inst✝³ : Sign ℚ
inst✝² : Natural.Exponentiation ℕ fun x x_1 => x * x_1
inst✝¹ : Exponentiation ℚ
p : ℚ
inst✝ : AP (p ≄ 0)
a b : ℤ
n m : ℕ
a_eqv : a ≃ Coe.coe n - Coe.coe m
k j : ℕ
b_eqv : b ≃ Coe.coe k - Coe.coe j
pow_expand : (p ^ a) ^ b ≃ (p ^ n) ^ k / (p ^ m) ^ k / ((p ^ n) ^ j / (p ^ m) ^ j)
pow_combine : ∀ {w x y z : ℕ}, (p ^ w) ^ x * (p ^ y) ^ z ≃ p ^ (w * x + y * z)
multi_compat : ∀ {w x y z : ℕ}, Coe.coe (w * x + y * z) ≃ Coe.coe w * Coe.coe x + Coe.coe y * Coe.coe z
w x y z : ℤ
wy : ℤ := w * y
wz : ℤ := w * z
xy : ℤ := x * y
xz : ℤ := x * z
⊢ (w - x) * (y - z) ≃ w * y + x * z - (x * y + w * z)
Tactic:
calc
  _ = (w-x) * (y-z)           := rfl
  _ ≃ w * (y-z) - x * (y-z)   := AA.distribR
  _ ≃ (wy - wz) - x * (y-z)   := AA.substL AA.distribL
  _ ≃ (wy - wz) - (xy - xz)   := AA.substR AA.distribL
  _ ≃ (wy - wz) + -(xy - xz)  := Integer.sub_defn
  _ ≃ (wy - wz) + (xz - xy)   := AA.substR Integer.sub_neg_flip
  _ ≃ (wy + -wz) + (xz - xy)  := AA.substL Integer.sub_defn
  _ ≃ (wy + -wz) + (xz + -xy) := AA.substR Integer.sub_defn
  _ ≃ (wy + xz) + (-wz + -xy) := AA.expr_xxfxxff_lr_swap_rl
  _ ≃ (wy + xz) + (-xy + -wz) := AA.substR AA.comm
  _ ≃ (wy + xz) + -(xy + wz)  := AA.substR (Rel.symm Integer.neg_compat_add)
  _ ≃ (wy + xz) - (xy + wz)   := Rel.symm Integer.sub_defn
State after:
no goals