[GOAL]
p : ℕ
inst✝ : Fact (Prime p)
hp : p % 4 ≠ 3
⊢ ∃ a b, a ^ 2 + b ^ 2 = p
[PROOFSTEP]
apply sq_add_sq_of_nat_prime_of_not_irreducible p
[GOAL]
p : ℕ
inst✝ : Fact (Prime p)
hp : p % 4 ≠ 3
⊢ ¬Irreducible ↑p
[PROOFSTEP]
rwa [PrincipalIdealRing.irreducible_iff_prime, prime_iff_mod_four_eq_three_of_nat_prime p]
[GOAL]
R : Type u_1
inst✝ : CommRing R
a b x y u v : R
ha : a = x ^ 2 + y ^ 2
hb : b = u ^ 2 + v ^ 2
⊢ a * b = (x * u - y * v) ^ 2 + (x * v + y * u) ^ 2
[PROOFSTEP]
rw [ha, hb]
[GOAL]
R : Type u_1
inst✝ : CommRing R
a b x y u v : R
ha : a = x ^ 2 + y ^ 2
hb : b = u ^ 2 + v ^ 2
⊢ (x ^ 2 + y ^ 2) * (u ^ 2 + v ^ 2) = (x * u - y * v) ^ 2 + (x * v + y * u) ^ 2
[PROOFSTEP]
ring
[GOAL]
a b x y u v : ℕ
ha : a = x ^ 2 + y ^ 2
hb : b = u ^ 2 + v ^ 2
⊢ ∃ r s, a * b = r ^ 2 + s ^ 2
[PROOFSTEP]
zify at ha hb ⊢
[GOAL]
a b x y u v : ℕ
ha : ↑a = ↑x ^ 2 + ↑y ^ 2
hb : ↑b = ↑u ^ 2 + ↑v ^ 2
⊢ ∃ r s, ↑a * ↑b = ↑r ^ 2 + ↑s ^ 2
[PROOFSTEP]
obtain ⟨r, s, h⟩ := _root_.sq_add_sq_mul ha hb
[GOAL]
case intro.intro
a b x y u v : ℕ
ha : ↑a = ↑x ^ 2 + ↑y ^ 2
hb : ↑b = ↑u ^ 2 + ↑v ^ 2
r s : ℤ
h : ↑a * ↑b = r ^ 2 + s ^ 2
⊢ ∃ r s, ↑a * ↑b = ↑r ^ 2 + ↑s ^ 2
[PROOFSTEP]
refine' ⟨r.natAbs, s.natAbs, _⟩
[GOAL]
case intro.intro
a b x y u v : ℕ
ha : ↑a = ↑x ^ 2 + ↑y ^ 2
hb : ↑b = ↑u ^ 2 + ↑v ^ 2
r s : ℤ
h : ↑a * ↑b = r ^ 2 + s ^ 2
⊢ ↑a * ↑b = ↑(Int.natAbs r) ^ 2 + ↑(Int.natAbs s) ^ 2
[PROOFSTEP]
simpa only [Int.coe_natAbs, sq_abs]
[GOAL]
m n : ℕ
hd : m ∣ n
hs : IsSquare (-1)
⊢ IsSquare (-1)
[PROOFSTEP]
let f : ZMod n →+* ZMod m := ZMod.castHom hd _
[GOAL]
m n : ℕ
hd : m ∣ n
hs : IsSquare (-1)
f : ZMod n →+* ZMod m := castHom hd (ZMod m)
⊢ IsSquare (-1)
[PROOFSTEP]
rw [← RingHom.map_one f, ← RingHom.map_neg]
[GOAL]
m n : ℕ
hd : m ∣ n
hs : IsSquare (-1)
f : ZMod n →+* ZMod m := castHom hd (ZMod m)
⊢ IsSquare (↑f (-1))
[PROOFSTEP]
exact hs.map f
[GOAL]
m n : ℕ
hc : Nat.coprime m n
hm : IsSquare (-1)
hn : IsSquare (-1)
⊢ IsSquare (-1)
[PROOFSTEP]
have : IsSquare (-1 : ZMod m × ZMod n) :=
  by
  rw [show (-1 : ZMod m × ZMod n) = ((-1 : ZMod m), (-1 : ZMod n)) from rfl]
  obtain ⟨x, hx⟩ := hm
  obtain ⟨y, hy⟩ := hn
  rw [hx, hy]
  exact ⟨(x, y), rfl⟩
[GOAL]
m n : ℕ
hc : Nat.coprime m n
hm : IsSquare (-1)
hn : IsSquare (-1)
⊢ IsSquare (-1)
[PROOFSTEP]
rw [show (-1 : ZMod m × ZMod n) = ((-1 : ZMod m), (-1 : ZMod n)) from rfl]
[GOAL]
m n : ℕ
hc : Nat.coprime m n
hm : IsSquare (-1)
hn : IsSquare (-1)
⊢ IsSquare (-1, -1)
[PROOFSTEP]
obtain ⟨x, hx⟩ := hm
[GOAL]
case intro
m n : ℕ
hc : Nat.coprime m n
hn : IsSquare (-1)
x : ZMod m
hx : -1 = x * x
⊢ IsSquare (-1, -1)
[PROOFSTEP]
obtain ⟨y, hy⟩ := hn
[GOAL]
case intro.intro
m n : ℕ
hc : Nat.coprime m n
x : ZMod m
hx : -1 = x * x
y : ZMod n
hy : -1 = y * y
⊢ IsSquare (-1, -1)
[PROOFSTEP]
rw [hx, hy]
[GOAL]
case intro.intro
m n : ℕ
hc : Nat.coprime m n
x : ZMod m
hx : -1 = x * x
y : ZMod n
hy : -1 = y * y
⊢ IsSquare (x * x, y * y)
[PROOFSTEP]
exact ⟨(x, y), rfl⟩
[GOAL]
m n : ℕ
hc : Nat.coprime m n
hm : IsSquare (-1)
hn : IsSquare (-1)
this : IsSquare (-1)
⊢ IsSquare (-1)
[PROOFSTEP]
simpa only [RingEquiv.map_neg_one] using this.map (ZMod.chineseRemainder hc).symm
[GOAL]
p n : ℕ
hpp : Prime p
hp : p ∣ n
hs : IsSquare (-1)
⊢ p % 4 ≠ 3
[PROOFSTEP]
obtain ⟨y, h⟩ := ZMod.isSquare_neg_one_of_dvd hp hs
[GOAL]
case intro
p n : ℕ
hpp : Prime p
hp : p ∣ n
hs : IsSquare (-1)
y : ZMod p
h : -1 = y * y
⊢ p % 4 ≠ 3
[PROOFSTEP]
rw [← sq, eq_comm, show (-1 : ZMod p) = -1 ^ 2 by ring] at h
[GOAL]
p n : ℕ
hpp : Prime p
hp : p ∣ n
hs : IsSquare (-1)
y : ZMod p
h : y ^ 2 = -1
⊢ -1 = -1 ^ 2
[PROOFSTEP]
ring
[GOAL]
case intro
p n : ℕ
hpp : Prime p
hp : p ∣ n
hs : IsSquare (-1)
y : ZMod p
h : y ^ 2 = -1 ^ 2
⊢ p % 4 ≠ 3
[PROOFSTEP]
haveI : Fact p.Prime := ⟨hpp⟩
[GOAL]
case intro
p n : ℕ
hpp : Prime p
hp : p ∣ n
hs : IsSquare (-1)
y : ZMod p
h : y ^ 2 = -1 ^ 2
this : Fact (Prime p)
⊢ p % 4 ≠ 3
[PROOFSTEP]
exact ZMod.mod_four_ne_three_of_sq_eq_neg_sq' one_ne_zero h
[GOAL]
n : ℕ
hn : Squarefree n
⊢ IsSquare (-1) ↔ ∀ {q : ℕ}, Nat.Prime q → q ∣ n → q % 4 ≠ 3
[PROOFSTEP]
refine' ⟨fun H q hqp hqd => hqp.mod_four_ne_three_of_dvd_isSquare_neg_one hqd H, fun H => _⟩
[GOAL]
n : ℕ
hn : Squarefree n
H : ∀ {q : ℕ}, Nat.Prime q → q ∣ n → q % 4 ≠ 3
⊢ IsSquare (-1)
[PROOFSTEP]
induction' n using induction_on_primes with p n hpp ih
[GOAL]
case h₀
n : ℕ
hn✝ : Squarefree n
H✝ : ∀ {q : ℕ}, Nat.Prime q → q ∣ n → q % 4 ≠ 3
hn : Squarefree 0
H : ∀ {q : ℕ}, Nat.Prime q → q ∣ 0 → q % 4 ≠ 3
⊢ IsSquare (-1)
[PROOFSTEP]
exact False.elim (hn.ne_zero rfl)
[GOAL]
case h₁
n : ℕ
hn✝ : Squarefree n
H✝ : ∀ {q : ℕ}, Nat.Prime q → q ∣ n → q % 4 ≠ 3
hn : Squarefree 1
H : ∀ {q : ℕ}, Nat.Prime q → q ∣ 1 → q % 4 ≠ 3
⊢ IsSquare (-1)
[PROOFSTEP]
exact ⟨0, by simp only [Fin.zero_mul, neg_eq_zero, Fin.one_eq_zero_iff]⟩
[GOAL]
n : ℕ
hn✝ : Squarefree n
H✝ : ∀ {q : ℕ}, Nat.Prime q → q ∣ n → q % 4 ≠ 3
hn : Squarefree 1
H : ∀ {q : ℕ}, Nat.Prime q → q ∣ 1 → q % 4 ≠ 3
⊢ -1 = 0 * 0
[PROOFSTEP]
simp only [Fin.zero_mul, neg_eq_zero, Fin.one_eq_zero_iff]
[GOAL]
case h
n✝ : ℕ
hn✝ : Squarefree n✝
H✝ : ∀ {q : ℕ}, Nat.Prime q → q ∣ n✝ → q % 4 ≠ 3
p n : ℕ
hpp : Nat.Prime p
ih : Squarefree n → (∀ {q : ℕ}, Nat.Prime q → q ∣ n → q % 4 ≠ 3) → IsSquare (-1)
hn : Squarefree (p * n)
H : ∀ {q : ℕ}, Nat.Prime q → q ∣ p * n → q % 4 ≠ 3
⊢ IsSquare (-1)
[PROOFSTEP]
haveI : Fact p.Prime := ⟨hpp⟩
[GOAL]
case h
n✝ : ℕ
hn✝ : Squarefree n✝
H✝ : ∀ {q : ℕ}, Nat.Prime q → q ∣ n✝ → q % 4 ≠ 3
p n : ℕ
hpp : Nat.Prime p
ih : Squarefree n → (∀ {q : ℕ}, Nat.Prime q → q ∣ n → q % 4 ≠ 3) → IsSquare (-1)
hn : Squarefree (p * n)
H : ∀ {q : ℕ}, Nat.Prime q → q ∣ p * n → q % 4 ≠ 3
this : Fact (Nat.Prime p)
⊢ IsSquare (-1)
[PROOFSTEP]
have hcp : p.coprime n := by
  by_contra hc
  exact hpp.not_unit (hn p <| mul_dvd_mul_left p <| hpp.dvd_iff_not_coprime.mpr hc)
[GOAL]
n✝ : ℕ
hn✝ : Squarefree n✝
H✝ : ∀ {q : ℕ}, Nat.Prime q → q ∣ n✝ → q % 4 ≠ 3
p n : ℕ
hpp : Nat.Prime p
ih : Squarefree n → (∀ {q : ℕ}, Nat.Prime q → q ∣ n → q % 4 ≠ 3) → IsSquare (-1)
hn : Squarefree (p * n)
H : ∀ {q : ℕ}, Nat.Prime q → q ∣ p * n → q % 4 ≠ 3
this : Fact (Nat.Prime p)
⊢ Nat.coprime p n
[PROOFSTEP]
by_contra hc
[GOAL]
n✝ : ℕ
hn✝ : Squarefree n✝
H✝ : ∀ {q : ℕ}, Nat.Prime q → q ∣ n✝ → q % 4 ≠ 3
p n : ℕ
hpp : Nat.Prime p
ih : Squarefree n → (∀ {q : ℕ}, Nat.Prime q → q ∣ n → q % 4 ≠ 3) → IsSquare (-1)
hn : Squarefree (p * n)
H : ∀ {q : ℕ}, Nat.Prime q → q ∣ p * n → q % 4 ≠ 3
this : Fact (Nat.Prime p)
hc : ¬Nat.coprime p n
⊢ False
[PROOFSTEP]
exact hpp.not_unit (hn p <| mul_dvd_mul_left p <| hpp.dvd_iff_not_coprime.mpr hc)
[GOAL]
case h
n✝ : ℕ
hn✝ : Squarefree n✝
H✝ : ∀ {q : ℕ}, Nat.Prime q → q ∣ n✝ → q % 4 ≠ 3
p n : ℕ
hpp : Nat.Prime p
ih : Squarefree n → (∀ {q : ℕ}, Nat.Prime q → q ∣ n → q % 4 ≠ 3) → IsSquare (-1)
hn : Squarefree (p * n)
H : ∀ {q : ℕ}, Nat.Prime q → q ∣ p * n → q % 4 ≠ 3
this : Fact (Nat.Prime p)
hcp : Nat.coprime p n
⊢ IsSquare (-1)
[PROOFSTEP]
have hp₁ := ZMod.exists_sq_eq_neg_one_iff.mpr (H hpp (dvd_mul_right p n))
[GOAL]
case h
n✝ : ℕ
hn✝ : Squarefree n✝
H✝ : ∀ {q : ℕ}, Nat.Prime q → q ∣ n✝ → q % 4 ≠ 3
p n : ℕ
hpp : Nat.Prime p
ih : Squarefree n → (∀ {q : ℕ}, Nat.Prime q → q ∣ n → q % 4 ≠ 3) → IsSquare (-1)
hn : Squarefree (p * n)
H : ∀ {q : ℕ}, Nat.Prime q → q ∣ p * n → q % 4 ≠ 3
this : Fact (Nat.Prime p)
hcp : Nat.coprime p n
hp₁ : IsSquare (-1)
⊢ IsSquare (-1)
[PROOFSTEP]
exact ZMod.isSquare_neg_one_mul hcp hp₁ (ih hn.of_mul_right fun hqp hqd => H hqp <| dvd_mul_of_dvd_right hqd _)
[GOAL]
n : ℕ
hn : Squarefree n
⊢ IsSquare (-1) ↔ ∀ {q : ℕ}, q ∣ n → q % 4 ≠ 3
[PROOFSTEP]
have help : ∀ a b : ZMod 4, a ≠ 3 → b ≠ 3 → a * b ≠ 3 := by decide
[GOAL]
n : ℕ
hn : Squarefree n
⊢ ∀ (a b : ZMod 4), a ≠ 3 → b ≠ 3 → a * b ≠ 3
[PROOFSTEP]
decide
[GOAL]
n : ℕ
hn : Squarefree n
help : ∀ (a b : ZMod 4), a ≠ 3 → b ≠ 3 → a * b ≠ 3
⊢ IsSquare (-1) ↔ ∀ {q : ℕ}, q ∣ n → q % 4 ≠ 3
[PROOFSTEP]
rw [ZMod.isSquare_neg_one_iff hn]
[GOAL]
n : ℕ
hn : Squarefree n
help : ∀ (a b : ZMod 4), a ≠ 3 → b ≠ 3 → a * b ≠ 3
⊢ (∀ {q : ℕ}, Nat.Prime q → q ∣ n → q % 4 ≠ 3) ↔ ∀ {q : ℕ}, q ∣ n → q % 4 ≠ 3
[PROOFSTEP]
refine' ⟨_, fun H q _ => H⟩
[GOAL]
n : ℕ
hn : Squarefree n
help : ∀ (a b : ZMod 4), a ≠ 3 → b ≠ 3 → a * b ≠ 3
⊢ (∀ {q : ℕ}, Nat.Prime q → q ∣ n → q % 4 ≠ 3) → ∀ {q : ℕ}, q ∣ n → q % 4 ≠ 3
[PROOFSTEP]
intro H
[GOAL]
n : ℕ
hn : Squarefree n
help : ∀ (a b : ZMod 4), a ≠ 3 → b ≠ 3 → a * b ≠ 3
H : ∀ {q : ℕ}, Nat.Prime q → q ∣ n → q % 4 ≠ 3
⊢ ∀ {q : ℕ}, q ∣ n → q % 4 ≠ 3
[PROOFSTEP]
refine' @induction_on_primes _ _ _ (fun p q hp hq hpq => _)
[GOAL]
case refine'_1
n : ℕ
hn : Squarefree n
help : ∀ (a b : ZMod 4), a ≠ 3 → b ≠ 3 → a * b ≠ 3
H : ∀ {q : ℕ}, Nat.Prime q → q ∣ n → q % 4 ≠ 3
⊢ 0 ∣ n → 0 % 4 ≠ 3
[PROOFSTEP]
exact fun _ => by norm_num
[GOAL]
n : ℕ
hn : Squarefree n
help : ∀ (a b : ZMod 4), a ≠ 3 → b ≠ 3 → a * b ≠ 3
H : ∀ {q : ℕ}, Nat.Prime q → q ∣ n → q % 4 ≠ 3
x✝ : 0 ∣ n
⊢ 0 % 4 ≠ 3
[PROOFSTEP]
norm_num
[GOAL]
case refine'_2
n : ℕ
hn : Squarefree n
help : ∀ (a b : ZMod 4), a ≠ 3 → b ≠ 3 → a * b ≠ 3
H : ∀ {q : ℕ}, Nat.Prime q → q ∣ n → q % 4 ≠ 3
⊢ 1 ∣ n → 1 % 4 ≠ 3
[PROOFSTEP]
exact fun _ => by norm_num
[GOAL]
n : ℕ
hn : Squarefree n
help : ∀ (a b : ZMod 4), a ≠ 3 → b ≠ 3 → a * b ≠ 3
H : ∀ {q : ℕ}, Nat.Prime q → q ∣ n → q % 4 ≠ 3
x✝ : 1 ∣ n
⊢ 1 % 4 ≠ 3
[PROOFSTEP]
norm_num
[GOAL]
case refine'_3
n : ℕ
hn : Squarefree n
help : ∀ (a b : ZMod 4), a ≠ 3 → b ≠ 3 → a * b ≠ 3
H : ∀ {q : ℕ}, Nat.Prime q → q ∣ n → q % 4 ≠ 3
p q : ℕ
hp : Nat.Prime p
hq : q ∣ n → q % 4 ≠ 3
hpq : p * q ∣ n
⊢ p * q % 4 ≠ 3
[PROOFSTEP]
replace hp := H hp (dvd_of_mul_right_dvd hpq)
[GOAL]
case refine'_3
n : ℕ
hn : Squarefree n
help : ∀ (a b : ZMod 4), a ≠ 3 → b ≠ 3 → a * b ≠ 3
H : ∀ {q : ℕ}, Nat.Prime q → q ∣ n → q % 4 ≠ 3
p q : ℕ
hq : q ∣ n → q % 4 ≠ 3
hpq : p * q ∣ n
hp : p % 4 ≠ 3
⊢ p * q % 4 ≠ 3
[PROOFSTEP]
replace hq := hq (dvd_of_mul_left_dvd hpq)
[GOAL]
case refine'_3
n : ℕ
hn : Squarefree n
help : ∀ (a b : ZMod 4), a ≠ 3 → b ≠ 3 → a * b ≠ 3
H : ∀ {q : ℕ}, Nat.Prime q → q ∣ n → q % 4 ≠ 3
p q : ℕ
hpq : p * q ∣ n
hp : p % 4 ≠ 3
hq : q % 4 ≠ 3
⊢ p * q % 4 ≠ 3
[PROOFSTEP]
rw [show 3 = 3 % 4 by norm_num, Ne.def, ← ZMod.nat_cast_eq_nat_cast_iff'] at hp hq ⊢
[GOAL]
n : ℕ
hn : Squarefree n
help : ∀ (a b : ZMod 4), a ≠ 3 → b ≠ 3 → a * b ≠ 3
H : ∀ {q : ℕ}, Nat.Prime q → q ∣ n → q % 4 ≠ 3
p q : ℕ
hpq : p * q ∣ n
hp : p % 4 ≠ 3
hq : q % 4 ≠ 3
⊢ 3 = 3 % 4
[PROOFSTEP]
norm_num
[GOAL]
n : ℕ
hn : Squarefree n
help : ∀ (a b : ZMod 4), a ≠ 3 → b ≠ 3 → a * b ≠ 3
H : ∀ {q : ℕ}, Nat.Prime q → q ∣ n → q % 4 ≠ 3
p q : ℕ
hpq : p * q ∣ n
hp : p % 4 ≠ 3 % 4
hq : q % 4 ≠ 3
⊢ 3 = 3 % 4
[PROOFSTEP]
norm_num
[GOAL]
n : ℕ
hn : Squarefree n
help : ∀ (a b : ZMod 4), a ≠ 3 → b ≠ 3 → a * b ≠ 3
H : ∀ {q : ℕ}, Nat.Prime q → q ∣ n → q % 4 ≠ 3
p q : ℕ
hpq : p * q ∣ n
hp : p % 4 ≠ 3 % 4
hq : q % 4 ≠ 3 % 4
⊢ 3 = 3 % 4
[PROOFSTEP]
norm_num
[GOAL]
case refine'_3
n : ℕ
hn : Squarefree n
help : ∀ (a b : ZMod 4), a ≠ 3 → b ≠ 3 → a * b ≠ 3
H : ∀ {q : ℕ}, Nat.Prime q → q ∣ n → q % 4 ≠ 3
p q : ℕ
hpq : p * q ∣ n
hp : ¬↑p = ↑3
hq : ¬↑q = ↑3
⊢ ¬↑(p * q) = ↑3
[PROOFSTEP]
rw [Nat.cast_mul]
[GOAL]
case refine'_3
n : ℕ
hn : Squarefree n
help : ∀ (a b : ZMod 4), a ≠ 3 → b ≠ 3 → a * b ≠ 3
H : ∀ {q : ℕ}, Nat.Prime q → q ∣ n → q % 4 ≠ 3
p q : ℕ
hpq : p * q ∣ n
hp : ¬↑p = ↑3
hq : ¬↑q = ↑3
⊢ ¬↑p * ↑q = ↑3
[PROOFSTEP]
exact help p q hp hq
[GOAL]
n : ℕ
h : IsSquare (-1)
⊢ ∃ x y, n = x ^ 2 + y ^ 2
[PROOFSTEP]
induction' n using induction_on_primes with p n hpp ih
[GOAL]
case h₀
n : ℕ
h✝ : IsSquare (-1)
h : IsSquare (-1)
⊢ ∃ x y, 0 = x ^ 2 + y ^ 2
[PROOFSTEP]
exact ⟨0, 0, rfl⟩
[GOAL]
case h₁
n : ℕ
h✝ : IsSquare (-1)
h : IsSquare (-1)
⊢ ∃ x y, 1 = x ^ 2 + y ^ 2
[PROOFSTEP]
exact ⟨0, 1, rfl⟩
[GOAL]
case h
n✝ : ℕ
h✝ : IsSquare (-1)
p n : ℕ
hpp : Prime p
ih : IsSquare (-1) → ∃ x y, n = x ^ 2 + y ^ 2
h : IsSquare (-1)
⊢ ∃ x y, p * n = x ^ 2 + y ^ 2
[PROOFSTEP]
haveI : Fact p.Prime := ⟨hpp⟩
[GOAL]
case h
n✝ : ℕ
h✝ : IsSquare (-1)
p n : ℕ
hpp : Prime p
ih : IsSquare (-1) → ∃ x y, n = x ^ 2 + y ^ 2
h : IsSquare (-1)
this : Fact (Prime p)
⊢ ∃ x y, p * n = x ^ 2 + y ^ 2
[PROOFSTEP]
have hp : IsSquare (-1 : ZMod p) := ZMod.isSquare_neg_one_of_dvd ⟨n, rfl⟩ h
[GOAL]
case h
n✝ : ℕ
h✝ : IsSquare (-1)
p n : ℕ
hpp : Prime p
ih : IsSquare (-1) → ∃ x y, n = x ^ 2 + y ^ 2
h : IsSquare (-1)
this : Fact (Prime p)
hp : IsSquare (-1)
⊢ ∃ x y, p * n = x ^ 2 + y ^ 2
[PROOFSTEP]
obtain ⟨u, v, huv⟩ := Nat.Prime.sq_add_sq (ZMod.exists_sq_eq_neg_one_iff.mp hp)
[GOAL]
case h.intro.intro
n✝ : ℕ
h✝ : IsSquare (-1)
p n : ℕ
hpp : Prime p
ih : IsSquare (-1) → ∃ x y, n = x ^ 2 + y ^ 2
h : IsSquare (-1)
this : Fact (Prime p)
hp : IsSquare (-1)
u v : ℕ
huv : u ^ 2 + v ^ 2 = p
⊢ ∃ x y, p * n = x ^ 2 + y ^ 2
[PROOFSTEP]
obtain ⟨x, y, hxy⟩ := ih (ZMod.isSquare_neg_one_of_dvd ⟨p, mul_comm _ _⟩ h)
[GOAL]
case h.intro.intro.intro.intro
n✝ : ℕ
h✝ : IsSquare (-1)
p n : ℕ
hpp : Prime p
ih : IsSquare (-1) → ∃ x y, n = x ^ 2 + y ^ 2
h : IsSquare (-1)
this : Fact (Prime p)
hp : IsSquare (-1)
u v : ℕ
huv : u ^ 2 + v ^ 2 = p
x y : ℕ
hxy : n = x ^ 2 + y ^ 2
⊢ ∃ x y, p * n = x ^ 2 + y ^ 2
[PROOFSTEP]
exact Nat.sq_add_sq_mul huv.symm hxy
[GOAL]
n x y : ℤ
h : n = x ^ 2 + y ^ 2
hc : IsCoprime x y
⊢ IsSquare (-1)
[PROOFSTEP]
obtain ⟨u, v, huv⟩ : IsCoprime x n :=
  by
  have hc2 : IsCoprime (x ^ 2) (y ^ 2) := hc.pow
  rw [show y ^ 2 = n + -1 * x ^ 2 by rw [h]; ring] at hc2
  exact (IsCoprime.pow_left_iff zero_lt_two).mp hc2.of_add_mul_right_right
[GOAL]
n x y : ℤ
h : n = x ^ 2 + y ^ 2
hc : IsCoprime x y
⊢ IsCoprime x n
[PROOFSTEP]
have hc2 : IsCoprime (x ^ 2) (y ^ 2) := hc.pow
[GOAL]
n x y : ℤ
h : n = x ^ 2 + y ^ 2
hc : IsCoprime x y
hc2 : IsCoprime (x ^ 2) (y ^ 2)
⊢ IsCoprime x n
[PROOFSTEP]
rw [show y ^ 2 = n + -1 * x ^ 2 by rw [h]; ring] at hc2
[GOAL]
n x y : ℤ
h : n = x ^ 2 + y ^ 2
hc : IsCoprime x y
hc2 : IsCoprime (x ^ 2) (y ^ 2)
⊢ y ^ 2 = n + -1 * x ^ 2
[PROOFSTEP]
rw [h]
[GOAL]
n x y : ℤ
h : n = x ^ 2 + y ^ 2
hc : IsCoprime x y
hc2 : IsCoprime (x ^ 2) (y ^ 2)
⊢ y ^ 2 = x ^ 2 + y ^ 2 + -1 * x ^ 2
[PROOFSTEP]
ring
[GOAL]
n x y : ℤ
h : n = x ^ 2 + y ^ 2
hc : IsCoprime x y
hc2 : IsCoprime (x ^ 2) (n + -1 * x ^ 2)
⊢ IsCoprime x n
[PROOFSTEP]
exact (IsCoprime.pow_left_iff zero_lt_two).mp hc2.of_add_mul_right_right
[GOAL]
case intro.intro
n x y : ℤ
h : n = x ^ 2 + y ^ 2
hc : IsCoprime x y
u v : ℤ
huv : u * x + v * n = 1
⊢ IsSquare (-1)
[PROOFSTEP]
have H : u * y * (u * y) - -1 = n * (-v ^ 2 * n + u ^ 2 + 2 * v) := by
  linear_combination -u ^ 2 * h + (n * v - u * x - 1) * huv
[GOAL]
n x y : ℤ
h : n = x ^ 2 + y ^ 2
hc : IsCoprime x y
u v : ℤ
huv : u * x + v * n = 1
⊢ u * y * (u * y) - -1 = n * (-v ^ 2 * n + u ^ 2 + 2 * v)
[PROOFSTEP]
linear_combination -u ^ 2 * h + (n * v - u * x - 1) * huv
[GOAL]
case intro.intro
n x y : ℤ
h : n = x ^ 2 + y ^ 2
hc : IsCoprime x y
u v : ℤ
huv : u * x + v * n = 1
H : u * y * (u * y) - -1 = n * (-v ^ 2 * n + u ^ 2 + 2 * v)
⊢ IsSquare (-1)
[PROOFSTEP]
refine' ⟨u * y, _⟩
[GOAL]
case intro.intro
n x y : ℤ
h : n = x ^ 2 + y ^ 2
hc : IsCoprime x y
u v : ℤ
huv : u * x + v * n = 1
H : u * y * (u * y) - -1 = n * (-v ^ 2 * n + u ^ 2 + 2 * v)
⊢ -1 = ↑u * ↑y * (↑u * ↑y)
[PROOFSTEP]
conv_rhs => tactic => norm_cast
[GOAL]
n x y : ℤ
h : n = x ^ 2 + y ^ 2
hc : IsCoprime x y
u v : ℤ
huv : u * x + v * n = 1
H : u * y * (u * y) - -1 = n * (-v ^ 2 * n + u ^ 2 + 2 * v)
| ↑u * ↑y * (↑u * ↑y)
[PROOFSTEP]
tactic => norm_cast
[GOAL]
n x y : ℤ
h : n = x ^ 2 + y ^ 2
hc : IsCoprime x y
u v : ℤ
huv : u * x + v * n = 1
H : u * y * (u * y) - -1 = n * (-v ^ 2 * n + u ^ 2 + 2 * v)
| ↑u * ↑y * (↑u * ↑y)
[PROOFSTEP]
tactic => norm_cast
[GOAL]
n x y : ℤ
h : n = x ^ 2 + y ^ 2
hc : IsCoprime x y
u v : ℤ
huv : u * x + v * n = 1
H : u * y * (u * y) - -1 = n * (-v ^ 2 * n + u ^ 2 + 2 * v)
| ↑u * ↑y * (↑u * ↑y)
[PROOFSTEP]
tactic => norm_cast
[GOAL]
n x y : ℤ
h : n = x ^ 2 + y ^ 2
hc : IsCoprime x y
u v : ℤ
huv : u * x + v * n = 1
H : u * y * (u * y) - -1 = n * (-v ^ 2 * n + u ^ 2 + 2 * v)
⊢ ↑u * ↑y * (↑u * ↑y) = ?m.37150
[PROOFSTEP]
norm_cast
[GOAL]
case intro.intro
n x y : ℤ
h : n = x ^ 2 + y ^ 2
hc : IsCoprime x y
u v : ℤ
huv : u * x + v * n = 1
H : u * y * (u * y) - -1 = n * (-v ^ 2 * n + u ^ 2 + 2 * v)
⊢ -1 = ↑(u * y * (u * y))
[PROOFSTEP]
rw [(by norm_cast : (-1 : ZMod n.natAbs) = (-1 : ℤ))]
[GOAL]
n x y : ℤ
h : n = x ^ 2 + y ^ 2
hc : IsCoprime x y
u v : ℤ
huv : u * x + v * n = 1
H : u * y * (u * y) - -1 = n * (-v ^ 2 * n + u ^ 2 + 2 * v)
⊢ -1 = ↑(-1)
[PROOFSTEP]
norm_cast
[GOAL]
case intro.intro
n x y : ℤ
h : n = x ^ 2 + y ^ 2
hc : IsCoprime x y
u v : ℤ
huv : u * x + v * n = 1
H : u * y * (u * y) - -1 = n * (-v ^ 2 * n + u ^ 2 + 2 * v)
⊢ ↑(-1) = ↑(u * y * (u * y))
[PROOFSTEP]
exact (ZMod.int_cast_eq_int_cast_iff_dvd_sub _ _ _).mpr (Int.natAbs_dvd.mpr ⟨_, H⟩)
[GOAL]
n x y : ℕ
h : n = x ^ 2 + y ^ 2
hc : Nat.coprime x y
⊢ IsSquare (-1)
[PROOFSTEP]
zify at h
[GOAL]
n x y : ℕ
hc : Nat.coprime x y
h : ↑n = ↑x ^ 2 + ↑y ^ 2
⊢ IsSquare (-1)
[PROOFSTEP]
exact ZMod.isSquare_neg_one_of_eq_sq_add_sq_of_isCoprime h hc.isCoprime
[GOAL]
n : ℕ
⊢ (∃ x y, n = x ^ 2 + y ^ 2) ↔ ∃ a b, n = a ^ 2 * b ∧ IsSquare (-1)
[PROOFSTEP]
constructor
[GOAL]
case mp
n : ℕ
⊢ (∃ x y, n = x ^ 2 + y ^ 2) → ∃ a b, n = a ^ 2 * b ∧ IsSquare (-1)
[PROOFSTEP]
rintro ⟨x, y, h⟩
[GOAL]
case mp.intro.intro
n x y : ℕ
h : n = x ^ 2 + y ^ 2
⊢ ∃ a b, n = a ^ 2 * b ∧ IsSquare (-1)
[PROOFSTEP]
by_cases hxy : x = 0 ∧ y = 0
[GOAL]
case pos
n x y : ℕ
h : n = x ^ 2 + y ^ 2
hxy : x = 0 ∧ y = 0
⊢ ∃ a b, n = a ^ 2 * b ∧ IsSquare (-1)
[PROOFSTEP]
exact
  ⟨0, 1, by rw [h, hxy.1, hxy.2, zero_pow zero_lt_two, add_zero, zero_mul],
    ⟨0, by rw [zero_mul, neg_eq_zero, Fin.one_eq_zero_iff]⟩⟩
[GOAL]
n x y : ℕ
h : n = x ^ 2 + y ^ 2
hxy : x = 0 ∧ y = 0
⊢ n = 0 ^ 2 * 1
[PROOFSTEP]
rw [h, hxy.1, hxy.2, zero_pow zero_lt_two, add_zero, zero_mul]
[GOAL]
n x y : ℕ
h : n = x ^ 2 + y ^ 2
hxy : x = 0 ∧ y = 0
⊢ -1 = 0 * 0
[PROOFSTEP]
rw [zero_mul, neg_eq_zero, Fin.one_eq_zero_iff]
[GOAL]
case neg
n x y : ℕ
h : n = x ^ 2 + y ^ 2
hxy : ¬(x = 0 ∧ y = 0)
⊢ ∃ a b, n = a ^ 2 * b ∧ IsSquare (-1)
[PROOFSTEP]
have hg := Nat.pos_of_ne_zero (mt Nat.gcd_eq_zero_iff.mp hxy)
[GOAL]
case neg
n x y : ℕ
h : n = x ^ 2 + y ^ 2
hxy : ¬(x = 0 ∧ y = 0)
hg : 0 < gcd x y
⊢ ∃ a b, n = a ^ 2 * b ∧ IsSquare (-1)
[PROOFSTEP]
obtain ⟨g, x₁, y₁, _, h₂, h₃, h₄⟩ := Nat.exists_coprime' hg
[GOAL]
case neg.intro.intro.intro.intro.intro.intro
n x y : ℕ
h : n = x ^ 2 + y ^ 2
hxy : ¬(x = 0 ∧ y = 0)
hg : 0 < gcd x y
g : ℕ
x₁ y₁ : ℕ
left✝ : 0 < g
h₂ : coprime x₁ y₁
h₃ : x = x₁ * g
h₄ : y = y₁ * g
⊢ ∃ a b, n = a ^ 2 * b ∧ IsSquare (-1)
[PROOFSTEP]
exact ⟨g, x₁ ^ 2 + y₁ ^ 2, by rw [h, h₃, h₄]; ring, ZMod.isSquare_neg_one_of_eq_sq_add_sq_of_coprime rfl h₂⟩
[GOAL]
n x y : ℕ
h : n = x ^ 2 + y ^ 2
hxy : ¬(x = 0 ∧ y = 0)
hg : 0 < gcd x y
g : ℕ
x₁ y₁ : ℕ
left✝ : 0 < g
h₂ : coprime x₁ y₁
h₃ : x = x₁ * g
h₄ : y = y₁ * g
⊢ n = g ^ 2 * (x₁ ^ 2 + y₁ ^ 2)
[PROOFSTEP]
rw [h, h₃, h₄]
[GOAL]
n x y : ℕ
h : n = x ^ 2 + y ^ 2
hxy : ¬(x = 0 ∧ y = 0)
hg : 0 < gcd x y
g : ℕ
x₁ y₁ : ℕ
left✝ : 0 < g
h₂ : coprime x₁ y₁
h₃ : x = x₁ * g
h₄ : y = y₁ * g
⊢ (x₁ * g) ^ 2 + (y₁ * g) ^ 2 = g ^ 2 * (x₁ ^ 2 + y₁ ^ 2)
[PROOFSTEP]
ring
[GOAL]
case mpr
n : ℕ
⊢ (∃ a b, n = a ^ 2 * b ∧ IsSquare (-1)) → ∃ x y, n = x ^ 2 + y ^ 2
[PROOFSTEP]
rintro ⟨a, b, h₁, h₂⟩
[GOAL]
case mpr.intro.intro.intro
n a b : ℕ
h₁ : n = a ^ 2 * b
h₂ : IsSquare (-1)
⊢ ∃ x y, n = x ^ 2 + y ^ 2
[PROOFSTEP]
obtain ⟨x', y', h⟩ := Nat.eq_sq_add_sq_of_isSquare_mod_neg_one h₂
[GOAL]
case mpr.intro.intro.intro.intro.intro
n a b : ℕ
h₁ : n = a ^ 2 * b
h₂ : IsSquare (-1)
x' y' : ℕ
h : b = x' ^ 2 + y' ^ 2
⊢ ∃ x y, n = x ^ 2 + y ^ 2
[PROOFSTEP]
exact ⟨a * x', a * y', by rw [h₁, h]; ring⟩
[GOAL]
n a b : ℕ
h₁ : n = a ^ 2 * b
h₂ : IsSquare (-1)
x' y' : ℕ
h : b = x' ^ 2 + y' ^ 2
⊢ n = (a * x') ^ 2 + (a * y') ^ 2
[PROOFSTEP]
rw [h₁, h]
[GOAL]
n a b : ℕ
h₁ : n = a ^ 2 * b
h₂ : IsSquare (-1)
x' y' : ℕ
h : b = x' ^ 2 + y' ^ 2
⊢ a ^ 2 * (x' ^ 2 + y' ^ 2) = (a * x') ^ 2 + (a * y') ^ 2
[PROOFSTEP]
ring
[GOAL]
n : ℕ
⊢ (∃ x y, n = x ^ 2 + y ^ 2) ↔ ∀ {q : ℕ}, Prime q → q % 4 = 3 → Even (padicValNat q n)
[PROOFSTEP]
rcases n.eq_zero_or_pos with (rfl | hn₀)
[GOAL]
case inl
⊢ (∃ x y, 0 = x ^ 2 + y ^ 2) ↔ ∀ {q : ℕ}, Prime q → q % 4 = 3 → Even (padicValNat q 0)
[PROOFSTEP]
exact
  ⟨fun _ q _ _ => (@padicValNat.zero q).symm ▸ even_zero, fun _ => ⟨0, 0, rfl⟩⟩
    -- now `0 < n`
[GOAL]
case inr
n : ℕ
hn₀ : n > 0
⊢ (∃ x y, n = x ^ 2 + y ^ 2) ↔ ∀ {q : ℕ}, Prime q → q % 4 = 3 → Even (padicValNat q n)
[PROOFSTEP]
rw [Nat.eq_sq_add_sq_iff_eq_sq_mul]
[GOAL]
case inr
n : ℕ
hn₀ : n > 0
⊢ (∃ a b, n = a ^ 2 * b ∧ IsSquare (-1)) ↔ ∀ {q : ℕ}, Prime q → q % 4 = 3 → Even (padicValNat q n)
[PROOFSTEP]
refine' ⟨fun H q hq h => _, fun H => _⟩
[GOAL]
case inr.refine'_1
n : ℕ
hn₀ : n > 0
H : ∃ a b, n = a ^ 2 * b ∧ IsSquare (-1)
q : ℕ
hq : Prime q
h : q % 4 = 3
⊢ Even (padicValNat q n)
[PROOFSTEP]
obtain ⟨a, b, h₁, h₂⟩ := H
[GOAL]
case inr.refine'_1.intro.intro.intro
n : ℕ
hn₀ : n > 0
q : ℕ
hq : Prime q
h : q % 4 = 3
a b : ℕ
h₁ : n = a ^ 2 * b
h₂ : IsSquare (-1)
⊢ Even (padicValNat q n)
[PROOFSTEP]
have hqb := padicValNat.eq_zero_of_not_dvd fun hf => (hq.mod_four_ne_three_of_dvd_isSquare_neg_one hf h₂) h
[GOAL]
case inr.refine'_1.intro.intro.intro
n : ℕ
hn₀ : n > 0
q : ℕ
hq : Prime q
h : q % 4 = 3
a b : ℕ
h₁ : n = a ^ 2 * b
h₂ : IsSquare (-1)
hqb : padicValNat q b = 0
⊢ Even (padicValNat q n)
[PROOFSTEP]
have hab : a ^ 2 * b ≠ 0 := h₁ ▸ hn₀.ne'
[GOAL]
case inr.refine'_1.intro.intro.intro
n : ℕ
hn₀ : n > 0
q : ℕ
hq : Prime q
h : q % 4 = 3
a b : ℕ
h₁ : n = a ^ 2 * b
h₂ : IsSquare (-1)
hqb : padicValNat q b = 0
hab : a ^ 2 * b ≠ 0
⊢ Even (padicValNat q n)
[PROOFSTEP]
have ha₂ := left_ne_zero_of_mul hab
[GOAL]
case inr.refine'_1.intro.intro.intro
n : ℕ
hn₀ : n > 0
q : ℕ
hq : Prime q
h : q % 4 = 3
a b : ℕ
h₁ : n = a ^ 2 * b
h₂ : IsSquare (-1)
hqb : padicValNat q b = 0
hab : a ^ 2 * b ≠ 0
ha₂ : a ^ 2 ≠ 0
⊢ Even (padicValNat q n)
[PROOFSTEP]
have ha := mt sq_eq_zero_iff.mpr ha₂
[GOAL]
case inr.refine'_1.intro.intro.intro
n : ℕ
hn₀ : n > 0
q : ℕ
hq : Prime q
h : q % 4 = 3
a b : ℕ
h₁ : n = a ^ 2 * b
h₂ : IsSquare (-1)
hqb : padicValNat q b = 0
hab : a ^ 2 * b ≠ 0
ha₂ : a ^ 2 ≠ 0
ha : ¬a = 0
⊢ Even (padicValNat q n)
[PROOFSTEP]
have hb := right_ne_zero_of_mul hab
[GOAL]
case inr.refine'_1.intro.intro.intro
n : ℕ
hn₀ : n > 0
q : ℕ
hq : Prime q
h : q % 4 = 3
a b : ℕ
h₁ : n = a ^ 2 * b
h₂ : IsSquare (-1)
hqb : padicValNat q b = 0
hab : a ^ 2 * b ≠ 0
ha₂ : a ^ 2 ≠ 0
ha : ¬a = 0
hb : b ≠ 0
⊢ Even (padicValNat q n)
[PROOFSTEP]
haveI hqi : Fact q.Prime := ⟨hq⟩
[GOAL]
case inr.refine'_1.intro.intro.intro
n : ℕ
hn₀ : n > 0
q : ℕ
hq : Prime q
h : q % 4 = 3
a b : ℕ
h₁ : n = a ^ 2 * b
h₂ : IsSquare (-1)
hqb : padicValNat q b = 0
hab : a ^ 2 * b ≠ 0
ha₂ : a ^ 2 ≠ 0
ha : ¬a = 0
hb : b ≠ 0
hqi : Fact (Prime q)
⊢ Even (padicValNat q n)
[PROOFSTEP]
simp_rw [h₁, padicValNat.mul ha₂ hb, padicValNat.pow 2 ha, hqb, add_zero]
[GOAL]
case inr.refine'_1.intro.intro.intro
n : ℕ
hn₀ : n > 0
q : ℕ
hq : Prime q
h : q % 4 = 3
a b : ℕ
h₁ : n = a ^ 2 * b
h₂ : IsSquare (-1)
hqb : padicValNat q b = 0
hab : a ^ 2 * b ≠ 0
ha₂ : a ^ 2 ≠ 0
ha : ¬a = 0
hb : b ≠ 0
hqi : Fact (Prime q)
⊢ Even (2 * padicValNat q a)
[PROOFSTEP]
exact even_two_mul _
[GOAL]
case inr.refine'_2
n : ℕ
hn₀ : n > 0
H : ∀ {q : ℕ}, Prime q → q % 4 = 3 → Even (padicValNat q n)
⊢ ∃ a b, n = a ^ 2 * b ∧ IsSquare (-1)
[PROOFSTEP]
obtain ⟨b, a, hb₀, ha₀, hab, hb⟩ := Nat.sq_mul_squarefree_of_pos hn₀
[GOAL]
case inr.refine'_2.intro.intro.intro.intro.intro
n : ℕ
hn₀ : n > 0
H : ∀ {q : ℕ}, Prime q → q % 4 = 3 → Even (padicValNat q n)
b a : ℕ
hb₀ : 0 < b
ha₀ : 0 < a
hab : a ^ 2 * b = n
hb : Squarefree b
⊢ ∃ a b, n = a ^ 2 * b ∧ IsSquare (-1)
[PROOFSTEP]
refine' ⟨a, b, hab.symm, (ZMod.isSquare_neg_one_iff hb).mpr fun {q} hqp hqb hq4 => _⟩
[GOAL]
case inr.refine'_2.intro.intro.intro.intro.intro
n : ℕ
hn₀ : n > 0
H : ∀ {q : ℕ}, Prime q → q % 4 = 3 → Even (padicValNat q n)
b a : ℕ
hb₀ : 0 < b
ha₀ : 0 < a
hab : a ^ 2 * b = n
hb : Squarefree b
q : ℕ
hqp : Prime q
hqb : q ∣ b
hq4 : q % 4 = 3
⊢ False
[PROOFSTEP]
refine' Nat.odd_iff_not_even.mp _ (H hqp hq4)
[GOAL]
case inr.refine'_2.intro.intro.intro.intro.intro
n : ℕ
hn₀ : n > 0
H : ∀ {q : ℕ}, Prime q → q % 4 = 3 → Even (padicValNat q n)
b a : ℕ
hb₀ : 0 < b
ha₀ : 0 < a
hab : a ^ 2 * b = n
hb : Squarefree b
q : ℕ
hqp : Prime q
hqb : q ∣ b
hq4 : q % 4 = 3
⊢ Odd (padicValNat q n)
[PROOFSTEP]
have hqb' : padicValNat q b = 1 :=
  b.factorization_def hqp ▸
    le_antisymm (Nat.Squarefree.factorization_le_one _ hb) ((hqp.dvd_iff_one_le_factorization hb₀.ne').mp hqb)
[GOAL]
case inr.refine'_2.intro.intro.intro.intro.intro
n : ℕ
hn₀ : n > 0
H : ∀ {q : ℕ}, Prime q → q % 4 = 3 → Even (padicValNat q n)
b a : ℕ
hb₀ : 0 < b
ha₀ : 0 < a
hab : a ^ 2 * b = n
hb : Squarefree b
q : ℕ
hqp : Prime q
hqb : q ∣ b
hq4 : q % 4 = 3
hqb' : padicValNat q b = 1
⊢ Odd (padicValNat q n)
[PROOFSTEP]
haveI hqi : Fact q.Prime := ⟨hqp⟩
[GOAL]
case inr.refine'_2.intro.intro.intro.intro.intro
n : ℕ
hn₀ : n > 0
H : ∀ {q : ℕ}, Prime q → q % 4 = 3 → Even (padicValNat q n)
b a : ℕ
hb₀ : 0 < b
ha₀ : 0 < a
hab : a ^ 2 * b = n
hb : Squarefree b
q : ℕ
hqp : Prime q
hqb : q ∣ b
hq4 : q % 4 = 3
hqb' : padicValNat q b = 1
hqi : Fact (Prime q)
⊢ Odd (padicValNat q n)
[PROOFSTEP]
simp_rw [← hab, padicValNat.mul (pow_ne_zero 2 ha₀.ne') hb₀.ne', hqb', padicValNat.pow 2 ha₀.ne']
[GOAL]
case inr.refine'_2.intro.intro.intro.intro.intro
n : ℕ
hn₀ : n > 0
H : ∀ {q : ℕ}, Prime q → q % 4 = 3 → Even (padicValNat q n)
b a : ℕ
hb₀ : 0 < b
ha₀ : 0 < a
hab : a ^ 2 * b = n
hb : Squarefree b
q : ℕ
hqp : Prime q
hqb : q ∣ b
hq4 : q % 4 = 3
hqb' : padicValNat q b = 1
hqi : Fact (Prime q)
⊢ Odd (2 * padicValNat q a + 1)
[PROOFSTEP]
exact odd_two_mul_add_one _


[GOAL]
F : Type u_1
M : Type u_2
N : Type u_3
inst✝² : Mul M
inst✝¹ : Mul N
a x y : M
inst✝ : MulHomClass F M N
h : SemiconjBy a x y
f : F
⊢ SemiconjBy (↑f a) (↑f x) (↑f y)
[PROOFSTEP]
simpa only [SemiconjBy, map_mul] using congr_arg f h
[GOAL]
F : Type u_1
M : Type u_2
N : Type u_3
inst✝² : Mul M
inst✝¹ : Mul N
a x y : M
inst✝ : MulHomClass F M N
f : F
hf : Function.Injective ↑f
h : SemiconjBy (↑f a) (↑f x) (↑f y)
⊢ ↑f (a * x) = ↑f (y * a)
[PROOFSTEP]
simpa only [SemiconjBy, map_mul] using h
[GOAL]
F : Type u_1
M : Type u_2
N : Type u_3
inst✝² : Mul M
inst✝¹ : Mul N
a x y : M
inst✝ : MulHomClass F M N
f : F
hf : Function.Injective ↑f
h : Commute (↑f x) (↑f y)
⊢ ↑f (x * y) = ↑f (y * x)
[PROOFSTEP]
simpa only [map_mul] using h.eq


[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
M : Type u_4
inst✝¹¹ : CommSemiring R
inst✝¹⁰ : AddCommMonoid M
inst✝⁹ : Module R M
inst✝⁸ : Semiring A
inst✝⁷ : Semiring B
inst✝⁶ : Module A M
inst✝⁵ : Module B M
inst✝⁴ : Algebra R A
inst✝³ : Algebra R B
inst✝² : IsScalarTower R A M
inst✝¹ : IsScalarTower R B M
inst✝ : SMulCommClass A B M
p : AddSubmonoid M
hA : ∀ (a : A) {m : M}, m ∈ p → a • m ∈ p
hB : ∀ (b : B) {m : M}, m ∈ p → b • m ∈ p
ab : A ⊗[R] B
m : M
x✝ :
  m ∈
    {
          toAddSubsemigroup :=
            { carrier := ↑p, add_mem' := (_ : ∀ {a b : M}, a ∈ p.carrier → b ∈ p.carrier → a + b ∈ p.carrier) },
          zero_mem' := (_ : 0 ∈ p.carrier) }.toAddSubsemigroup.carrier
⊢ 0 • m ∈
    {
          toAddSubsemigroup :=
            { carrier := ↑p, add_mem' := (_ : ∀ {a b : M}, a ∈ p.carrier → b ∈ p.carrier → a + b ∈ p.carrier) },
          zero_mem' := (_ : 0 ∈ p.carrier) }.toAddSubsemigroup.carrier
[PROOFSTEP]
simpa only [zero_smul] using p.zero_mem
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
M : Type u_4
inst✝¹¹ : CommSemiring R
inst✝¹⁰ : AddCommMonoid M
inst✝⁹ : Module R M
inst✝⁸ : Semiring A
inst✝⁷ : Semiring B
inst✝⁶ : Module A M
inst✝⁵ : Module B M
inst✝⁴ : Algebra R A
inst✝³ : Algebra R B
inst✝² : IsScalarTower R A M
inst✝¹ : IsScalarTower R B M
inst✝ : SMulCommClass A B M
p : AddSubmonoid M
hA : ∀ (a : A) {m : M}, m ∈ p → a • m ∈ p
hB : ∀ (b : B) {m : M}, m ∈ p → b • m ∈ p
ab : A ⊗[R] B
m : M
a : A
b : B
hm :
  m ∈
    {
          toAddSubsemigroup :=
            { carrier := ↑p, add_mem' := (_ : ∀ {a b : M}, a ∈ p.carrier → b ∈ p.carrier → a + b ∈ p.carrier) },
          zero_mem' := (_ : 0 ∈ p.carrier) }.toAddSubsemigroup.carrier
⊢ a ⊗ₜ[R] b • m ∈
    {
          toAddSubsemigroup :=
            { carrier := ↑p, add_mem' := (_ : ∀ {a b : M}, a ∈ p.carrier → b ∈ p.carrier → a + b ∈ p.carrier) },
          zero_mem' := (_ : 0 ∈ p.carrier) }.toAddSubsemigroup.carrier
[PROOFSTEP]
simpa only [TensorProduct.Algebra.smul_def] using hA a (hB b hm)
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
M : Type u_4
inst✝¹¹ : CommSemiring R
inst✝¹⁰ : AddCommMonoid M
inst✝⁹ : Module R M
inst✝⁸ : Semiring A
inst✝⁷ : Semiring B
inst✝⁶ : Module A M
inst✝⁵ : Module B M
inst✝⁴ : Algebra R A
inst✝³ : Algebra R B
inst✝² : IsScalarTower R A M
inst✝¹ : IsScalarTower R B M
inst✝ : SMulCommClass A B M
p : AddSubmonoid M
hA : ∀ (a : A) {m : M}, m ∈ p → a • m ∈ p
hB : ∀ (b : B) {m : M}, m ∈ p → b • m ∈ p
ab : A ⊗[R] B
m : M
z w : A ⊗[R] B
hz :
  m ∈
      {
            toAddSubsemigroup :=
              { carrier := ↑p, add_mem' := (_ : ∀ {a b : M}, a ∈ p.carrier → b ∈ p.carrier → a + b ∈ p.carrier) },
            zero_mem' := (_ : 0 ∈ p.carrier) }.toAddSubsemigroup.carrier →
    z • m ∈
      {
            toAddSubsemigroup :=
              { carrier := ↑p, add_mem' := (_ : ∀ {a b : M}, a ∈ p.carrier → b ∈ p.carrier → a + b ∈ p.carrier) },
            zero_mem' := (_ : 0 ∈ p.carrier) }.toAddSubsemigroup.carrier
hw :
  m ∈
      {
            toAddSubsemigroup :=
              { carrier := ↑p, add_mem' := (_ : ∀ {a b : M}, a ∈ p.carrier → b ∈ p.carrier → a + b ∈ p.carrier) },
            zero_mem' := (_ : 0 ∈ p.carrier) }.toAddSubsemigroup.carrier →
    w • m ∈
      {
            toAddSubsemigroup :=
              { carrier := ↑p, add_mem' := (_ : ∀ {a b : M}, a ∈ p.carrier → b ∈ p.carrier → a + b ∈ p.carrier) },
            zero_mem' := (_ : 0 ∈ p.carrier) }.toAddSubsemigroup.carrier
hm :
  m ∈
    {
          toAddSubsemigroup :=
            { carrier := ↑p, add_mem' := (_ : ∀ {a b : M}, a ∈ p.carrier → b ∈ p.carrier → a + b ∈ p.carrier) },
          zero_mem' := (_ : 0 ∈ p.carrier) }.toAddSubsemigroup.carrier
⊢ (z + w) • m ∈
    {
          toAddSubsemigroup :=
            { carrier := ↑p, add_mem' := (_ : ∀ {a b : M}, a ∈ p.carrier → b ∈ p.carrier → a + b ∈ p.carrier) },
          zero_mem' := (_ : 0 ∈ p.carrier) }.toAddSubsemigroup.carrier
[PROOFSTEP]
simpa only [add_smul] using p.add_mem (hz hm) (hw hm)
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
M : Type u_4
inst✝¹¹ : CommSemiring R
inst✝¹⁰ : AddCommMonoid M
inst✝⁹ : Module R M
inst✝⁸ : Semiring A
inst✝⁷ : Semiring B
inst✝⁶ : Module A M
inst✝⁵ : Module B M
inst✝⁴ : Algebra R A
inst✝³ : Algebra R B
inst✝² : IsScalarTower R A M
inst✝¹ : IsScalarTower R B M
inst✝ : SMulCommClass A B M
p : Submodule (A ⊗[R] B) M
a : A
m : M
hm : m ∈ p
⊢ a • m ∈ p
[PROOFSTEP]
suffices a • m = a ⊗ₜ[R] (1 : B) • m by exact this.symm ▸ p.smul_mem _ hm
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
M : Type u_4
inst✝¹¹ : CommSemiring R
inst✝¹⁰ : AddCommMonoid M
inst✝⁹ : Module R M
inst✝⁸ : Semiring A
inst✝⁷ : Semiring B
inst✝⁶ : Module A M
inst✝⁵ : Module B M
inst✝⁴ : Algebra R A
inst✝³ : Algebra R B
inst✝² : IsScalarTower R A M
inst✝¹ : IsScalarTower R B M
inst✝ : SMulCommClass A B M
p : Submodule (A ⊗[R] B) M
a : A
m : M
hm : m ∈ p
this : a • m = a ⊗ₜ[R] 1 • m
⊢ a • m ∈ p
[PROOFSTEP]
exact this.symm ▸ p.smul_mem _ hm
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
M : Type u_4
inst✝¹¹ : CommSemiring R
inst✝¹⁰ : AddCommMonoid M
inst✝⁹ : Module R M
inst✝⁸ : Semiring A
inst✝⁷ : Semiring B
inst✝⁶ : Module A M
inst✝⁵ : Module B M
inst✝⁴ : Algebra R A
inst✝³ : Algebra R B
inst✝² : IsScalarTower R A M
inst✝¹ : IsScalarTower R B M
inst✝ : SMulCommClass A B M
p : Submodule (A ⊗[R] B) M
a : A
m : M
hm : m ∈ p
⊢ a • m = a ⊗ₜ[R] 1 • m
[PROOFSTEP]
simp [TensorProduct.Algebra.smul_def]
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
M : Type u_4
inst✝¹¹ : CommSemiring R
inst✝¹⁰ : AddCommMonoid M
inst✝⁹ : Module R M
inst✝⁸ : Semiring A
inst✝⁷ : Semiring B
inst✝⁶ : Module A M
inst✝⁵ : Module B M
inst✝⁴ : Algebra R A
inst✝³ : Algebra R B
inst✝² : IsScalarTower R A M
inst✝¹ : IsScalarTower R B M
inst✝ : SMulCommClass A B M
p : Submodule (A ⊗[R] B) M
b : B
m : M
hm : m ∈ p
⊢ b • m ∈ p
[PROOFSTEP]
suffices b • m = (1 : A) ⊗ₜ[R] b • m by exact this.symm ▸ p.smul_mem _ hm
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
M : Type u_4
inst✝¹¹ : CommSemiring R
inst✝¹⁰ : AddCommMonoid M
inst✝⁹ : Module R M
inst✝⁸ : Semiring A
inst✝⁷ : Semiring B
inst✝⁶ : Module A M
inst✝⁵ : Module B M
inst✝⁴ : Algebra R A
inst✝³ : Algebra R B
inst✝² : IsScalarTower R A M
inst✝¹ : IsScalarTower R B M
inst✝ : SMulCommClass A B M
p : Submodule (A ⊗[R] B) M
b : B
m : M
hm : m ∈ p
this : b • m = 1 ⊗ₜ[R] b • m
⊢ b • m ∈ p
[PROOFSTEP]
exact this.symm ▸ p.smul_mem _ hm
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
M : Type u_4
inst✝¹¹ : CommSemiring R
inst✝¹⁰ : AddCommMonoid M
inst✝⁹ : Module R M
inst✝⁸ : Semiring A
inst✝⁷ : Semiring B
inst✝⁶ : Module A M
inst✝⁵ : Module B M
inst✝⁴ : Algebra R A
inst✝³ : Algebra R B
inst✝² : IsScalarTower R A M
inst✝¹ : IsScalarTower R B M
inst✝ : SMulCommClass A B M
p : Submodule (A ⊗[R] B) M
b : B
m : M
hm : m ∈ p
⊢ b • m = 1 ⊗ₜ[R] b • m
[PROOFSTEP]
simp [TensorProduct.Algebra.smul_def]


[GOAL]
α : Type u_1
inst✝¹ : Preorder α
s : Set α
inst✝ : LocallyFiniteOrderTop α
hs : Set.Finite s
⊢ Set.Finite ↑(upperClosure s)
[PROOFSTEP]
rw [coe_upperClosure]
[GOAL]
α : Type u_1
inst✝¹ : Preorder α
s : Set α
inst✝ : LocallyFiniteOrderTop α
hs : Set.Finite s
⊢ Set.Finite (⋃ (a : α) (_ : a ∈ s), Ici a)
[PROOFSTEP]
exact hs.biUnion fun _ _ => finite_Ici _
[GOAL]
α : Type u_1
inst✝¹ : Preorder α
s : Set α
inst✝ : LocallyFiniteOrderBot α
hs : Set.Finite s
⊢ Set.Finite ↑(lowerClosure s)
[PROOFSTEP]
rw [coe_lowerClosure]
[GOAL]
α : Type u_1
inst✝¹ : Preorder α
s : Set α
inst✝ : LocallyFiniteOrderBot α
hs : Set.Finite s
⊢ Set.Finite (⋃ (a : α) (_ : a ∈ s), Iic a)
[PROOFSTEP]
exact hs.biUnion fun _ _ => finite_Iic _


[GOAL]
R : Type u_1
A : Type u_2
inst✝⁴ : CommSemiring R
inst✝³ : NonUnitalSemiring A
inst✝² : Module R A
inst✝¹ : SMulCommClass R A A
inst✝ : IsScalarTower R A A
src✝ : A →ₗ[R] A →ₗ[R] A := mul R A
⊢ MulActionHom.toFun
      { toFun := src✝.toFun,
        map_smul' :=
          (_ :
            ∀ (r : R) (x : A), AddHom.toFun src✝.toAddHom (r • x) = ↑(RingHom.id R) r • AddHom.toFun src✝.toAddHom x) }
      0 =
    0
[PROOFSTEP]
ext a
[GOAL]
case h
R : Type u_1
A : Type u_2
inst✝⁴ : CommSemiring R
inst✝³ : NonUnitalSemiring A
inst✝² : Module R A
inst✝¹ : SMulCommClass R A A
inst✝ : IsScalarTower R A A
src✝ : A →ₗ[R] A →ₗ[R] A := mul R A
a : A
⊢ ↑(MulActionHom.toFun
          { toFun := src✝.toFun,
            map_smul' :=
              (_ :
                ∀ (r : R) (x : A),
                  AddHom.toFun src✝.toAddHom (r • x) = ↑(RingHom.id R) r • AddHom.toFun src✝.toAddHom x) }
          0)
      a =
    ↑0 a
[PROOFSTEP]
exact zero_mul a
[GOAL]
R : Type u_1
A : Type u_2
inst✝⁴ : CommSemiring R
inst✝³ : NonUnitalSemiring A
inst✝² : Module R A
inst✝¹ : SMulCommClass R A A
inst✝ : IsScalarTower R A A
src✝ : A →ₗ[R] A →ₗ[R] A := mul R A
⊢ ∀ (x y : A),
    MulActionHom.toFun
        {
            toMulActionHom :=
              { toFun := src✝.toFun,
                map_smul' :=
                  (_ :
                    ∀ (r : R) (x : A),
                      AddHom.toFun src✝.toAddHom (r • x) = ↑(RingHom.id R) r • AddHom.toFun src✝.toAddHom x) },
            map_zero' :=
              (_ :
                MulActionHom.toFun
                    { toFun := src✝.toFun,
                      map_smul' :=
                        (_ :
                          ∀ (r : R) (x : A),
                            AddHom.toFun src✝.toAddHom (r • x) = ↑(RingHom.id R) r • AddHom.toFun src✝.toAddHom x) }
                    0 =
                  0),
            map_add' :=
              (_ :
                ∀ (x y : A),
                  AddHom.toFun src✝.toAddHom (x + y) =
                    AddHom.toFun src✝.toAddHom x + AddHom.toFun src✝.toAddHom y) }.toMulActionHom
        (x * y) =
      MulActionHom.toFun
          {
              toMulActionHom :=
                { toFun := src✝.toFun,
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (x : A),
                        AddHom.toFun src✝.toAddHom (r • x) = ↑(RingHom.id R) r • AddHom.toFun src✝.toAddHom x) },
              map_zero' :=
                (_ :
                  MulActionHom.toFun
                      { toFun := src✝.toFun,
                        map_smul' :=
                          (_ :
                            ∀ (r : R) (x : A),
                              AddHom.toFun src✝.toAddHom (r • x) = ↑(RingHom.id R) r • AddHom.toFun src✝.toAddHom x) }
                      0 =
                    0),
              map_add' :=
                (_ :
                  ∀ (x y : A),
                    AddHom.toFun src✝.toAddHom (x + y) =
                      AddHom.toFun src✝.toAddHom x + AddHom.toFun src✝.toAddHom y) }.toMulActionHom
          x *
        MulActionHom.toFun
          {
              toMulActionHom :=
                { toFun := src✝.toFun,
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (x : A),
                        AddHom.toFun src✝.toAddHom (r • x) = ↑(RingHom.id R) r • AddHom.toFun src✝.toAddHom x) },
              map_zero' :=
                (_ :
                  MulActionHom.toFun
                      { toFun := src✝.toFun,
                        map_smul' :=
                          (_ :
                            ∀ (r : R) (x : A),
                              AddHom.toFun src✝.toAddHom (r • x) = ↑(RingHom.id R) r • AddHom.toFun src✝.toAddHom x) }
                      0 =
                    0),
              map_add' :=
                (_ :
                  ∀ (x y : A),
                    AddHom.toFun src✝.toAddHom (x + y) =
                      AddHom.toFun src✝.toAddHom x + AddHom.toFun src✝.toAddHom y) }.toMulActionHom
          y
[PROOFSTEP]
intro a b
[GOAL]
R : Type u_1
A : Type u_2
inst✝⁴ : CommSemiring R
inst✝³ : NonUnitalSemiring A
inst✝² : Module R A
inst✝¹ : SMulCommClass R A A
inst✝ : IsScalarTower R A A
src✝ : A →ₗ[R] A →ₗ[R] A := mul R A
a b : A
⊢ MulActionHom.toFun
      {
          toMulActionHom :=
            { toFun := src✝.toFun,
              map_smul' :=
                (_ :
                  ∀ (r : R) (x : A),
                    AddHom.toFun src✝.toAddHom (r • x) = ↑(RingHom.id R) r • AddHom.toFun src✝.toAddHom x) },
          map_zero' :=
            (_ :
              MulActionHom.toFun
                  { toFun := src✝.toFun,
                    map_smul' :=
                      (_ :
                        ∀ (r : R) (x : A),
                          AddHom.toFun src✝.toAddHom (r • x) = ↑(RingHom.id R) r • AddHom.toFun src✝.toAddHom x) }
                  0 =
                0),
          map_add' :=
            (_ :
              ∀ (x y : A),
                AddHom.toFun src✝.toAddHom (x + y) =
                  AddHom.toFun src✝.toAddHom x + AddHom.toFun src✝.toAddHom y) }.toMulActionHom
      (a * b) =
    MulActionHom.toFun
        {
            toMulActionHom :=
              { toFun := src✝.toFun,
                map_smul' :=
                  (_ :
                    ∀ (r : R) (x : A),
                      AddHom.toFun src✝.toAddHom (r • x) = ↑(RingHom.id R) r • AddHom.toFun src✝.toAddHom x) },
            map_zero' :=
              (_ :
                MulActionHom.toFun
                    { toFun := src✝.toFun,
                      map_smul' :=
                        (_ :
                          ∀ (r : R) (x : A),
                            AddHom.toFun src✝.toAddHom (r • x) = ↑(RingHom.id R) r • AddHom.toFun src✝.toAddHom x) }
                    0 =
                  0),
            map_add' :=
              (_ :
                ∀ (x y : A),
                  AddHom.toFun src✝.toAddHom (x + y) =
                    AddHom.toFun src✝.toAddHom x + AddHom.toFun src✝.toAddHom y) }.toMulActionHom
        a *
      MulActionHom.toFun
        {
            toMulActionHom :=
              { toFun := src✝.toFun,
                map_smul' :=
                  (_ :
                    ∀ (r : R) (x : A),
                      AddHom.toFun src✝.toAddHom (r • x) = ↑(RingHom.id R) r • AddHom.toFun src✝.toAddHom x) },
            map_zero' :=
              (_ :
                MulActionHom.toFun
                    { toFun := src✝.toFun,
                      map_smul' :=
                        (_ :
                          ∀ (r : R) (x : A),
                            AddHom.toFun src✝.toAddHom (r • x) = ↑(RingHom.id R) r • AddHom.toFun src✝.toAddHom x) }
                    0 =
                  0),
            map_add' :=
              (_ :
                ∀ (x y : A),
                  AddHom.toFun src✝.toAddHom (x + y) =
                    AddHom.toFun src✝.toAddHom x + AddHom.toFun src✝.toAddHom y) }.toMulActionHom
        b
[PROOFSTEP]
ext c
[GOAL]
case h
R : Type u_1
A : Type u_2
inst✝⁴ : CommSemiring R
inst✝³ : NonUnitalSemiring A
inst✝² : Module R A
inst✝¹ : SMulCommClass R A A
inst✝ : IsScalarTower R A A
src✝ : A →ₗ[R] A →ₗ[R] A := mul R A
a b c : A
⊢ ↑(MulActionHom.toFun
          {
              toMulActionHom :=
                { toFun := src✝.toFun,
                  map_smul' :=
                    (_ :
                      ∀ (r : R) (x : A),
                        AddHom.toFun src✝.toAddHom (r • x) = ↑(RingHom.id R) r • AddHom.toFun src✝.toAddHom x) },
              map_zero' :=
                (_ :
                  MulActionHom.toFun
                      { toFun := src✝.toFun,
                        map_smul' :=
                          (_ :
                            ∀ (r : R) (x : A),
                              AddHom.toFun src✝.toAddHom (r • x) = ↑(RingHom.id R) r • AddHom.toFun src✝.toAddHom x) }
                      0 =
                    0),
              map_add' :=
                (_ :
                  ∀ (x y : A),
                    AddHom.toFun src✝.toAddHom (x + y) =
                      AddHom.toFun src✝.toAddHom x + AddHom.toFun src✝.toAddHom y) }.toMulActionHom
          (a * b))
      c =
    ↑(MulActionHom.toFun
            {
                toMulActionHom :=
                  { toFun := src✝.toFun,
                    map_smul' :=
                      (_ :
                        ∀ (r : R) (x : A),
                          AddHom.toFun src✝.toAddHom (r • x) = ↑(RingHom.id R) r • AddHom.toFun src✝.toAddHom x) },
                map_zero' :=
                  (_ :
                    MulActionHom.toFun
                        { toFun := src✝.toFun,
                          map_smul' :=
                            (_ :
                              ∀ (r : R) (x : A),
                                AddHom.toFun src✝.toAddHom (r • x) = ↑(RingHom.id R) r • AddHom.toFun src✝.toAddHom x) }
                        0 =
                      0),
                map_add' :=
                  (_ :
                    ∀ (x y : A),
                      AddHom.toFun src✝.toAddHom (x + y) =
                        AddHom.toFun src✝.toAddHom x + AddHom.toFun src✝.toAddHom y) }.toMulActionHom
            a *
          MulActionHom.toFun
            {
                toMulActionHom :=
                  { toFun := src✝.toFun,
                    map_smul' :=
                      (_ :
                        ∀ (r : R) (x : A),
                          AddHom.toFun src✝.toAddHom (r • x) = ↑(RingHom.id R) r • AddHom.toFun src✝.toAddHom x) },
                map_zero' :=
                  (_ :
                    MulActionHom.toFun
                        { toFun := src✝.toFun,
                          map_smul' :=
                            (_ :
                              ∀ (r : R) (x : A),
                                AddHom.toFun src✝.toAddHom (r • x) = ↑(RingHom.id R) r • AddHom.toFun src✝.toAddHom x) }
                        0 =
                      0),
                map_add' :=
                  (_ :
                    ∀ (x y : A),
                      AddHom.toFun src✝.toAddHom (x + y) =
                        AddHom.toFun src✝.toAddHom x + AddHom.toFun src✝.toAddHom y) }.toMulActionHom
            b)
      c
[PROOFSTEP]
exact mul_assoc a b c
[GOAL]
R : Type u_1
A : Type u_2
inst✝⁴ : CommSemiring R
inst✝³ : NonUnitalSemiring A
inst✝² : Module R A
inst✝¹ : SMulCommClass R A A
inst✝ : IsScalarTower R A A
a b : A
⊢ Commute (mulLeft R a) (mulRight R b)
[PROOFSTEP]
ext c
[GOAL]
case h
R : Type u_1
A : Type u_2
inst✝⁴ : CommSemiring R
inst✝³ : NonUnitalSemiring A
inst✝² : Module R A
inst✝¹ : SMulCommClass R A A
inst✝ : IsScalarTower R A A
a b c : A
⊢ ↑(mulLeft R a * mulRight R b) c = ↑(mulRight R b * mulLeft R a) c
[PROOFSTEP]
exact (mul_assoc a c b).symm
[GOAL]
R : Type u_1
A : Type u_2
inst✝⁴ : CommSemiring R
inst✝³ : NonUnitalSemiring A
inst✝² : Module R A
inst✝¹ : SMulCommClass R A A
inst✝ : IsScalarTower R A A
a b : A
⊢ mulLeft R (a * b) = comp (mulLeft R a) (mulLeft R b)
[PROOFSTEP]
ext
[GOAL]
case h
R : Type u_1
A : Type u_2
inst✝⁴ : CommSemiring R
inst✝³ : NonUnitalSemiring A
inst✝² : Module R A
inst✝¹ : SMulCommClass R A A
inst✝ : IsScalarTower R A A
a b x✝ : A
⊢ ↑(mulLeft R (a * b)) x✝ = ↑(comp (mulLeft R a) (mulLeft R b)) x✝
[PROOFSTEP]
simp only [mulLeft_apply, comp_apply, mul_assoc]
[GOAL]
R : Type u_1
A : Type u_2
inst✝⁴ : CommSemiring R
inst✝³ : NonUnitalSemiring A
inst✝² : Module R A
inst✝¹ : SMulCommClass R A A
inst✝ : IsScalarTower R A A
a b : A
⊢ mulRight R (a * b) = comp (mulRight R b) (mulRight R a)
[PROOFSTEP]
ext
[GOAL]
case h
R : Type u_1
A : Type u_2
inst✝⁴ : CommSemiring R
inst✝³ : NonUnitalSemiring A
inst✝² : Module R A
inst✝¹ : SMulCommClass R A A
inst✝ : IsScalarTower R A A
a b x✝ : A
⊢ ↑(mulRight R (a * b)) x✝ = ↑(comp (mulRight R b) (mulRight R a)) x✝
[PROOFSTEP]
simp only [mulRight_apply, comp_apply, mul_assoc]
[GOAL]
R : Type u_1
A : Type u_2
inst✝² : CommSemiring R
inst✝¹ : Semiring A
inst✝ : Algebra R A
src✝ : A →ₗ[R] A →ₗ[R] A := mul R A
⊢ AddHom.toFun src✝.toAddHom 1 = 1
[PROOFSTEP]
ext a
[GOAL]
case h
R : Type u_1
A : Type u_2
inst✝² : CommSemiring R
inst✝¹ : Semiring A
inst✝ : Algebra R A
src✝ : A →ₗ[R] A →ₗ[R] A := mul R A
a : A
⊢ ↑(AddHom.toFun src✝.toAddHom 1) a = ↑1 a
[PROOFSTEP]
exact one_mul a
[GOAL]
R : Type u_1
A : Type u_2
inst✝² : CommSemiring R
inst✝¹ : Semiring A
inst✝ : Algebra R A
src✝ : A →ₗ[R] A →ₗ[R] A := mul R A
⊢ ∀ (x y : A),
    OneHom.toFun { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) } (x * y) =
      OneHom.toFun { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) } x *
        OneHom.toFun { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) } y
[PROOFSTEP]
intro a b
[GOAL]
R : Type u_1
A : Type u_2
inst✝² : CommSemiring R
inst✝¹ : Semiring A
inst✝ : Algebra R A
src✝ : A →ₗ[R] A →ₗ[R] A := mul R A
a b : A
⊢ OneHom.toFun { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) } (a * b) =
    OneHom.toFun { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) } a *
      OneHom.toFun { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) } b
[PROOFSTEP]
ext c
[GOAL]
case h
R : Type u_1
A : Type u_2
inst✝² : CommSemiring R
inst✝¹ : Semiring A
inst✝ : Algebra R A
src✝ : A →ₗ[R] A →ₗ[R] A := mul R A
a b c : A
⊢ ↑(OneHom.toFun { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) } (a * b)) c =
    ↑(OneHom.toFun { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) } a *
          OneHom.toFun { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) } b)
      c
[PROOFSTEP]
exact mul_assoc a b c
[GOAL]
R : Type u_1
A : Type u_2
inst✝² : CommSemiring R
inst✝¹ : Semiring A
inst✝ : Algebra R A
src✝ : A →ₗ[R] A →ₗ[R] A := mul R A
⊢ OneHom.toFun
      (↑{ toOneHom := { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) },
          map_mul' :=
            (_ :
              ∀ (a b : A),
                OneHom.toFun { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) } (a * b) =
                  OneHom.toFun { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) } a *
                    OneHom.toFun { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) } b) })
      0 =
    0
[PROOFSTEP]
ext a
[GOAL]
case h
R : Type u_1
A : Type u_2
inst✝² : CommSemiring R
inst✝¹ : Semiring A
inst✝ : Algebra R A
src✝ : A →ₗ[R] A →ₗ[R] A := mul R A
a : A
⊢ ↑(OneHom.toFun
          (↑{ toOneHom := { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) },
              map_mul' :=
                (_ :
                  ∀ (a b : A),
                    OneHom.toFun { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) } (a * b) =
                      OneHom.toFun { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) } a *
                        OneHom.toFun { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) } b) })
          0)
      a =
    ↑0 a
[PROOFSTEP]
exact zero_mul a
[GOAL]
R : Type u_1
A : Type u_2
inst✝² : CommSemiring R
inst✝¹ : Semiring A
inst✝ : Algebra R A
src✝ : A →ₗ[R] A →ₗ[R] A := mul R A
⊢ ∀ (r : R),
    OneHom.toFun
        (↑↑{
              toMonoidHom :=
                { toOneHom := { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) },
                  map_mul' :=
                    (_ :
                      ∀ (a b : A),
                        OneHom.toFun { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) }
                            (a * b) =
                          OneHom.toFun { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) } a *
                            OneHom.toFun { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) }
                              b) },
              map_zero' :=
                (_ :
                  OneHom.toFun
                      (↑{ toOneHom := { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) },
                          map_mul' :=
                            (_ :
                              ∀ (a b : A),
                                OneHom.toFun { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) }
                                    (a * b) =
                                  OneHom.toFun
                                      { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) } a *
                                    OneHom.toFun
                                      { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) } b) })
                      0 =
                    0),
              map_add' :=
                (_ :
                  ∀ (x y : A),
                    AddHom.toFun src✝.toAddHom (x + y) = AddHom.toFun src✝.toAddHom x + AddHom.toFun src✝.toAddHom y) })
        (↑(algebraMap R A) r) =
      ↑(algebraMap R (End R A)) r
[PROOFSTEP]
intro r
[GOAL]
R : Type u_1
A : Type u_2
inst✝² : CommSemiring R
inst✝¹ : Semiring A
inst✝ : Algebra R A
src✝ : A →ₗ[R] A →ₗ[R] A := mul R A
r : R
⊢ OneHom.toFun
      (↑↑{
            toMonoidHom :=
              { toOneHom := { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) },
                map_mul' :=
                  (_ :
                    ∀ (a b : A),
                      OneHom.toFun { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) } (a * b) =
                        OneHom.toFun { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) } a *
                          OneHom.toFun { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) } b) },
            map_zero' :=
              (_ :
                OneHom.toFun
                    (↑{ toOneHom := { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) },
                        map_mul' :=
                          (_ :
                            ∀ (a b : A),
                              OneHom.toFun { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) }
                                  (a * b) =
                                OneHom.toFun { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) }
                                    a *
                                  OneHom.toFun
                                    { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) } b) })
                    0 =
                  0),
            map_add' :=
              (_ :
                ∀ (x y : A),
                  AddHom.toFun src✝.toAddHom (x + y) = AddHom.toFun src✝.toAddHom x + AddHom.toFun src✝.toAddHom y) })
      (↑(algebraMap R A) r) =
    ↑(algebraMap R (End R A)) r
[PROOFSTEP]
ext a
[GOAL]
case h
R : Type u_1
A : Type u_2
inst✝² : CommSemiring R
inst✝¹ : Semiring A
inst✝ : Algebra R A
src✝ : A →ₗ[R] A →ₗ[R] A := mul R A
r : R
a : A
⊢ ↑(OneHom.toFun
          (↑↑{
                toMonoidHom :=
                  { toOneHom := { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) },
                    map_mul' :=
                      (_ :
                        ∀ (a b : A),
                          OneHom.toFun { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) }
                              (a * b) =
                            OneHom.toFun { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) } a *
                              OneHom.toFun { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) }
                                b) },
                map_zero' :=
                  (_ :
                    OneHom.toFun
                        (↑{ toOneHom := { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) },
                            map_mul' :=
                              (_ :
                                ∀ (a b : A),
                                  OneHom.toFun
                                      { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) }
                                      (a * b) =
                                    OneHom.toFun
                                        { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) } a *
                                      OneHom.toFun
                                        { toFun := src✝.toFun, map_one' := (_ : AddHom.toFun src✝.toAddHom 1 = 1) }
                                        b) })
                        0 =
                      0),
                map_add' :=
                  (_ :
                    ∀ (x y : A),
                      AddHom.toFun src✝.toAddHom (x + y) =
                        AddHom.toFun src✝.toAddHom x + AddHom.toFun src✝.toAddHom y) })
          (↑(algebraMap R A) r))
      a =
    ↑(↑(algebraMap R (End R A)) r) a
[PROOFSTEP]
exact (Algebra.smul_def r a).symm
[GOAL]
R : Type u_1
A : Type u_2
inst✝² : CommSemiring R
inst✝¹ : Semiring A
inst✝ : Algebra R A
a : A
⊢ mulLeft R a = 0 ↔ a = 0
[PROOFSTEP]
constructor
[GOAL]
case mp
R : Type u_1
A : Type u_2
inst✝² : CommSemiring R
inst✝¹ : Semiring A
inst✝ : Algebra R A
a : A
⊢ mulLeft R a = 0 → a = 0
[PROOFSTEP]
intro h
[GOAL]
case mpr
R : Type u_1
A : Type u_2
inst✝² : CommSemiring R
inst✝¹ : Semiring A
inst✝ : Algebra R A
a : A
⊢ a = 0 → mulLeft R a = 0
[PROOFSTEP]
intro h
[GOAL]
case mp
R : Type u_1
A : Type u_2
inst✝² : CommSemiring R
inst✝¹ : Semiring A
inst✝ : Algebra R A
a : A
h : mulLeft R a = 0
⊢ a = 0
[PROOFSTEP]
rw [← mul_one a, ← @mulLeft_apply R _ _ _ _ _ _ a 1, h, LinearMap.zero_apply]
[GOAL]
case mpr
R : Type u_1
A : Type u_2
inst✝² : CommSemiring R
inst✝¹ : Semiring A
inst✝ : Algebra R A
a : A
h : a = 0
⊢ mulLeft R a = 0
[PROOFSTEP]
rw [h]
[GOAL]
case mpr
R : Type u_1
A : Type u_2
inst✝² : CommSemiring R
inst✝¹ : Semiring A
inst✝ : Algebra R A
a : A
h : a = 0
⊢ mulLeft R 0 = 0
[PROOFSTEP]
exact mulLeft_zero_eq_zero
[GOAL]
R : Type u_1
A : Type u_2
inst✝² : CommSemiring R
inst✝¹ : Semiring A
inst✝ : Algebra R A
a : A
⊢ mulRight R a = 0 ↔ a = 0
[PROOFSTEP]
constructor
[GOAL]
case mp
R : Type u_1
A : Type u_2
inst✝² : CommSemiring R
inst✝¹ : Semiring A
inst✝ : Algebra R A
a : A
⊢ mulRight R a = 0 → a = 0
[PROOFSTEP]
intro h
[GOAL]
case mpr
R : Type u_1
A : Type u_2
inst✝² : CommSemiring R
inst✝¹ : Semiring A
inst✝ : Algebra R A
a : A
⊢ a = 0 → mulRight R a = 0
[PROOFSTEP]
intro h
[GOAL]
case mp
R : Type u_1
A : Type u_2
inst✝² : CommSemiring R
inst✝¹ : Semiring A
inst✝ : Algebra R A
a : A
h : mulRight R a = 0
⊢ a = 0
[PROOFSTEP]
rw [← one_mul a, ← @mulRight_apply R _ _ _ _ _ _ a 1, h, LinearMap.zero_apply]
[GOAL]
case mpr
R : Type u_1
A : Type u_2
inst✝² : CommSemiring R
inst✝¹ : Semiring A
inst✝ : Algebra R A
a : A
h : a = 0
⊢ mulRight R a = 0
[PROOFSTEP]
rw [h]
[GOAL]
case mpr
R : Type u_1
A : Type u_2
inst✝² : CommSemiring R
inst✝¹ : Semiring A
inst✝ : Algebra R A
a : A
h : a = 0
⊢ mulRight R 0 = 0
[PROOFSTEP]
exact mulRight_zero_eq_zero
[GOAL]
R : Type u_1
A : Type u_2
inst✝² : CommSemiring R
inst✝¹ : Semiring A
inst✝ : Algebra R A
⊢ mulLeft R 1 = id
[PROOFSTEP]
ext
[GOAL]
case h
R : Type u_1
A : Type u_2
inst✝² : CommSemiring R
inst✝¹ : Semiring A
inst✝ : Algebra R A
x✝ : A
⊢ ↑(mulLeft R 1) x✝ = ↑id x✝
[PROOFSTEP]
simp only [LinearMap.id_coe, one_mul, id.def, mulLeft_apply]
[GOAL]
R : Type u_1
A : Type u_2
inst✝² : CommSemiring R
inst✝¹ : Semiring A
inst✝ : Algebra R A
⊢ mulRight R 1 = id
[PROOFSTEP]
ext
[GOAL]
case h
R : Type u_1
A : Type u_2
inst✝² : CommSemiring R
inst✝¹ : Semiring A
inst✝ : Algebra R A
x✝ : A
⊢ ↑(mulRight R 1) x✝ = ↑id x✝
[PROOFSTEP]
simp only [LinearMap.id_coe, mul_one, id.def, mulRight_apply]
[GOAL]
R : Type u_1
A : Type u_2
inst✝² : CommSemiring R
inst✝¹ : Semiring A
inst✝ : Algebra R A
a : A
n : ℕ
⊢ mulLeft R a ^ n = mulLeft R (a ^ n)
[PROOFSTEP]
simpa only [mulLeft, ← Algebra.coe_lmul_eq_mul] using ((Algebra.lmul R A).map_pow a n).symm
[GOAL]
R : Type u_1
A : Type u_2
inst✝² : CommSemiring R
inst✝¹ : Semiring A
inst✝ : Algebra R A
a : A
n : ℕ
⊢ mulRight R a ^ n = mulRight R (a ^ n)
[PROOFSTEP]
simp only [mulRight, ← Algebra.coe_lmul_eq_mul]
[GOAL]
R : Type u_1
A : Type u_2
inst✝² : CommSemiring R
inst✝¹ : Semiring A
inst✝ : Algebra R A
a : A
n : ℕ
⊢ ↑(flip (mul R A)) a ^ n = ↑(flip (mul R A)) (a ^ n)
[PROOFSTEP]
exact LinearMap.coe_injective (((mulRight R a).coe_pow n).symm ▸ mul_right_iterate a n)
[GOAL]
R : Type u_1
A : Type u_2
inst✝³ : CommSemiring R
inst✝² : Ring A
inst✝¹ : Algebra R A
inst✝ : NoZeroDivisors A
x : A
hx : x ≠ 0
⊢ Function.Injective ↑(mulLeft R x)
[PROOFSTEP]
letI : Nontrivial A := ⟨⟨x, 0, hx⟩⟩
[GOAL]
R : Type u_1
A : Type u_2
inst✝³ : CommSemiring R
inst✝² : Ring A
inst✝¹ : Algebra R A
inst✝ : NoZeroDivisors A
x : A
hx : x ≠ 0
this : Nontrivial A := { exists_pair_ne := Exists.intro x (Exists.intro 0 hx) }
⊢ Function.Injective ↑(mulLeft R x)
[PROOFSTEP]
letI := NoZeroDivisors.to_isDomain A
[GOAL]
R : Type u_1
A : Type u_2
inst✝³ : CommSemiring R
inst✝² : Ring A
inst✝¹ : Algebra R A
inst✝ : NoZeroDivisors A
x : A
hx : x ≠ 0
this✝ : Nontrivial A := { exists_pair_ne := Exists.intro x (Exists.intro 0 hx) }
this : IsDomain A := NoZeroDivisors.to_isDomain A
⊢ Function.Injective ↑(mulLeft R x)
[PROOFSTEP]
exact mul_right_injective₀ hx
[GOAL]
R : Type u_1
A : Type u_2
inst✝³ : CommSemiring R
inst✝² : Ring A
inst✝¹ : Algebra R A
inst✝ : NoZeroDivisors A
x : A
hx : x ≠ 0
⊢ Function.Injective ↑(mulRight R x)
[PROOFSTEP]
letI : Nontrivial A := ⟨⟨x, 0, hx⟩⟩
[GOAL]
R : Type u_1
A : Type u_2
inst✝³ : CommSemiring R
inst✝² : Ring A
inst✝¹ : Algebra R A
inst✝ : NoZeroDivisors A
x : A
hx : x ≠ 0
this : Nontrivial A := { exists_pair_ne := Exists.intro x (Exists.intro 0 hx) }
⊢ Function.Injective ↑(mulRight R x)
[PROOFSTEP]
letI := NoZeroDivisors.to_isDomain A
[GOAL]
R : Type u_1
A : Type u_2
inst✝³ : CommSemiring R
inst✝² : Ring A
inst✝¹ : Algebra R A
inst✝ : NoZeroDivisors A
x : A
hx : x ≠ 0
this✝ : Nontrivial A := { exists_pair_ne := Exists.intro x (Exists.intro 0 hx) }
this : IsDomain A := NoZeroDivisors.to_isDomain A
⊢ Function.Injective ↑(mulRight R x)
[PROOFSTEP]
exact mul_left_injective₀ hx
[GOAL]
R : Type u_1
A : Type u_2
inst✝³ : CommSemiring R
inst✝² : Ring A
inst✝¹ : Algebra R A
inst✝ : NoZeroDivisors A
x : A
hx : x ≠ 0
⊢ Function.Injective ↑(↑(mul R A) x)
[PROOFSTEP]
letI : Nontrivial A := ⟨⟨x, 0, hx⟩⟩
[GOAL]
R : Type u_1
A : Type u_2
inst✝³ : CommSemiring R
inst✝² : Ring A
inst✝¹ : Algebra R A
inst✝ : NoZeroDivisors A
x : A
hx : x ≠ 0
this : Nontrivial A := { exists_pair_ne := Exists.intro x (Exists.intro 0 hx) }
⊢ Function.Injective ↑(↑(mul R A) x)
[PROOFSTEP]
letI := NoZeroDivisors.to_isDomain A
[GOAL]
R : Type u_1
A : Type u_2
inst✝³ : CommSemiring R
inst✝² : Ring A
inst✝¹ : Algebra R A
inst✝ : NoZeroDivisors A
x : A
hx : x ≠ 0
this✝ : Nontrivial A := { exists_pair_ne := Exists.intro x (Exists.intro 0 hx) }
this : IsDomain A := NoZeroDivisors.to_isDomain A
⊢ Function.Injective ↑(↑(mul R A) x)
[PROOFSTEP]
exact mul_right_injective₀ hx


[GOAL]
R : Type u
B : Type v
inst✝² : CommRing R
inst✝¹ : DecidableEq B
inst✝ : Fintype B
A : Matrix B B ℤ
i : B
h : A i i = 2
⊢ adE R A (i, i) = 0
[PROOFSTEP]
have h' : (-2 : ℤ).toNat = 0 := by rfl
[GOAL]
R : Type u
B : Type v
inst✝² : CommRing R
inst✝¹ : DecidableEq B
inst✝ : Fintype B
A : Matrix B B ℤ
i : B
h : A i i = 2
⊢ Int.toNat (-2) = 0
[PROOFSTEP]
rfl
[GOAL]
R : Type u
B : Type v
inst✝² : CommRing R
inst✝¹ : DecidableEq B
inst✝ : Fintype B
A : Matrix B B ℤ
i : B
h : A i i = 2
h' : Int.toNat (-2) = 0
⊢ adE R A (i, i) = 0
[PROOFSTEP]
simp [adE, h, h']
[GOAL]
R : Type u
B : Type v
inst✝² : CommRing R
inst✝¹ : DecidableEq B
inst✝ : Fintype B
A : Matrix B B ℤ
i : B
h : A i i = 2
⊢ adF R A (i, i) = 0
[PROOFSTEP]
have h' : (-2 : ℤ).toNat = 0 := by rfl
[GOAL]
R : Type u
B : Type v
inst✝² : CommRing R
inst✝¹ : DecidableEq B
inst✝ : Fintype B
A : Matrix B B ℤ
i : B
h : A i i = 2
⊢ Int.toNat (-2) = 0
[PROOFSTEP]
rfl
[GOAL]
R : Type u
B : Type v
inst✝² : CommRing R
inst✝¹ : DecidableEq B
inst✝ : Fintype B
A : Matrix B B ℤ
i : B
h : A i i = 2
h' : Int.toNat (-2) = 0
⊢ adF R A (i, i) = 0
[PROOFSTEP]
simp [adF, h, h']


[GOAL]
𝕜 : Type u_1
R : Type u_2
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedCommRing R
inst✝³ : NormedAlgebra 𝕜 R
inst✝² : TopologicalRing R
inst✝¹ : CompleteSpace R
inst✝ : T2Space R
r : R
⊢ exp 𝕜 (r • ε) = ↑1 + r • ε
[PROOFSTEP]
rw [eps, ← inr_smul, exp_inr, Nat.cast_one]


[GOAL]
x y : ℝ
hx : 0 < x
⊢ log x = ↑(OrderIso.symm expOrderIso) { val := x, property := hx }
[PROOFSTEP]
rw [log_of_ne_zero hx.ne']
[GOAL]
x y : ℝ
hx : 0 < x
⊢ ↑(OrderIso.symm expOrderIso) { val := |x|, property := (_ : 0 < |x|) } =
    ↑(OrderIso.symm expOrderIso) { val := x, property := hx }
[PROOFSTEP]
congr
[GOAL]
case h.e_6.h.e_val
x y : ℝ
hx : 0 < x
⊢ |x| = x
[PROOFSTEP]
exact abs_of_pos hx
[GOAL]
x y : ℝ
hx : x ≠ 0
⊢ exp (log x) = |x|
[PROOFSTEP]
rw [log_of_ne_zero hx, ← coe_expOrderIso_apply, OrderIso.apply_symm_apply, Subtype.coe_mk]
[GOAL]
x y : ℝ
hx : 0 < x
⊢ exp (log x) = x
[PROOFSTEP]
rw [exp_log_eq_abs hx.ne']
[GOAL]
x y : ℝ
hx : 0 < x
⊢ |x| = x
[PROOFSTEP]
exact abs_of_pos hx
[GOAL]
x y : ℝ
hx : x < 0
⊢ exp (log x) = -x
[PROOFSTEP]
rw [exp_log_eq_abs (ne_of_lt hx)]
[GOAL]
x y : ℝ
hx : x < 0
⊢ |x| = -x
[PROOFSTEP]
exact abs_of_neg hx
[GOAL]
x✝ y x : ℝ
⊢ x ≤ exp (log x)
[PROOFSTEP]
by_cases h_zero : x = 0
[GOAL]
case pos
x✝ y x : ℝ
h_zero : x = 0
⊢ x ≤ exp (log x)
[PROOFSTEP]
rw [h_zero, log, dif_pos rfl, exp_zero]
[GOAL]
case pos
x✝ y x : ℝ
h_zero : x = 0
⊢ 0 ≤ 1
[PROOFSTEP]
exact zero_le_one
[GOAL]
case neg
x✝ y x : ℝ
h_zero : ¬x = 0
⊢ x ≤ exp (log x)
[PROOFSTEP]
rw [exp_log_eq_abs h_zero]
[GOAL]
case neg
x✝ y x : ℝ
h_zero : ¬x = 0
⊢ x ≤ |x|
[PROOFSTEP]
exact le_abs_self _
[GOAL]
x y : ℝ
⊢ exp (log 1) = exp 0
[PROOFSTEP]
rw [exp_log zero_lt_one, exp_zero]
[GOAL]
x✝ y x : ℝ
⊢ log |x| = log x
[PROOFSTEP]
by_cases h : x = 0
[GOAL]
case pos
x✝ y x : ℝ
h : x = 0
⊢ log |x| = log x
[PROOFSTEP]
simp [h]
[GOAL]
case neg
x✝ y x : ℝ
h : ¬x = 0
⊢ log |x| = log x
[PROOFSTEP]
rw [← exp_eq_exp, exp_log_eq_abs h, exp_log_eq_abs (abs_pos.2 h).ne', abs_abs]
[GOAL]
x✝ y x : ℝ
⊢ log (-x) = log x
[PROOFSTEP]
rw [← log_abs x, ← log_abs (-x), abs_neg]
[GOAL]
x✝ y x : ℝ
hx : 0 < x
⊢ sinh (log x) = (x - x⁻¹) / 2
[PROOFSTEP]
rw [sinh_eq, exp_neg, exp_log hx]
[GOAL]
x✝ y x : ℝ
hx : 0 < x
⊢ cosh (log x) = (x + x⁻¹) / 2
[PROOFSTEP]
rw [cosh_eq, exp_neg, exp_log hx]
[GOAL]
x✝¹ y x : ℝ
x✝ : x ∈ univ
⊢ log (-exp x) = x
[PROOFSTEP]
rw [log_neg_eq_log, log_exp]
[GOAL]
x y : ℝ
hx : x ≠ 0
hy : y ≠ 0
⊢ exp (log (x * y)) = exp (log x + log y)
[PROOFSTEP]
rw [exp_log_eq_abs (mul_ne_zero hx hy), exp_add, exp_log_eq_abs hx, exp_log_eq_abs hy, abs_mul]
[GOAL]
x y : ℝ
hx : x ≠ 0
hy : y ≠ 0
⊢ exp (log (x / y)) = exp (log x - log y)
[PROOFSTEP]
rw [exp_log_eq_abs (div_ne_zero hx hy), exp_sub, exp_log_eq_abs hx, exp_log_eq_abs hy, abs_div]
[GOAL]
x✝ y x : ℝ
⊢ log x⁻¹ = -log x
[PROOFSTEP]
by_cases hx : x = 0
[GOAL]
case pos
x✝ y x : ℝ
hx : x = 0
⊢ log x⁻¹ = -log x
[PROOFSTEP]
simp [hx]
[GOAL]
case neg
x✝ y x : ℝ
hx : ¬x = 0
⊢ log x⁻¹ = -log x
[PROOFSTEP]
rw [← exp_eq_exp, exp_log_eq_abs (inv_ne_zero hx), exp_neg, exp_log_eq_abs hx, abs_inv]
[GOAL]
x y : ℝ
h : 0 < x
h₁ : 0 < y
⊢ log x ≤ log y ↔ x ≤ y
[PROOFSTEP]
rw [← exp_le_exp, exp_log h, exp_log h₁]
[GOAL]
x y : ℝ
hx : 0 < x
⊢ x < y → log x < log y
[PROOFSTEP]
intro h
[GOAL]
x y : ℝ
hx : 0 < x
h : x < y
⊢ log x < log y
[PROOFSTEP]
rwa [← exp_lt_exp, exp_log hx, exp_log (lt_trans hx h)]
[GOAL]
x y : ℝ
hx : 0 < x
⊢ x ≤ y → log x ≤ log y
[PROOFSTEP]
intro hxy
[GOAL]
x y : ℝ
hx : 0 < x
hxy : x ≤ y
⊢ log x ≤ log y
[PROOFSTEP]
cases hxy.eq_or_lt with
| inl h_eq => simp [h_eq]
| inr hlt => exact le_of_lt <| log_lt_log hx hlt
[GOAL]
x y : ℝ
hx : 0 < x
hxy : x ≤ y
x✝ : x = y ∨ x < y
⊢ log x ≤ log y
[PROOFSTEP]
cases hxy.eq_or_lt with
| inl h_eq => simp [h_eq]
| inr hlt => exact le_of_lt <| log_lt_log hx hlt
[GOAL]
case inl
x y : ℝ
hx : 0 < x
hxy : x ≤ y
h_eq : x = y
⊢ log x ≤ log y
[PROOFSTEP]

| inl h_eq => simp [h_eq]
[GOAL]
case inl
x y : ℝ
hx : 0 < x
hxy : x ≤ y
h_eq : x = y
⊢ log x ≤ log y
[PROOFSTEP]
simp [h_eq]
[GOAL]
case inr
x y : ℝ
hx : 0 < x
hxy : x ≤ y
hlt : x < y
⊢ log x ≤ log y
[PROOFSTEP]

| inr hlt => exact le_of_lt <| log_lt_log hx hlt
[GOAL]
case inr
x y : ℝ
hx : 0 < x
hxy : x ≤ y
hlt : x < y
⊢ log x ≤ log y
[PROOFSTEP]
exact le_of_lt <| log_lt_log hx hlt
[GOAL]
x y : ℝ
hx : 0 < x
hy : 0 < y
⊢ log x < log y ↔ x < y
[PROOFSTEP]
rw [← exp_lt_exp, exp_log hx, exp_log hy]
[GOAL]
x y : ℝ
hx : 0 < x
⊢ log x ≤ y ↔ x ≤ exp y
[PROOFSTEP]
rw [← exp_le_exp, exp_log hx]
[GOAL]
x y : ℝ
hx : 0 < x
⊢ log x < y ↔ x < exp y
[PROOFSTEP]
rw [← exp_lt_exp, exp_log hx]
[GOAL]
x y : ℝ
hy : 0 < y
⊢ x ≤ log y ↔ exp x ≤ y
[PROOFSTEP]
rw [← exp_le_exp, exp_log hy]
[GOAL]
x y : ℝ
hy : 0 < y
⊢ x < log y ↔ exp x < y
[PROOFSTEP]
rw [← exp_lt_exp, exp_log hy]
[GOAL]
x y : ℝ
hx : 0 < x
⊢ 0 < log x ↔ 1 < x
[PROOFSTEP]
rw [← log_one]
[GOAL]
x y : ℝ
hx : 0 < x
⊢ log 1 < log x ↔ 1 < x
[PROOFSTEP]
exact log_lt_log_iff zero_lt_one hx
[GOAL]
x y : ℝ
hx : x < -1
⊢ 0 < log x
[PROOFSTEP]
rw [← neg_neg x, log_neg_eq_log]
[GOAL]
x y : ℝ
hx : x < -1
⊢ 0 < log (-x)
[PROOFSTEP]
have : 1 < -x := by linarith
[GOAL]
x y : ℝ
hx : x < -1
⊢ 1 < -x
[PROOFSTEP]
linarith
[GOAL]
x y : ℝ
hx : x < -1
this : 1 < -x
⊢ 0 < log (-x)
[PROOFSTEP]
exact log_pos this
[GOAL]
x y : ℝ
h : 0 < x
⊢ log x < 0 ↔ x < 1
[PROOFSTEP]
rw [← log_one]
[GOAL]
x y : ℝ
h : 0 < x
⊢ log x < log 1 ↔ x < 1
[PROOFSTEP]
exact log_lt_log_iff h zero_lt_one
[GOAL]
x y : ℝ
h0 : x < 0
h1 : -1 < x
⊢ log x < 0
[PROOFSTEP]
rw [← neg_neg x, log_neg_eq_log]
[GOAL]
x y : ℝ
h0 : x < 0
h1 : -1 < x
⊢ log (-x) < 0
[PROOFSTEP]
have h0' : 0 < -x := by linarith
[GOAL]
x y : ℝ
h0 : x < 0
h1 : -1 < x
⊢ 0 < -x
[PROOFSTEP]
linarith
[GOAL]
x y : ℝ
h0 : x < 0
h1 : -1 < x
h0' : 0 < -x
⊢ log (-x) < 0
[PROOFSTEP]
have h1' : -x < 1 := by linarith
[GOAL]
x y : ℝ
h0 : x < 0
h1 : -1 < x
h0' : 0 < -x
⊢ -x < 1
[PROOFSTEP]
linarith
[GOAL]
x y : ℝ
h0 : x < 0
h1 : -1 < x
h0' : 0 < -x
h1' : -x < 1
⊢ log (-x) < 0
[PROOFSTEP]
exact log_neg h0' h1'
[GOAL]
x y : ℝ
hx : 0 < x
⊢ 0 ≤ log x ↔ 1 ≤ x
[PROOFSTEP]
rw [← not_lt, log_neg_iff hx, not_lt]
[GOAL]
x y : ℝ
hx : 0 < x
⊢ log x ≤ 0 ↔ x ≤ 1
[PROOFSTEP]
rw [← not_lt, log_pos_iff hx, not_lt]
[GOAL]
x y : ℝ
hx : 0 ≤ x
⊢ log x ≤ 0 ↔ x ≤ 1
[PROOFSTEP]
rcases hx.eq_or_lt with (rfl | hx)
[GOAL]
case inl
y : ℝ
hx : 0 ≤ 0
⊢ log 0 ≤ 0 ↔ 0 ≤ 1
[PROOFSTEP]
simp [le_refl, zero_le_one]
[GOAL]
case inr
x y : ℝ
hx✝ : 0 ≤ x
hx : 0 < x
⊢ log x ≤ 0 ↔ x ≤ 1
[PROOFSTEP]
exact log_nonpos_iff hx
[GOAL]
x y : ℝ
n : ℕ
⊢ 0 ≤ log ↑n
[PROOFSTEP]
by_cases hn : n = 0
[GOAL]
case pos
x y : ℝ
n : ℕ
hn : n = 0
⊢ 0 ≤ log ↑n
case neg x y : ℝ n : ℕ hn : ¬n = 0 ⊢ 0 ≤ log ↑n
[PROOFSTEP]
case pos => simp [hn]
[GOAL]
x y : ℝ
n : ℕ
hn : n = 0
⊢ 0 ≤ log ↑n
[PROOFSTEP]
case pos => simp [hn]
[GOAL]
x y : ℝ
n : ℕ
hn : n = 0
⊢ 0 ≤ log ↑n
[PROOFSTEP]
simp [hn]
[GOAL]
case neg
x y : ℝ
n : ℕ
hn : ¬n = 0
⊢ 0 ≤ log ↑n
[PROOFSTEP]
case neg =>
  have : (1 : ℝ) ≤ n := by exact_mod_cast Nat.one_le_of_lt <| Nat.pos_of_ne_zero hn
  exact log_nonneg this
[GOAL]
x y : ℝ
n : ℕ
hn : ¬n = 0
⊢ 0 ≤ log ↑n
[PROOFSTEP]
case neg =>
  have : (1 : ℝ) ≤ n := by exact_mod_cast Nat.one_le_of_lt <| Nat.pos_of_ne_zero hn
  exact log_nonneg this
[GOAL]
x y : ℝ
n : ℕ
hn : ¬n = 0
⊢ 0 ≤ log ↑n
[PROOFSTEP]
have : (1 : ℝ) ≤ n := by exact_mod_cast Nat.one_le_of_lt <| Nat.pos_of_ne_zero hn
[GOAL]
x y : ℝ
n : ℕ
hn : ¬n = 0
⊢ 1 ≤ ↑n
[PROOFSTEP]
exact_mod_cast Nat.one_le_of_lt <| Nat.pos_of_ne_zero hn
[GOAL]
x y : ℝ
n : ℕ
hn : ¬n = 0
this : 1 ≤ ↑n
⊢ 0 ≤ log ↑n
[PROOFSTEP]
exact log_nonneg this
[GOAL]
x y : ℝ
n : ℕ
⊢ 0 ≤ log (-↑n)
[PROOFSTEP]
rw [← log_neg_eq_log, neg_neg]
[GOAL]
x y : ℝ
n : ℕ
⊢ 0 ≤ log ↑n
[PROOFSTEP]
exact log_nat_cast_nonneg _
[GOAL]
x y : ℝ
n : ℤ
⊢ 0 ≤ log ↑n
[PROOFSTEP]
cases lt_trichotomy 0 n with
| inl hn =>
  have : (1 : ℝ) ≤ n := by exact_mod_cast hn
  exact log_nonneg this
| inr hn =>
  cases hn with
  | inl hn => simp [hn.symm]
  | inr hn =>
    have : (1 : ℝ) ≤ -n := by rw [← neg_zero, ← lt_neg] at hn ; exact_mod_cast hn
    rw [← log_neg_eq_log]
    exact log_nonneg this
[GOAL]
x y : ℝ
n : ℤ
x✝ : 0 < n ∨ 0 = n ∨ n < 0
⊢ 0 ≤ log ↑n
[PROOFSTEP]
cases lt_trichotomy 0 n with
| inl hn =>
  have : (1 : ℝ) ≤ n := by exact_mod_cast hn
  exact log_nonneg this
| inr hn =>
  cases hn with
  | inl hn => simp [hn.symm]
  | inr hn =>
    have : (1 : ℝ) ≤ -n := by rw [← neg_zero, ← lt_neg] at hn ; exact_mod_cast hn
    rw [← log_neg_eq_log]
    exact log_nonneg this
[GOAL]
case inl
x y : ℝ
n : ℤ
hn : 0 < n
⊢ 0 ≤ log ↑n
[PROOFSTEP]

| inl hn =>
  have : (1 : ℝ) ≤ n := by exact_mod_cast hn
  exact log_nonneg this
[GOAL]
case inl
x y : ℝ
n : ℤ
hn : 0 < n
⊢ 0 ≤ log ↑n
[PROOFSTEP]
have : (1 : ℝ) ≤ n := by exact_mod_cast hn
[GOAL]
x y : ℝ
n : ℤ
hn : 0 < n
⊢ 1 ≤ ↑n
[PROOFSTEP]
exact_mod_cast hn
[GOAL]
case inl
x y : ℝ
n : ℤ
hn : 0 < n
this : 1 ≤ ↑n
⊢ 0 ≤ log ↑n
[PROOFSTEP]
exact log_nonneg this
[GOAL]
case inr
x y : ℝ
n : ℤ
hn : 0 = n ∨ n < 0
⊢ 0 ≤ log ↑n
[PROOFSTEP]

| inr hn =>
  cases hn with
  | inl hn => simp [hn.symm]
  | inr hn =>
    have : (1 : ℝ) ≤ -n := by rw [← neg_zero, ← lt_neg] at hn ; exact_mod_cast hn
    rw [← log_neg_eq_log]
    exact log_nonneg this
[GOAL]
case inr
x y : ℝ
n : ℤ
hn : 0 = n ∨ n < 0
⊢ 0 ≤ log ↑n
[PROOFSTEP]
cases hn with
| inl hn => simp [hn.symm]
| inr hn =>
  have : (1 : ℝ) ≤ -n := by rw [← neg_zero, ← lt_neg] at hn ; exact_mod_cast hn
  rw [← log_neg_eq_log]
  exact log_nonneg this
[GOAL]
case inr
x y : ℝ
n : ℤ
hn : 0 = n ∨ n < 0
⊢ 0 ≤ log ↑n
[PROOFSTEP]
cases hn with
| inl hn => simp [hn.symm]
| inr hn =>
  have : (1 : ℝ) ≤ -n := by rw [← neg_zero, ← lt_neg] at hn ; exact_mod_cast hn
  rw [← log_neg_eq_log]
  exact log_nonneg this
[GOAL]
case inr.inl
x y : ℝ
n : ℤ
hn : 0 = n
⊢ 0 ≤ log ↑n
[PROOFSTEP]

| inl hn => simp [hn.symm]
[GOAL]
case inr.inl
x y : ℝ
n : ℤ
hn : 0 = n
⊢ 0 ≤ log ↑n
[PROOFSTEP]
simp [hn.symm]
[GOAL]
case inr.inr
x y : ℝ
n : ℤ
hn : n < 0
⊢ 0 ≤ log ↑n
[PROOFSTEP]

| inr hn =>
  have : (1 : ℝ) ≤ -n := by rw [← neg_zero, ← lt_neg] at hn ; exact_mod_cast hn
  rw [← log_neg_eq_log]
  exact log_nonneg this
[GOAL]
case inr.inr
x y : ℝ
n : ℤ
hn : n < 0
⊢ 0 ≤ log ↑n
[PROOFSTEP]
have : (1 : ℝ) ≤ -n := by rw [← neg_zero, ← lt_neg] at hn ; exact_mod_cast hn
[GOAL]
x y : ℝ
n : ℤ
hn : n < 0
⊢ 1 ≤ -↑n
[PROOFSTEP]
rw [← neg_zero, ← lt_neg] at hn
[GOAL]
x y : ℝ
n : ℤ
hn : 0 < -n
⊢ 1 ≤ -↑n
[PROOFSTEP]
exact_mod_cast hn
[GOAL]
case inr.inr
x y : ℝ
n : ℤ
hn : n < 0
this : 1 ≤ -↑n
⊢ 0 ≤ log ↑n
[PROOFSTEP]
rw [← log_neg_eq_log]
[GOAL]
case inr.inr
x y : ℝ
n : ℤ
hn : n < 0
this : 1 ≤ -↑n
⊢ 0 ≤ log (-↑n)
[PROOFSTEP]
exact log_nonneg this
[GOAL]
x y : ℝ
⊢ StrictAntiOn log (Iio 0)
[PROOFSTEP]
rintro x (hx : x < 0) y (hy : y < 0) hxy
[GOAL]
x✝ y✝ x : ℝ
hx : x < 0
y : ℝ
hy : y < 0
hxy : x < y
⊢ log y < log x
[PROOFSTEP]
rw [← log_abs y, ← log_abs x]
[GOAL]
x✝ y✝ x : ℝ
hx : x < 0
y : ℝ
hy : y < 0
hxy : x < y
⊢ log |y| < log |x|
[PROOFSTEP]
refine' log_lt_log (abs_pos.2 hy.ne) _
[GOAL]
x✝ y✝ x : ℝ
hx : x < 0
y : ℝ
hy : y < 0
hxy : x < y
⊢ |y| < |x|
[PROOFSTEP]
rwa [abs_of_neg hy, abs_of_neg hx, neg_lt_neg_iff]
[GOAL]
x y : ℝ
hx1 : 0 < x
hx2 : x ≠ 1
⊢ log x < x - 1
[PROOFSTEP]
have h : log x ≠ 0
[GOAL]
case h
x y : ℝ
hx1 : 0 < x
hx2 : x ≠ 1
⊢ log x ≠ 0
[PROOFSTEP]
rwa [← log_one, log_injOn_pos.ne_iff hx1]
[GOAL]
case h
x y : ℝ
hx1 : 0 < x
hx2 : x ≠ 1
⊢ 1 ∈ Ioi 0
[PROOFSTEP]
exact mem_Ioi.mpr zero_lt_one
[GOAL]
x y : ℝ
hx1 : 0 < x
hx2 : x ≠ 1
h : log x ≠ 0
⊢ log x < x - 1
[PROOFSTEP]
linarith [add_one_lt_exp_of_nonzero h, exp_log hx1]
[GOAL]
x✝ y x : ℝ
⊢ log x = 0 ↔ x = 0 ∨ x = 1 ∨ x = -1
[PROOFSTEP]
constructor
[GOAL]
case mp
x✝ y x : ℝ
⊢ log x = 0 → x = 0 ∨ x = 1 ∨ x = -1
[PROOFSTEP]
intro h
[GOAL]
case mp
x✝ y x : ℝ
h : log x = 0
⊢ x = 0 ∨ x = 1 ∨ x = -1
[PROOFSTEP]
rcases lt_trichotomy x 0 with (x_lt_zero | rfl | x_gt_zero)
[GOAL]
case mp.inl
x✝ y x : ℝ
h : log x = 0
x_lt_zero : x < 0
⊢ x = 0 ∨ x = 1 ∨ x = -1
[PROOFSTEP]
refine' Or.inr (Or.inr (neg_eq_iff_eq_neg.mp _))
[GOAL]
case mp.inl
x✝ y x : ℝ
h : log x = 0
x_lt_zero : x < 0
⊢ -x = 1
[PROOFSTEP]
rw [← log_neg_eq_log x] at h
[GOAL]
case mp.inl
x✝ y x : ℝ
h : log (-x) = 0
x_lt_zero : x < 0
⊢ -x = 1
[PROOFSTEP]
exact eq_one_of_pos_of_log_eq_zero (neg_pos.mpr x_lt_zero) h
[GOAL]
case mp.inr.inl
x y : ℝ
h : log 0 = 0
⊢ 0 = 0 ∨ 0 = 1 ∨ 0 = -1
[PROOFSTEP]
exact Or.inl rfl
[GOAL]
case mp.inr.inr
x✝ y x : ℝ
h : log x = 0
x_gt_zero : 0 < x
⊢ x = 0 ∨ x = 1 ∨ x = -1
[PROOFSTEP]
exact Or.inr (Or.inl (eq_one_of_pos_of_log_eq_zero x_gt_zero h))
[GOAL]
case mpr
x✝ y x : ℝ
⊢ x = 0 ∨ x = 1 ∨ x = -1 → log x = 0
[PROOFSTEP]
rintro (rfl | rfl | rfl)
[GOAL]
case mpr.inl
x y : ℝ
⊢ log 0 = 0
[PROOFSTEP]
simp only [log_one, log_zero, log_neg_eq_log]
[GOAL]
case mpr.inr.inl
x y : ℝ
⊢ log 1 = 0
[PROOFSTEP]
simp only [log_one, log_zero, log_neg_eq_log]
[GOAL]
case mpr.inr.inr
x y : ℝ
⊢ log (-1) = 0
[PROOFSTEP]
simp only [log_one, log_zero, log_neg_eq_log]
[GOAL]
x✝ y x : ℝ
⊢ log x ≠ 0 ↔ x ≠ 0 ∧ x ≠ 1 ∧ x ≠ -1
[PROOFSTEP]
simpa only [not_or] using log_eq_zero.not
[GOAL]
x✝ y x : ℝ
n : ℕ
⊢ log (x ^ n) = ↑n * log x
[PROOFSTEP]
induction' n with n ih
[GOAL]
case zero
x✝ y x : ℝ
⊢ log (x ^ Nat.zero) = ↑Nat.zero * log x
[PROOFSTEP]
simp
[GOAL]
case succ
x✝ y x : ℝ
n : ℕ
ih : log (x ^ n) = ↑n * log x
⊢ log (x ^ Nat.succ n) = ↑(Nat.succ n) * log x
[PROOFSTEP]
rcases eq_or_ne x 0 with (rfl | hx)
[GOAL]
case succ.inl
x y : ℝ
n : ℕ
ih : log (0 ^ n) = ↑n * log 0
⊢ log (0 ^ Nat.succ n) = ↑(Nat.succ n) * log 0
[PROOFSTEP]
simp
[GOAL]
case succ.inr
x✝ y x : ℝ
n : ℕ
ih : log (x ^ n) = ↑n * log x
hx : x ≠ 0
⊢ log (x ^ Nat.succ n) = ↑(Nat.succ n) * log x
[PROOFSTEP]
rw [pow_succ', log_mul (pow_ne_zero _ hx) hx, ih, Nat.cast_succ, add_mul, one_mul]
[GOAL]
x✝ y x : ℝ
n : ℤ
⊢ log (x ^ n) = ↑n * log x
[PROOFSTEP]
induction n
[GOAL]
case ofNat
x✝ y x : ℝ
a✝ : ℕ
⊢ log (x ^ Int.ofNat a✝) = ↑(Int.ofNat a✝) * log x
[PROOFSTEP]
rw [Int.ofNat_eq_coe, zpow_ofNat, log_pow, Int.cast_ofNat]
[GOAL]
case negSucc
x✝ y x : ℝ
a✝ : ℕ
⊢ log (x ^ Int.negSucc a✝) = ↑(Int.negSucc a✝) * log x
[PROOFSTEP]
rw [zpow_negSucc, log_inv, log_pow, Int.cast_negSucc, Nat.cast_add_one, neg_mul_eq_neg_mul]
[GOAL]
x✝ y x : ℝ
hx : 0 ≤ x
⊢ log (sqrt x) = log x / 2
[PROOFSTEP]
rw [eq_div_iff, mul_comm, ← Nat.cast_two, ← log_pow, sq_sqrt hx]
[GOAL]
x✝ y x : ℝ
hx : 0 ≤ x
⊢ 2 ≠ 0
[PROOFSTEP]
exact two_ne_zero
[GOAL]
x✝ y x : ℝ
hx : 0 < x
⊢ log x ≤ x - 1
[PROOFSTEP]
rw [le_sub_iff_add_le]
[GOAL]
x✝ y x : ℝ
hx : 0 < x
⊢ log x + 1 ≤ x
[PROOFSTEP]
convert add_one_le_exp (log x)
[GOAL]
case h.e'_4
x✝ y x : ℝ
hx : 0 < x
⊢ x = exp (log x)
[PROOFSTEP]
rw [exp_log hx]
[GOAL]
x✝ y x : ℝ
h1 : 0 < x
h2 : x ≤ 1
⊢ |log x * x| < 1
[PROOFSTEP]
have : 0 < 1 / x := by simpa only [one_div, inv_pos] using h1
[GOAL]
x✝ y x : ℝ
h1 : 0 < x
h2 : x ≤ 1
⊢ 0 < 1 / x
[PROOFSTEP]
simpa only [one_div, inv_pos] using h1
[GOAL]
x✝ y x : ℝ
h1 : 0 < x
h2 : x ≤ 1
this : 0 < 1 / x
⊢ |log x * x| < 1
[PROOFSTEP]
replace := log_le_sub_one_of_pos this
[GOAL]
x✝ y x : ℝ
h1 : 0 < x
h2 : x ≤ 1
this : log (1 / x) ≤ 1 / x - 1
⊢ |log x * x| < 1
[PROOFSTEP]
replace : log (1 / x) < 1 / x := by linarith
[GOAL]
x✝ y x : ℝ
h1 : 0 < x
h2 : x ≤ 1
this : log (1 / x) ≤ 1 / x - 1
⊢ log (1 / x) < 1 / x
[PROOFSTEP]
linarith
[GOAL]
x✝ y x : ℝ
h1 : 0 < x
h2 : x ≤ 1
this : log (1 / x) < 1 / x
⊢ |log x * x| < 1
[PROOFSTEP]
rw [log_div one_ne_zero h1.ne', log_one, zero_sub, lt_div_iff h1] at this
[GOAL]
x✝ y x : ℝ
h1 : 0 < x
h2 : x ≤ 1
this : -log x * x < 1
⊢ |log x * x| < 1
[PROOFSTEP]
have aux : 0 ≤ -log x * x := by
  refine' mul_nonneg _ h1.le
  rw [← log_inv]
  apply log_nonneg
  rw [← le_inv h1 zero_lt_one, inv_one]
  exact h2
[GOAL]
x✝ y x : ℝ
h1 : 0 < x
h2 : x ≤ 1
this : -log x * x < 1
⊢ 0 ≤ -log x * x
[PROOFSTEP]
refine' mul_nonneg _ h1.le
[GOAL]
x✝ y x : ℝ
h1 : 0 < x
h2 : x ≤ 1
this : -log x * x < 1
⊢ 0 ≤ -log x
[PROOFSTEP]
rw [← log_inv]
[GOAL]
x✝ y x : ℝ
h1 : 0 < x
h2 : x ≤ 1
this : -log x * x < 1
⊢ 0 ≤ log x⁻¹
[PROOFSTEP]
apply log_nonneg
[GOAL]
case hx
x✝ y x : ℝ
h1 : 0 < x
h2 : x ≤ 1
this : -log x * x < 1
⊢ 1 ≤ x⁻¹
[PROOFSTEP]
rw [← le_inv h1 zero_lt_one, inv_one]
[GOAL]
case hx
x✝ y x : ℝ
h1 : 0 < x
h2 : x ≤ 1
this : -log x * x < 1
⊢ x ≤ 1
[PROOFSTEP]
exact h2
[GOAL]
x✝ y x : ℝ
h1 : 0 < x
h2 : x ≤ 1
this : -log x * x < 1
aux : 0 ≤ -log x * x
⊢ |log x * x| < 1
[PROOFSTEP]
rw [← abs_of_nonneg aux, neg_mul, abs_neg] at this
[GOAL]
x✝ y x : ℝ
h1 : 0 < x
h2 : x ≤ 1
this : |log x * x| < 1
aux : 0 ≤ -log x * x
⊢ |log x * x| < 1
[PROOFSTEP]
exact this
[GOAL]
x y : ℝ
⊢ Tendsto (fun x => log (exp x)) atTop atTop
[PROOFSTEP]
simpa only [log_exp] using tendsto_id
[GOAL]
x y : ℝ
⊢ Tendsto log (𝓝[{0}ᶜ] 0) atBot
[PROOFSTEP]
rw [← show _ = log from funext log_abs]
[GOAL]
x y : ℝ
⊢ Tendsto (fun x => log |x|) (𝓝[{0}ᶜ] 0) atBot
[PROOFSTEP]
refine' Tendsto.comp (g := log) _ tendsto_abs_nhdsWithin_zero
[GOAL]
x y : ℝ
⊢ Tendsto log (𝓝[Ioi 0] 0) atBot
[PROOFSTEP]
simpa [← tendsto_comp_exp_atBot] using tendsto_id
[GOAL]
x y : ℝ
⊢ ContinuousOn log {0}ᶜ
[PROOFSTEP]
simp only [continuousOn_iff_continuous_restrict, restrict]
[GOAL]
x y : ℝ
⊢ Continuous fun x => log ↑x
[PROOFSTEP]
conv in log _ => rw [log_of_ne_zero (show (x : ℝ) ≠ 0 from x.2)]
[GOAL]
x✝ y : ℝ
x : ↑{0}ᶜ
| log ↑x
[PROOFSTEP]
rw [log_of_ne_zero (show (x : ℝ) ≠ 0 from x.2)]
[GOAL]
x✝ y : ℝ
x : ↑{0}ᶜ
| log ↑x
[PROOFSTEP]
rw [log_of_ne_zero (show (x : ℝ) ≠ 0 from x.2)]
[GOAL]
x✝ y : ℝ
x : ↑{0}ᶜ
| log ↑x
[PROOFSTEP]
rw [log_of_ne_zero (show (x : ℝ) ≠ 0 from x.2)]
[GOAL]
x y : ℝ
⊢ Continuous fun x => ↑(OrderIso.symm expOrderIso) { val := |↑x|, property := (_ : 0 < |↑x|) }
[PROOFSTEP]
exact expOrderIso.symm.continuous.comp (continuous_subtype_val.norm.subtype_mk _)
[GOAL]
x y : ℝ
⊢ ContinuousAt log x ↔ x ≠ 0
[PROOFSTEP]
refine' ⟨_, continuousAt_log⟩
[GOAL]
x y : ℝ
⊢ ContinuousAt log x → x ≠ 0
[PROOFSTEP]
rintro h rfl
[GOAL]
y : ℝ
h : ContinuousAt log 0
⊢ False
[PROOFSTEP]
exact not_tendsto_nhds_of_tendsto_atBot tendsto_log_nhdsWithin_zero _ (h.tendsto.mono_left inf_le_left)
[GOAL]
x y : ℝ
α : Type u_1
s : Finset α
f : α → ℝ
hf : ∀ (x : α), x ∈ s → f x ≠ 0
⊢ log (∏ i in s, f i) = ∑ i in s, log (f i)
[PROOFSTEP]
induction' s using Finset.cons_induction_on with a s ha ih
[GOAL]
case h₁
x y : ℝ
α : Type u_1
s : Finset α
f : α → ℝ
hf✝ : ∀ (x : α), x ∈ s → f x ≠ 0
hf : ∀ (x : α), x ∈ ∅ → f x ≠ 0
⊢ log (∏ i in ∅, f i) = ∑ i in ∅, log (f i)
[PROOFSTEP]
simp
[GOAL]
case h₂
x y : ℝ
α : Type u_1
s✝ : Finset α
f : α → ℝ
hf✝ : ∀ (x : α), x ∈ s✝ → f x ≠ 0
a : α
s : Finset α
ha : ¬a ∈ s
ih : (∀ (x : α), x ∈ s → f x ≠ 0) → log (∏ i in s, f i) = ∑ i in s, log (f i)
hf : ∀ (x : α), x ∈ Finset.cons a s ha → f x ≠ 0
⊢ log (∏ i in Finset.cons a s ha, f i) = ∑ i in Finset.cons a s ha, log (f i)
[PROOFSTEP]
rw [Finset.forall_mem_cons] at hf
[GOAL]
case h₂
x y : ℝ
α : Type u_1
s✝ : Finset α
f : α → ℝ
hf✝ : ∀ (x : α), x ∈ s✝ → f x ≠ 0
a : α
s : Finset α
ha : ¬a ∈ s
ih : (∀ (x : α), x ∈ s → f x ≠ 0) → log (∏ i in s, f i) = ∑ i in s, log (f i)
hf : f a ≠ 0 ∧ ∀ (x : α), x ∈ s → f x ≠ 0
⊢ log (∏ i in Finset.cons a s ha, f i) = ∑ i in Finset.cons a s ha, log (f i)
[PROOFSTEP]
simp [ih hf.2, log_mul hf.1 (Finset.prod_ne_zero_iff.2 hf.2)]
[GOAL]
x y : ℝ
n : ℕ
⊢ log ↑n = Finsupp.sum (Nat.factorization n) fun p t => ↑t * log ↑p
[PROOFSTEP]
rcases eq_or_ne n 0 with (rfl | hn)
[GOAL]
case inl
x y : ℝ
⊢ log ↑0 = Finsupp.sum (Nat.factorization 0) fun p t => ↑t * log ↑p
[PROOFSTEP]
simp
  -- relies on junk values of `log` and `Nat.factorization`
[GOAL]
case inr
x y : ℝ
n : ℕ
hn : n ≠ 0
⊢ log ↑n = Finsupp.sum (Nat.factorization n) fun p t => ↑t * log ↑p
[PROOFSTEP]
simp only [← log_pow, ← Nat.cast_pow]
[GOAL]
case inr
x y : ℝ
n : ℕ
hn : n ≠ 0
⊢ log ↑n = Finsupp.sum (Nat.factorization n) fun p t => log ↑(p ^ t)
[PROOFSTEP]
rw [← Finsupp.log_prod, ← Nat.cast_finsupp_prod, Nat.factorization_prod_pow_eq_self hn]
[GOAL]
case inr.hg
x y : ℝ
n : ℕ
hn : n ≠ 0
⊢ ∀ (a : ℕ), ↑(a ^ ↑(Nat.factorization n) a) = 0 → ↑(Nat.factorization n) a = 0
[PROOFSTEP]
intro p hp
[GOAL]
case inr.hg
x y : ℝ
n : ℕ
hn : n ≠ 0
p : ℕ
hp : ↑(p ^ ↑(Nat.factorization n) p) = 0
⊢ ↑(Nat.factorization n) p = 0
[PROOFSTEP]
rw [pow_eq_zero (Nat.cast_eq_zero.1 hp), Nat.factorization_zero_right]
[GOAL]
x y a b : ℝ
n : ℕ
ha : a ≠ 0
⊢ (fun x => x ^ n / (a * exp x + b)) ∘ log =ᶠ[atTop] fun x => log x ^ n / (a * x + b)
[PROOFSTEP]
filter_upwards [eventually_gt_atTop (0 : ℝ)] with x hx using by simp [exp_log hx]
[GOAL]
x✝ y a b : ℝ
n : ℕ
ha : a ≠ 0
x : ℝ
hx : 0 < x
⊢ ((fun x => x ^ n / (a * exp x + b)) ∘ log) x = log x ^ n / (a * x + b)
[PROOFSTEP]
simp [exp_log hx]
[GOAL]
x y : ℝ
n : ℕ
⊢ (fun x => log x ^ n) =o[atTop] id
[PROOFSTEP]
rw [Asymptotics.isLittleO_iff_tendsto']
[GOAL]
x y : ℝ
n : ℕ
⊢ Tendsto (fun x => log x ^ n / id x) atTop (𝓝 0)
[PROOFSTEP]
simpa using tendsto_pow_log_div_mul_add_atTop 1 0 n one_ne_zero
[GOAL]
x y : ℝ
n : ℕ
⊢ ∀ᶠ (x : ℝ) in atTop, id x = 0 → log x ^ n = 0
[PROOFSTEP]
filter_upwards [eventually_ne_atTop (0 : ℝ)] with x h₁ h₂ using (h₁ h₂).elim
[GOAL]
x y c : ℝ
⊢ (fun x => c) =o[atTop] log
[PROOFSTEP]
refine Asymptotics.isLittleO_of_tendsto' ?_ <| Tendsto.div_atTop (a := c) (by simp) tendsto_log_atTop
[GOAL]
x y c : ℝ
⊢ Tendsto (fun x => c) atTop (𝓝 c)
[PROOFSTEP]
simp
[GOAL]
x y c : ℝ
⊢ ∀ᶠ (x : ℝ) in atTop, log x = 0 → c = 0
[PROOFSTEP]
filter_upwards [eventually_gt_atTop 1] with x hx
[GOAL]
case h
x✝ y c x : ℝ
hx : 1 < x
⊢ log x = 0 → c = 0
[PROOFSTEP]
aesop (add safe forward log_pos)
[GOAL]
y : ℝ
⊢ Tendsto (fun x => log (x + y) - log x) atTop (𝓝 0)
[PROOFSTEP]
have : Tendsto (fun x ↦ 1 + y / x) atTop (𝓝 (1 + 0))
[GOAL]
case this
y : ℝ
⊢ Tendsto (fun x => 1 + y / x) atTop (𝓝 (1 + 0))
[PROOFSTEP]
exact tendsto_const_nhds.add (tendsto_const_nhds.div_atTop tendsto_id)
[GOAL]
y : ℝ
this : Tendsto (fun x => 1 + y / x) atTop (𝓝 (1 + 0))
⊢ Tendsto (fun x => log (x + y) - log x) atTop (𝓝 0)
[PROOFSTEP]
rw [← comap_exp_nhds_exp, exp_zero, tendsto_comap_iff, ← add_zero (1 : ℝ)]
[GOAL]
y : ℝ
this : Tendsto (fun x => 1 + y / x) atTop (𝓝 (1 + 0))
⊢ Tendsto (exp ∘ fun x => log (x + y) - log x) atTop (𝓝 (1 + 0))
[PROOFSTEP]
refine' this.congr' _
[GOAL]
y : ℝ
this : Tendsto (fun x => 1 + y / x) atTop (𝓝 (1 + 0))
⊢ (fun x => 1 + y / x) =ᶠ[atTop] exp ∘ fun x => log (x + y) - log x
[PROOFSTEP]
filter_upwards [eventually_gt_atTop (0 : ℝ), eventually_gt_atTop (-y)] with x hx₀ hxy
[GOAL]
case h
y : ℝ
this : Tendsto (fun x => 1 + y / x) atTop (𝓝 (1 + 0))
x : ℝ
hx₀ : 0 < x
hxy : -y < x
⊢ 1 + y / x = (exp ∘ fun x => log (x + y) - log x) x
[PROOFSTEP]
rw [comp_apply, exp_sub, exp_log, exp_log, one_add_div]
[GOAL]
case h
y : ℝ
this : Tendsto (fun x => 1 + y / x) atTop (𝓝 (1 + 0))
x : ℝ
hx₀ : 0 < x
hxy : -y < x
⊢ x ≠ 0
[PROOFSTEP]
linarith
[GOAL]
case h
y : ℝ
this : Tendsto (fun x => 1 + y / x) atTop (𝓝 (1 + 0))
x : ℝ
hx₀ : 0 < x
hxy : -y < x
⊢ 0 < x
[PROOFSTEP]
linarith
[GOAL]
case h
y : ℝ
this : Tendsto (fun x => 1 + y / x) atTop (𝓝 (1 + 0))
x : ℝ
hx₀ : 0 < x
hxy : -y < x
⊢ 0 < x + y
[PROOFSTEP]
linarith
[GOAL]
e : ℝ
n : ℕ
h : NormNum.IsNat e n
⊢ 0 ≤ Real.log e
[PROOFSTEP]
rw [NormNum.IsNat.to_eq h rfl]
[GOAL]
e : ℝ
n : ℕ
h : NormNum.IsNat e n
⊢ 0 ≤ Real.log ↑n
[PROOFSTEP]
exact Real.log_nat_cast_nonneg _
[GOAL]
e : ℝ
n : ℕ
h : NormNum.IsNat e n
w : Nat.blt 1 n = true
⊢ 0 < Real.log e
[PROOFSTEP]
rw [NormNum.IsNat.to_eq h rfl]
[GOAL]
e : ℝ
n : ℕ
h : NormNum.IsNat e n
w : Nat.blt 1 n = true
⊢ 0 < Real.log ↑n
[PROOFSTEP]
apply Real.log_pos
[GOAL]
case hx
e : ℝ
n : ℕ
h : NormNum.IsNat e n
w : Nat.blt 1 n = true
⊢ 1 < ↑n
[PROOFSTEP]
simpa using w
[GOAL]
e : ℝ
n : ℕ
h : NormNum.IsInt e (Int.negOfNat n)
⊢ 0 ≤ Real.log e
[PROOFSTEP]
rw [NormNum.IsInt.neg_to_eq h rfl]
[GOAL]
e : ℝ
n : ℕ
h : NormNum.IsInt e (Int.negOfNat n)
⊢ 0 ≤ Real.log (-↑n)
[PROOFSTEP]
exact Real.log_neg_nat_cast_nonneg _
[GOAL]
e : ℝ
n : ℕ
h : NormNum.IsInt e (Int.negOfNat n)
w : Nat.blt 1 n = true
⊢ 0 < Real.log e
[PROOFSTEP]
rw [NormNum.IsInt.neg_to_eq h rfl]
[GOAL]
e : ℝ
n : ℕ
h : NormNum.IsInt e (Int.negOfNat n)
w : Nat.blt 1 n = true
⊢ 0 < Real.log (-↑n)
[PROOFSTEP]
rw [Real.log_neg_eq_log]
[GOAL]
e : ℝ
n : ℕ
h : NormNum.IsInt e (Int.negOfNat n)
w : Nat.blt 1 n = true
⊢ 0 < Real.log ↑n
[PROOFSTEP]
apply Real.log_pos
[GOAL]
case hx
e : ℝ
n : ℕ
h : NormNum.IsInt e (Int.negOfNat n)
w : Nat.blt 1 n = true
⊢ 1 < ↑n
[PROOFSTEP]
simpa using w
[GOAL]
e : ℝ
n : ℤ
d : ℕ
inv : Invertible ↑d
eq : e = ↑n * ⅟↑d
h : decide (1 < ↑n / ↑d) = true
⊢ 0 < Real.log e
[PROOFSTEP]
rw [eq, invOf_eq_inv, ← div_eq_mul_inv]
[GOAL]
e : ℝ
n : ℤ
d : ℕ
inv : Invertible ↑d
eq : e = ↑n * ⅟↑d
h : decide (1 < ↑n / ↑d) = true
⊢ 0 < Real.log (↑n / ↑d)
[PROOFSTEP]
have : 1 < (n : ℝ) / d := by exact_mod_cast of_decide_eq_true h
[GOAL]
e : ℝ
n : ℤ
d : ℕ
inv : Invertible ↑d
eq : e = ↑n * ⅟↑d
h : decide (1 < ↑n / ↑d) = true
⊢ 1 < ↑n / ↑d
[PROOFSTEP]
exact_mod_cast of_decide_eq_true h
[GOAL]
e : ℝ
n : ℤ
d : ℕ
inv : Invertible ↑d
eq : e = ↑n * ⅟↑d
h : decide (1 < ↑n / ↑d) = true
this : 1 < ↑n / ↑d
⊢ 0 < Real.log (↑n / ↑d)
[PROOFSTEP]
exact Real.log_pos this
[GOAL]
e : ℝ
n : ℤ
d : ℕ
inv : Invertible ↑d
eq : e = ↑n * ⅟↑d
h : decide (↑n / ↑d < -1) = true
⊢ 0 < Real.log e
[PROOFSTEP]
rw [eq, invOf_eq_inv, ← div_eq_mul_inv]
[GOAL]
e : ℝ
n : ℤ
d : ℕ
inv : Invertible ↑d
eq : e = ↑n * ⅟↑d
h : decide (↑n / ↑d < -1) = true
⊢ 0 < Real.log (↑n / ↑d)
[PROOFSTEP]
have : (n : ℝ) / d < -1 := by exact_mod_cast of_decide_eq_true h
[GOAL]
e : ℝ
n : ℤ
d : ℕ
inv : Invertible ↑d
eq : e = ↑n * ⅟↑d
h : decide (↑n / ↑d < -1) = true
⊢ ↑n / ↑d < -1
[PROOFSTEP]
exact_mod_cast of_decide_eq_true h
[GOAL]
e : ℝ
n : ℤ
d : ℕ
inv : Invertible ↑d
eq : e = ↑n * ⅟↑d
h : decide (↑n / ↑d < -1) = true
this : ↑n / ↑d < -1
⊢ 0 < Real.log (↑n / ↑d)
[PROOFSTEP]
exact Real.log_pos_of_lt_neg_one this
[GOAL]
e : ℝ
n : ℤ
d : ℕ
inv : Invertible ↑d
eq : e = ↑n * ⅟↑d
h₁ : decide (0 < ↑n / ↑d) = true
h₂ : decide (↑n / ↑d < 1) = true
⊢ Real.log e ≠ 0
[PROOFSTEP]
rw [eq, invOf_eq_inv, ← div_eq_mul_inv]
[GOAL]
e : ℝ
n : ℤ
d : ℕ
inv : Invertible ↑d
eq : e = ↑n * ⅟↑d
h₁ : decide (0 < ↑n / ↑d) = true
h₂ : decide (↑n / ↑d < 1) = true
⊢ Real.log (↑n / ↑d) ≠ 0
[PROOFSTEP]
have h₁' : 0 < (n : ℝ) / d := by exact_mod_cast of_decide_eq_true h₁
[GOAL]
e : ℝ
n : ℤ
d : ℕ
inv : Invertible ↑d
eq : e = ↑n * ⅟↑d
h₁ : decide (0 < ↑n / ↑d) = true
h₂ : decide (↑n / ↑d < 1) = true
⊢ 0 < ↑n / ↑d
[PROOFSTEP]
exact_mod_cast of_decide_eq_true h₁
[GOAL]
e : ℝ
n : ℤ
d : ℕ
inv : Invertible ↑d
eq : e = ↑n * ⅟↑d
h₁ : decide (0 < ↑n / ↑d) = true
h₂ : decide (↑n / ↑d < 1) = true
h₁' : 0 < ↑n / ↑d
⊢ Real.log (↑n / ↑d) ≠ 0
[PROOFSTEP]
have h₂' : (n : ℝ) / d < 1 := by exact_mod_cast of_decide_eq_true h₂
[GOAL]
e : ℝ
n : ℤ
d : ℕ
inv : Invertible ↑d
eq : e = ↑n * ⅟↑d
h₁ : decide (0 < ↑n / ↑d) = true
h₂ : decide (↑n / ↑d < 1) = true
h₁' : 0 < ↑n / ↑d
⊢ ↑n / ↑d < 1
[PROOFSTEP]
exact_mod_cast of_decide_eq_true h₂
[GOAL]
e : ℝ
n : ℤ
d : ℕ
inv : Invertible ↑d
eq : e = ↑n * ⅟↑d
h₁ : decide (0 < ↑n / ↑d) = true
h₂ : decide (↑n / ↑d < 1) = true
h₁' : 0 < ↑n / ↑d
h₂' : ↑n / ↑d < 1
⊢ Real.log (↑n / ↑d) ≠ 0
[PROOFSTEP]
exact ne_of_lt <| Real.log_neg h₁' h₂'
[GOAL]
e : ℝ
n : ℤ
d : ℕ
inv : Invertible ↑d
eq : e = ↑n * ⅟↑d
h₁ : decide (↑n / ↑d < 0) = true
h₂ : decide (-1 < ↑n / ↑d) = true
⊢ Real.log e ≠ 0
[PROOFSTEP]
rw [eq, invOf_eq_inv, ← div_eq_mul_inv]
[GOAL]
e : ℝ
n : ℤ
d : ℕ
inv : Invertible ↑d
eq : e = ↑n * ⅟↑d
h₁ : decide (↑n / ↑d < 0) = true
h₂ : decide (-1 < ↑n / ↑d) = true
⊢ Real.log (↑n / ↑d) ≠ 0
[PROOFSTEP]
have h₁' : (n : ℝ) / d < 0 := by exact_mod_cast of_decide_eq_true h₁
[GOAL]
e : ℝ
n : ℤ
d : ℕ
inv : Invertible ↑d
eq : e = ↑n * ⅟↑d
h₁ : decide (↑n / ↑d < 0) = true
h₂ : decide (-1 < ↑n / ↑d) = true
⊢ ↑n / ↑d < 0
[PROOFSTEP]
exact_mod_cast of_decide_eq_true h₁
[GOAL]
e : ℝ
n : ℤ
d : ℕ
inv : Invertible ↑d
eq : e = ↑n * ⅟↑d
h₁ : decide (↑n / ↑d < 0) = true
h₂ : decide (-1 < ↑n / ↑d) = true
h₁' : ↑n / ↑d < 0
⊢ Real.log (↑n / ↑d) ≠ 0
[PROOFSTEP]
have h₂' : -1 < (n : ℝ) / d := by exact_mod_cast of_decide_eq_true h₂
[GOAL]
e : ℝ
n : ℤ
d : ℕ
inv : Invertible ↑d
eq : e = ↑n * ⅟↑d
h₁ : decide (↑n / ↑d < 0) = true
h₂ : decide (-1 < ↑n / ↑d) = true
h₁' : ↑n / ↑d < 0
⊢ -1 < ↑n / ↑d
[PROOFSTEP]
exact_mod_cast of_decide_eq_true h₂
[GOAL]
e : ℝ
n : ℤ
d : ℕ
inv : Invertible ↑d
eq : e = ↑n * ⅟↑d
h₁ : decide (↑n / ↑d < 0) = true
h₂ : decide (-1 < ↑n / ↑d) = true
h₁' : ↑n / ↑d < 0
h₂' : -1 < ↑n / ↑d
⊢ Real.log (↑n / ↑d) ≠ 0
[PROOFSTEP]
exact ne_of_lt <| Real.log_neg_of_lt_zero h₁' h₂'
[GOAL]
$x✝ : Type x✝
«$_zα» : Zero $x✝
«$_pα» : PartialOrder $x✝
«$e» : $x✝
«$f» : ℝ → ℝ
«$a» : ℝ
«$n» : ℤ
«$d» : ℕ
«$i» : DivisionRing ℝ := Real.instDivisionRingReal
«$p» : NormNum.IsRat «$a» «$n» «$d»
⊢ Sort ?u.471336
[PROOFSTEP]
clear! «$i»
[GOAL]
$x✝ : Type x✝
«$_zα» : Zero $x✝
«$_pα» : PartialOrder $x✝
«$e» : $x✝
«$f» : ℝ → ℝ
«$a» : ℝ
«$n» : ℤ
«$d» : ℕ
⊢ Sort ?u.471336
[PROOFSTEP]
exact NormNum.IsRat «$a» «$n» «$d»