[GOAL]
n : ℕ
x : ℤ
⊢ (↑n + 1) * x = x + ↑n * x
[PROOFSTEP]
rw [Int.add_mul, Int.add_comm, Int.one_mul]
[GOAL]
x✝¹ : ℕ
x✝ : ℤ
⊢ (fun n x => x ^ n) (x✝¹ + 1) x✝ = x✝ * (fun n x => x ^ n) x✝¹ x✝
[PROOFSTEP]
rw [Int.mul_comm]
[GOAL]
x✝¹ : ℕ
x✝ : ℤ
⊢ (fun n x => x ^ n) (x✝¹ + 1) x✝ = (fun n x => x ^ n) x✝¹ x✝ * x✝
[PROOFSTEP]
rfl
[GOAL]
m : ℕ
n : ℤ
⊢ (fun x x_1 => x * x_1) (ofNat (succ m)) n = n + (fun x x_1 => x * x_1) (ofNat m) n
[PROOFSTEP]
simp only [ofNat_eq_coe, ofNat_succ, Int.add_mul, Int.add_comm, Int.one_mul]
[GOAL]
m : ℕ
n : ℤ
⊢ (fun x x_1 => x * x_1) -[m+1] n = -(fun x x_1 => x * x_1) (↑(succ m)) n
[PROOFSTEP]
simp only [negSucc_coe, ofNat_succ, Int.neg_mul]
[GOAL]
⊢ AddCommMonoid ℤ
[PROOFSTEP]
infer_instance
[GOAL]
⊢ AddMonoid ℤ
[PROOFSTEP]
infer_instance
[GOAL]
⊢ Monoid ℤ
[PROOFSTEP]
infer_instance
[GOAL]
⊢ CommMonoid ℤ
[PROOFSTEP]
infer_instance
[GOAL]
⊢ CommSemigroup ℤ
[PROOFSTEP]
infer_instance
[GOAL]
⊢ Semigroup ℤ
[PROOFSTEP]
infer_instance
[GOAL]
⊢ AddCommGroup ℤ
[PROOFSTEP]
infer_instance
[GOAL]
⊢ AddGroup ℤ
[PROOFSTEP]
infer_instance
[GOAL]
⊢ AddCommSemigroup ℤ
[PROOFSTEP]
infer_instance
[GOAL]
⊢ AddSemigroup ℤ
[PROOFSTEP]
infer_instance
[GOAL]
⊢ CommSemiring ℤ
[PROOFSTEP]
infer_instance
[GOAL]
⊢ Semiring ℤ
[PROOFSTEP]
infer_instance
[GOAL]
⊢ Ring ℤ
[PROOFSTEP]
infer_instance
[GOAL]
⊢ Distrib ℤ
[PROOFSTEP]
infer_instance
[GOAL]
a : ℤ
⊢ succ (-succ a) = -a
[PROOFSTEP]
rw [neg_succ, succ_pred]
[GOAL]
a : ℤ
⊢ -pred a = succ (-a)
[PROOFSTEP]
rw [neg_eq_iff_eq_neg.mp (neg_succ (-a)), neg_neg]
[GOAL]
a : ℤ
⊢ pred (-pred a) = -a
[PROOFSTEP]
rw [neg_pred, pred_succ]
[GOAL]
n : ℕ
h : 0 < n
⊢ ↑(n - 1) = ↑n - 1
[PROOFSTEP]
cases n
[GOAL]
case zero
h : 0 < zero
⊢ ↑(zero - 1) = ↑zero - 1
case succ n✝ : ℕ h : 0 < Nat.succ n✝ ⊢ ↑(Nat.succ n✝ - 1) = ↑(Nat.succ n✝) - 1
[PROOFSTEP]
cases h
[GOAL]
case succ
n✝ : ℕ
h : 0 < Nat.succ n✝
⊢ ↑(Nat.succ n✝ - 1) = ↑(Nat.succ n✝) - 1
[PROOFSTEP]
simp
[GOAL]
p : ℤ → Prop
i : ℤ
hz : p 0
hp : ∀ (i : ℕ), p ↑i → p (↑i + 1)
hn : ∀ (i : ℕ), p (-↑i) → p (-↑i - 1)
⊢ p i
[PROOFSTEP]
induction i with
| ofNat i =>
  induction i with
  | zero => exact hz
  | succ i ih => exact hp _ ih
| negSucc i =>
  suffices ∀ n : ℕ, p (-n) from this (i + 1)
  intro n;
  induction n with
  | zero => simp [hz, Nat.cast_zero]
  | succ n ih => convert hn _ ih using 1; simp [sub_eq_neg_add]
[GOAL]
p : ℤ → Prop
i : ℤ
hz : p 0
hp : ∀ (i : ℕ), p ↑i → p (↑i + 1)
hn : ∀ (i : ℕ), p (-↑i) → p (-↑i - 1)
⊢ p i
[PROOFSTEP]
induction i with
| ofNat i =>
  induction i with
  | zero => exact hz
  | succ i ih => exact hp _ ih
| negSucc i =>
  suffices ∀ n : ℕ, p (-n) from this (i + 1)
  intro n;
  induction n with
  | zero => simp [hz, Nat.cast_zero]
  | succ n ih => convert hn _ ih using 1; simp [sub_eq_neg_add]
[GOAL]
case ofNat
p : ℤ → Prop
hz : p 0
hp : ∀ (i : ℕ), p ↑i → p (↑i + 1)
hn : ∀ (i : ℕ), p (-↑i) → p (-↑i - 1)
i : ℕ
⊢ p (ofNat i)
[PROOFSTEP]

| ofNat i =>
  induction i with
  | zero => exact hz
  | succ i ih => exact hp _ ih
[GOAL]
case ofNat
p : ℤ → Prop
hz : p 0
hp : ∀ (i : ℕ), p ↑i → p (↑i + 1)
hn : ∀ (i : ℕ), p (-↑i) → p (-↑i - 1)
i : ℕ
⊢ p (ofNat i)
[PROOFSTEP]
induction i with
| zero => exact hz
| succ i ih => exact hp _ ih
[GOAL]
case ofNat
p : ℤ → Prop
hz : p 0
hp : ∀ (i : ℕ), p ↑i → p (↑i + 1)
hn : ∀ (i : ℕ), p (-↑i) → p (-↑i - 1)
i : ℕ
⊢ p (ofNat i)
[PROOFSTEP]
induction i with
| zero => exact hz
| succ i ih => exact hp _ ih
[GOAL]
case ofNat.zero
p : ℤ → Prop
hz : p 0
hp : ∀ (i : ℕ), p ↑i → p (↑i + 1)
hn : ∀ (i : ℕ), p (-↑i) → p (-↑i - 1)
⊢ p (ofNat zero)
[PROOFSTEP]

| zero => exact hz
[GOAL]
case ofNat.zero
p : ℤ → Prop
hz : p 0
hp : ∀ (i : ℕ), p ↑i → p (↑i + 1)
hn : ∀ (i : ℕ), p (-↑i) → p (-↑i - 1)
⊢ p (ofNat zero)
[PROOFSTEP]
exact hz
[GOAL]
case ofNat.succ
p : ℤ → Prop
hz : p 0
hp : ∀ (i : ℕ), p ↑i → p (↑i + 1)
hn : ∀ (i : ℕ), p (-↑i) → p (-↑i - 1)
i : ℕ
ih : p (ofNat i)
⊢ p (ofNat (Nat.succ i))
[PROOFSTEP]

| succ i ih => exact hp _ ih
[GOAL]
case ofNat.succ
p : ℤ → Prop
hz : p 0
hp : ∀ (i : ℕ), p ↑i → p (↑i + 1)
hn : ∀ (i : ℕ), p (-↑i) → p (-↑i - 1)
i : ℕ
ih : p (ofNat i)
⊢ p (ofNat (Nat.succ i))
[PROOFSTEP]
exact hp _ ih
[GOAL]
case negSucc
p : ℤ → Prop
hz : p 0
hp : ∀ (i : ℕ), p ↑i → p (↑i + 1)
hn : ∀ (i : ℕ), p (-↑i) → p (-↑i - 1)
i : ℕ
⊢ p -[i+1]
[PROOFSTEP]

| negSucc i =>
  suffices ∀ n : ℕ, p (-n) from this (i + 1)
  intro n;
  induction n with
  | zero => simp [hz, Nat.cast_zero]
  | succ n ih => convert hn _ ih using 1; simp [sub_eq_neg_add]
[GOAL]
case negSucc
p : ℤ → Prop
hz : p 0
hp : ∀ (i : ℕ), p ↑i → p (↑i + 1)
hn : ∀ (i : ℕ), p (-↑i) → p (-↑i - 1)
i : ℕ
⊢ p -[i+1]
[PROOFSTEP]
suffices ∀ n : ℕ, p (-n) from this (i + 1)
[GOAL]
case negSucc
p : ℤ → Prop
hz : p 0
hp : ∀ (i : ℕ), p ↑i → p (↑i + 1)
hn : ∀ (i : ℕ), p (-↑i) → p (-↑i - 1)
i : ℕ
⊢ ∀ (n : ℕ), p (-↑n)
[PROOFSTEP]
intro n
[GOAL]
case negSucc
p : ℤ → Prop
hz : p 0
hp : ∀ (i : ℕ), p ↑i → p (↑i + 1)
hn : ∀ (i : ℕ), p (-↑i) → p (-↑i - 1)
i n : ℕ
⊢ p (-↑n)
[PROOFSTEP]
induction n with
| zero => simp [hz, Nat.cast_zero]
| succ n ih => convert hn _ ih using 1; simp [sub_eq_neg_add]
[GOAL]
case negSucc
p : ℤ → Prop
hz : p 0
hp : ∀ (i : ℕ), p ↑i → p (↑i + 1)
hn : ∀ (i : ℕ), p (-↑i) → p (-↑i - 1)
i n : ℕ
⊢ p (-↑n)
[PROOFSTEP]
induction n with
| zero => simp [hz, Nat.cast_zero]
| succ n ih => convert hn _ ih using 1; simp [sub_eq_neg_add]
[GOAL]
case negSucc.zero
p : ℤ → Prop
hz : p 0
hp : ∀ (i : ℕ), p ↑i → p (↑i + 1)
hn : ∀ (i : ℕ), p (-↑i) → p (-↑i - 1)
i : ℕ
⊢ p (-↑zero)
[PROOFSTEP]

| zero => simp [hz, Nat.cast_zero]
[GOAL]
case negSucc.zero
p : ℤ → Prop
hz : p 0
hp : ∀ (i : ℕ), p ↑i → p (↑i + 1)
hn : ∀ (i : ℕ), p (-↑i) → p (-↑i - 1)
i : ℕ
⊢ p (-↑zero)
[PROOFSTEP]
simp [hz, Nat.cast_zero]
[GOAL]
case negSucc.succ
p : ℤ → Prop
hz : p 0
hp : ∀ (i : ℕ), p ↑i → p (↑i + 1)
hn : ∀ (i : ℕ), p (-↑i) → p (-↑i - 1)
i n : ℕ
ih : p (-↑n)
⊢ p (-↑(Nat.succ n))
[PROOFSTEP]

| succ n ih => convert hn _ ih using 1; simp [sub_eq_neg_add]
[GOAL]
case negSucc.succ
p : ℤ → Prop
hz : p 0
hp : ∀ (i : ℕ), p ↑i → p (↑i + 1)
hn : ∀ (i : ℕ), p (-↑i) → p (-↑i - 1)
i n : ℕ
ih : p (-↑n)
⊢ p (-↑(Nat.succ n))
[PROOFSTEP]
convert hn _ ih using 1
[GOAL]
case h.e'_1
p : ℤ → Prop
hz : p 0
hp : ∀ (i : ℕ), p ↑i → p (↑i + 1)
hn : ∀ (i : ℕ), p (-↑i) → p (-↑i - 1)
i n : ℕ
ih : p (-↑n)
⊢ -↑(Nat.succ n) = -↑n - 1
[PROOFSTEP]
simp [sub_eq_neg_add]
[GOAL]
a b : ℤ
m n : ℕ
Ha : -[m+1] < 0
Hb : 0 < ↑(Nat.succ n)
⊢ ediv -[m+1] ↑(Nat.succ n) = -((- -[m+1] - 1) / ↑(Nat.succ n) + 1)
[PROOFSTEP]
rw [show (- -[m+1] : ℤ) = (m + 1 : ℤ) by rfl]
[GOAL]
a b : ℤ
m n : ℕ
Ha : -[m+1] < 0
Hb : 0 < ↑(Nat.succ n)
⊢ - -[m+1] = ↑m + 1
[PROOFSTEP]
rfl
[GOAL]
a b : ℤ
m n : ℕ
Ha : -[m+1] < 0
Hb : 0 < ↑(Nat.succ n)
⊢ ediv -[m+1] ↑(Nat.succ n) = -((↑m + 1 - 1) / ↑(Nat.succ n) + 1)
[PROOFSTEP]
rw [add_sub_cancel]
[GOAL]
a b : ℤ
m n : ℕ
Ha : -[m+1] < 0
Hb : 0 < ↑(Nat.succ n)
⊢ ediv -[m+1] ↑(Nat.succ n) = -(↑m / ↑(Nat.succ n) + 1)
[PROOFSTEP]
rfl


[GOAL]
m : Type u_1
n : Type u_2
α : Type u_3
inst✝³ : Fintype n
inst✝² : DecidableEq n
inst✝¹ : Semiring α
A : Matrix n n α
B : Matrix n m α
inst✝ : Invertible A
⊢ ⅟A * (A * B) = B
[PROOFSTEP]
rw [← Matrix.mul_assoc, invOf_mul_self, Matrix.one_mul]
[GOAL]
m : Type u_1
n : Type u_2
α : Type u_3
inst✝³ : Fintype n
inst✝² : DecidableEq n
inst✝¹ : Semiring α
A : Matrix n n α
B : Matrix n m α
inst✝ : Invertible A
⊢ A * (⅟A * B) = B
[PROOFSTEP]
rw [← Matrix.mul_assoc, mul_invOf_self, Matrix.one_mul]
[GOAL]
m : Type u_1
n : Type u_2
α : Type u_3
inst✝³ : Fintype n
inst✝² : DecidableEq n
inst✝¹ : Semiring α
A : Matrix m n α
B : Matrix n n α
inst✝ : Invertible B
⊢ A * ⅟B * B = A
[PROOFSTEP]
rw [Matrix.mul_assoc, invOf_mul_self, Matrix.mul_one]
[GOAL]
m : Type u_1
n : Type u_2
α : Type u_3
inst✝³ : Fintype n
inst✝² : DecidableEq n
inst✝¹ : Semiring α
A : Matrix m n α
B : Matrix n n α
inst✝ : Invertible B
⊢ A * B * ⅟B = A
[PROOFSTEP]
rw [Matrix.mul_assoc, mul_invOf_self, Matrix.mul_one]


[GOAL]
p : Sort u_1
a : ℤ
n : ℕ
hn : Nat.ble 1 n = true
H : OnModCases n a 0 p
⊢ 0 ≤ toNat (a % ↑n) ∧ toNat (a % ↑n) < n ∧ a ≡ ↑(toNat (a % ↑n)) [ZMOD ↑n]
[PROOFSTEP]
have := ofNat_pos.2 <| Nat.le_of_ble_eq_true hn
[GOAL]
p : Sort u_1
a : ℤ
n : ℕ
hn : Nat.ble 1 n = true
H : OnModCases n a 0 p
this : 0 < ↑n
⊢ 0 ≤ toNat (a % ↑n) ∧ toNat (a % ↑n) < n ∧ a ≡ ↑(toNat (a % ↑n)) [ZMOD ↑n]
[PROOFSTEP]
have nonneg := emod_nonneg a <| Int.ne_of_gt this
[GOAL]
p : Sort u_1
a : ℤ
n : ℕ
hn : Nat.ble 1 n = true
H : OnModCases n a 0 p
this : 0 < ↑n
nonneg : 0 ≤ a % ↑n
⊢ 0 ≤ toNat (a % ↑n) ∧ toNat (a % ↑n) < n ∧ a ≡ ↑(toNat (a % ↑n)) [ZMOD ↑n]
[PROOFSTEP]
refine ⟨Nat.zero_le _, ?_, ?_⟩
[GOAL]
case refine_1
p : Sort u_1
a : ℤ
n : ℕ
hn : Nat.ble 1 n = true
H : OnModCases n a 0 p
this : 0 < ↑n
nonneg : 0 ≤ a % ↑n
⊢ toNat (a % ↑n) < n
[PROOFSTEP]
rw [Int.toNat_lt nonneg]
[GOAL]
case refine_1
p : Sort u_1
a : ℤ
n : ℕ
hn : Nat.ble 1 n = true
H : OnModCases n a 0 p
this : 0 < ↑n
nonneg : 0 ≤ a % ↑n
⊢ a % ↑n < ↑n
[PROOFSTEP]
exact Int.emod_lt_of_pos _ this
[GOAL]
case refine_2
p : Sort u_1
a : ℤ
n : ℕ
hn : Nat.ble 1 n = true
H : OnModCases n a 0 p
this : 0 < ↑n
nonneg : 0 ≤ a % ↑n
⊢ a ≡ ↑(toNat (a % ↑n)) [ZMOD ↑n]
[PROOFSTEP]
rw [Int.ModEq, Int.toNat_of_nonneg nonneg, emod_emod]


[GOAL]
𝕜 : Type u
inst✝⁴ : NontriviallyNormedField 𝕜
F : Type v
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
E : Type w
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace 𝕜 E
f f₀ f₁ g : 𝕜 → F
f' f₀' f₁' g' : F
x✝ : 𝕜
s t : Set 𝕜
L L₁ L₂ : Filter 𝕜
c : 𝕜 → 𝕜
c' : 𝕜
n : ℕ
x : 𝕜
⊢ HasStrictDerivAt (fun x => x ^ 0) (↑0 * x ^ (0 - 1)) x
[PROOFSTEP]
simp [hasStrictDerivAt_const]
[GOAL]
𝕜 : Type u
inst✝⁴ : NontriviallyNormedField 𝕜
F : Type v
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
E : Type w
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace 𝕜 E
f f₀ f₁ g : 𝕜 → F
f' f₀' f₁' g' : F
x✝ : 𝕜
s t : Set 𝕜
L L₁ L₂ : Filter 𝕜
c : 𝕜 → 𝕜
c' : 𝕜
n : ℕ
x : 𝕜
⊢ HasStrictDerivAt (fun x => x ^ 1) (↑1 * x ^ (1 - 1)) x
[PROOFSTEP]
simpa using hasStrictDerivAt_id x
[GOAL]
𝕜 : Type u
inst✝⁴ : NontriviallyNormedField 𝕜
F : Type v
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
E : Type w
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace 𝕜 E
f f₀ f₁ g : 𝕜 → F
f' f₀' f₁' g' : F
x✝ : 𝕜
s t : Set 𝕜
L L₁ L₂ : Filter 𝕜
c : 𝕜 → 𝕜
c' : 𝕜
n✝ n : ℕ
x : 𝕜
⊢ HasStrictDerivAt (fun x => x ^ (n + 1 + 1)) (↑(n + 1 + 1) * x ^ (n + 1 + 1 - 1)) x
[PROOFSTEP]
simpa [pow_succ', add_mul, mul_assoc] using (hasStrictDerivAt_pow (n + 1) x).mul (hasStrictDerivAt_id x)
[GOAL]
𝕜 : Type u
inst✝⁴ : NontriviallyNormedField 𝕜
F : Type v
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
E : Type w
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace 𝕜 E
f f₀ f₁ g : 𝕜 → F
f' f₀' f₁' g' : F
x : 𝕜
s t : Set 𝕜
L L₁ L₂ : Filter 𝕜
c : 𝕜 → 𝕜
c' : 𝕜
n : ℕ
hc : HasDerivAt c c' x
⊢ HasDerivAt (fun y => c y ^ n) (↑n * c x ^ (n - 1) * c') x
[PROOFSTEP]
rw [← hasDerivWithinAt_univ] at *
[GOAL]
𝕜 : Type u
inst✝⁴ : NontriviallyNormedField 𝕜
F : Type v
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
E : Type w
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace 𝕜 E
f f₀ f₁ g : 𝕜 → F
f' f₀' f₁' g' : F
x : 𝕜
s t : Set 𝕜
L L₁ L₂ : Filter 𝕜
c : 𝕜 → 𝕜
c' : 𝕜
n : ℕ
hc : HasDerivWithinAt c c' univ x
⊢ HasDerivWithinAt (fun y => c y ^ n) (↑n * c x ^ (n - 1) * c') univ x
[PROOFSTEP]
exact hc.pow n


[GOAL]
α : Type u_1
inst✝¹ : DecidableEq α
s : Finset α
P : Finpartition s
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
⊢ 0 ≤ energy P G
[PROOFSTEP]
refine' div_nonneg (Finset.sum_nonneg fun _ _ => sq_nonneg _) <| sq_nonneg _
[GOAL]
α : Type u_1
inst✝¹ : DecidableEq α
s : Finset α
P : Finpartition s
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
⊢ ↑(card (offDiag P.parts)) ≤ 1 * ↑(card P.parts) ^ 2
[PROOFSTEP]
rw [offDiag_card, one_mul]
[GOAL]
α : Type u_1
inst✝¹ : DecidableEq α
s : Finset α
P : Finpartition s
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
⊢ ↑(card P.parts * card P.parts - card P.parts) ≤ ↑(card P.parts) ^ 2
[PROOFSTEP]
norm_cast
[GOAL]
α : Type u_1
inst✝¹ : DecidableEq α
s : Finset α
P : Finpartition s
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
⊢ card P.parts * card P.parts - card P.parts ≤ card P.parts ^ 2
[PROOFSTEP]
rw [sq]
[GOAL]
α : Type u_1
inst✝¹ : DecidableEq α
s : Finset α
P : Finpartition s
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
⊢ card P.parts * card P.parts - card P.parts ≤ card P.parts * card P.parts
[PROOFSTEP]
exact tsub_le_self
[GOAL]
α : Type u_1
inst✝² : DecidableEq α
s : Finset α
P : Finpartition s
G : SimpleGraph α
inst✝¹ : DecidableRel G.Adj
𝕜 : Type u_2
inst✝ : LinearOrderedField 𝕜
⊢ ↑(energy P G) = (∑ uv in offDiag P.parts, ↑(SimpleGraph.edgeDensity G uv.fst uv.snd) ^ 2) / ↑(card P.parts) ^ 2
[PROOFSTEP]
rw [energy]
[GOAL]
α : Type u_1
inst✝² : DecidableEq α
s : Finset α
P : Finpartition s
G : SimpleGraph α
inst✝¹ : DecidableRel G.Adj
𝕜 : Type u_2
inst✝ : LinearOrderedField 𝕜
⊢ ↑((∑ uv in offDiag P.parts, SimpleGraph.edgeDensity G uv.fst uv.snd ^ 2) / ↑(card P.parts) ^ 2) =
    (∑ uv in offDiag P.parts, ↑(SimpleGraph.edgeDensity G uv.fst uv.snd) ^ 2) / ↑(card P.parts) ^ 2
[PROOFSTEP]
norm_cast


[GOAL]
X Y : TopCat
f : X ⟶ Y
⊢ Epi f ↔ Function.Surjective ↑f
[PROOFSTEP]
suffices Epi f ↔ Epi ((forget TopCat).map f)
  by
  rw [this, CategoryTheory.epi_iff_surjective]
  rfl
[GOAL]
X Y : TopCat
f : X ⟶ Y
this : Epi f ↔ Epi ((forget TopCat).map f)
⊢ Epi f ↔ Function.Surjective ↑f
[PROOFSTEP]
rw [this, CategoryTheory.epi_iff_surjective]
[GOAL]
X Y : TopCat
f : X ⟶ Y
this : Epi f ↔ Epi ((forget TopCat).map f)
⊢ Function.Surjective ((forget TopCat).map f) ↔ Function.Surjective ↑f
[PROOFSTEP]
rfl
[GOAL]
X Y : TopCat
f : X ⟶ Y
⊢ Epi f ↔ Epi ((forget TopCat).map f)
[PROOFSTEP]
constructor
[GOAL]
case mp
X Y : TopCat
f : X ⟶ Y
⊢ Epi f → Epi ((forget TopCat).map f)
[PROOFSTEP]
intro
[GOAL]
case mp
X Y : TopCat
f : X ⟶ Y
a✝ : Epi f
⊢ Epi ((forget TopCat).map f)
[PROOFSTEP]
infer_instance
[GOAL]
case mpr
X Y : TopCat
f : X ⟶ Y
⊢ Epi ((forget TopCat).map f) → Epi f
[PROOFSTEP]
apply Functor.epi_of_epi_map
[GOAL]
X Y : TopCat
f : X ⟶ Y
⊢ Mono f ↔ Function.Injective ↑f
[PROOFSTEP]
suffices Mono f ↔ Mono ((forget TopCat).map f)
  by
  rw [this, CategoryTheory.mono_iff_injective]
  rfl
[GOAL]
X Y : TopCat
f : X ⟶ Y
this : Mono f ↔ Mono ((forget TopCat).map f)
⊢ Mono f ↔ Function.Injective ↑f
[PROOFSTEP]
rw [this, CategoryTheory.mono_iff_injective]
[GOAL]
X Y : TopCat
f : X ⟶ Y
this : Mono f ↔ Mono ((forget TopCat).map f)
⊢ Function.Injective ((forget TopCat).map f) ↔ Function.Injective ↑f
[PROOFSTEP]
rfl
[GOAL]
X Y : TopCat
f : X ⟶ Y
⊢ Mono f ↔ Mono ((forget TopCat).map f)
[PROOFSTEP]
constructor
[GOAL]
case mp
X Y : TopCat
f : X ⟶ Y
⊢ Mono f → Mono ((forget TopCat).map f)
[PROOFSTEP]
intro
[GOAL]
case mp
X Y : TopCat
f : X ⟶ Y
a✝ : Mono f
⊢ Mono ((forget TopCat).map f)
[PROOFSTEP]
infer_instance
[GOAL]
case mpr
X Y : TopCat
f : X ⟶ Y
⊢ Mono ((forget TopCat).map f) → Mono f
[PROOFSTEP]
apply Functor.mono_of_mono_map


[GOAL]
ι : Type u_1
α : ι → Type u_2
inst✝⁴ : Fintype ι
inst✝³ : DecidableEq ι
inst✝² : (i : ι) → DecidableEq (α i)
inst✝¹ : (i : ι) → PartialOrder (α i)
inst✝ : (i : ι) → LocallyFiniteOrder (α i)
a b x : (i : ι) → α i
⊢ x ∈ (fun a b => piFinset fun i => Icc (a i) (b i)) a b ↔ a ≤ x ∧ x ≤ b
[PROOFSTEP]
simp_rw [mem_piFinset, mem_Icc, le_def, forall_and]
[GOAL]
ι : Type u_1
α : ι → Type u_2
inst✝⁴ : Fintype ι
inst✝³ : DecidableEq ι
inst✝² : (i : ι) → DecidableEq (α i)
inst✝¹ : (i : ι) → PartialOrder (α i)
inst✝ : (i : ι) → LocallyFiniteOrder (α i)
a b : (i : ι) → α i
⊢ Finset.card (Ico a b) = ∏ i : ι, Finset.card (Icc (a i) (b i)) - 1
[PROOFSTEP]
rw [card_Ico_eq_card_Icc_sub_one, card_Icc]
[GOAL]
ι : Type u_1
α : ι → Type u_2
inst✝⁴ : Fintype ι
inst✝³ : DecidableEq ι
inst✝² : (i : ι) → DecidableEq (α i)
inst✝¹ : (i : ι) → PartialOrder (α i)
inst✝ : (i : ι) → LocallyFiniteOrder (α i)
a b : (i : ι) → α i
⊢ Finset.card (Ioc a b) = ∏ i : ι, Finset.card (Icc (a i) (b i)) - 1
[PROOFSTEP]
rw [card_Ioc_eq_card_Icc_sub_one, card_Icc]
[GOAL]
ι : Type u_1
α : ι → Type u_2
inst✝⁴ : Fintype ι
inst✝³ : DecidableEq ι
inst✝² : (i : ι) → DecidableEq (α i)
inst✝¹ : (i : ι) → PartialOrder (α i)
inst✝ : (i : ι) → LocallyFiniteOrder (α i)
a b : (i : ι) → α i
⊢ Finset.card (Ioo a b) = ∏ i : ι, Finset.card (Icc (a i) (b i)) - 2
[PROOFSTEP]
rw [card_Ioo_eq_card_Icc_sub_two, card_Icc]
[GOAL]
ι : Type u_1
α : ι → Type u_2
inst✝⁴ : Fintype ι
inst✝³ : DecidableEq ι
inst✝² : (i : ι) → DecidableEq (α i)
inst✝¹ : (i : ι) → PartialOrder (α i)
inst✝ : (i : ι) → LocallyFiniteOrderBot (α i)
b✝ b x : (i : ι) → α i
⊢ x ∈ (fun b => piFinset fun i => Iic (b i)) b ↔ x ≤ b
[PROOFSTEP]
simp_rw [mem_piFinset, mem_Iic, le_def]
[GOAL]
ι : Type u_1
α : ι → Type u_2
inst✝⁴ : Fintype ι
inst✝³ : DecidableEq ι
inst✝² : (i : ι) → DecidableEq (α i)
inst✝¹ : (i : ι) → PartialOrder (α i)
inst✝ : (i : ι) → LocallyFiniteOrderBot (α i)
b : (i : ι) → α i
⊢ Finset.card (Iio b) = ∏ i : ι, Finset.card (Iic (b i)) - 1
[PROOFSTEP]
rw [card_Iio_eq_card_Iic_sub_one, card_Iic]
[GOAL]
ι : Type u_1
α : ι → Type u_2
inst✝⁴ : Fintype ι
inst✝³ : DecidableEq ι
inst✝² : (i : ι) → DecidableEq (α i)
inst✝¹ : (i : ι) → PartialOrder (α i)
inst✝ : (i : ι) → LocallyFiniteOrderTop (α i)
a✝ a x : (i : ι) → α i
⊢ x ∈ (fun a => piFinset fun i => Ici (a i)) a ↔ a ≤ x
[PROOFSTEP]
simp_rw [mem_piFinset, mem_Ici, le_def]
[GOAL]
ι : Type u_1
α : ι → Type u_2
inst✝⁴ : Fintype ι
inst✝³ : DecidableEq ι
inst✝² : (i : ι) → DecidableEq (α i)
inst✝¹ : (i : ι) → PartialOrder (α i)
inst✝ : (i : ι) → LocallyFiniteOrderTop (α i)
a : (i : ι) → α i
⊢ Finset.card (Ioi a) = ∏ i : ι, Finset.card (Ici (a i)) - 1
[PROOFSTEP]
rw [card_Ioi_eq_card_Ici_sub_one, card_Ici]


[GOAL]
K : Type u_1
V₁ : Type u_2
V₂ : Type u_3
ι₁ : Type u_4
ι₂ : Type u_5
inst✝⁸ : Field K
inst✝⁷ : AddCommGroup V₁
inst✝⁶ : Module K V₁
inst✝⁵ : AddCommGroup V₂
inst✝⁴ : Module K V₂
inst✝³ : Fintype ι₁
inst✝² : Fintype ι₂
inst✝¹ : DecidableEq ι₁
inst✝ : DecidableEq ι₂
B₁ : Basis ι₁ K V₁
B₂ : Basis ι₂ K V₂
u : V₁ →ₗ[K] V₂
⊢ ↑(toMatrix (Basis.dualBasis B₂) (Basis.dualBasis B₁)) (↑Module.Dual.transpose u) = (↑(toMatrix B₁ B₂) u)ᵀ
[PROOFSTEP]
ext i j
[GOAL]
case a.h
K : Type u_1
V₁ : Type u_2
V₂ : Type u_3
ι₁ : Type u_4
ι₂ : Type u_5
inst✝⁸ : Field K
inst✝⁷ : AddCommGroup V₁
inst✝⁶ : Module K V₁
inst✝⁵ : AddCommGroup V₂
inst✝⁴ : Module K V₂
inst✝³ : Fintype ι₁
inst✝² : Fintype ι₂
inst✝¹ : DecidableEq ι₁
inst✝ : DecidableEq ι₂
B₁ : Basis ι₁ K V₁
B₂ : Basis ι₂ K V₂
u : V₁ →ₗ[K] V₂
i : ι₁
j : ι₂
⊢ ↑(toMatrix (Basis.dualBasis B₂) (Basis.dualBasis B₁)) (↑Module.Dual.transpose u) i j = (↑(toMatrix B₁ B₂) u)ᵀ i j
[PROOFSTEP]
simp only [LinearMap.toMatrix_apply, Module.Dual.transpose_apply, B₁.dualBasis_repr, B₂.dualBasis_apply,
  Matrix.transpose_apply, LinearMap.comp_apply]
[GOAL]
K : Type u_1
V₁ : Type u_2
V₂ : Type u_3
ι₁ : Type u_4
ι₂ : Type u_5
inst✝⁸ : Field K
inst✝⁷ : AddCommGroup V₁
inst✝⁶ : Module K V₁
inst✝⁵ : AddCommGroup V₂
inst✝⁴ : Module K V₂
inst✝³ : Fintype ι₁
inst✝² : Fintype ι₂
inst✝¹ : DecidableEq ι₁
inst✝ : DecidableEq ι₂
B₁ : Basis ι₁ K V₁
B₂ : Basis ι₂ K V₂
M : Matrix ι₁ ι₂ K
⊢ ↑(toLin (Basis.dualBasis B₁) (Basis.dualBasis B₂)) Mᵀ = ↑Module.Dual.transpose (↑(toLin B₂ B₁) M)
[PROOFSTEP]
apply (LinearMap.toMatrix B₁.dualBasis B₂.dualBasis).injective
[GOAL]
case a
K : Type u_1
V₁ : Type u_2
V₂ : Type u_3
ι₁ : Type u_4
ι₂ : Type u_5
inst✝⁸ : Field K
inst✝⁷ : AddCommGroup V₁
inst✝⁶ : Module K V₁
inst✝⁵ : AddCommGroup V₂
inst✝⁴ : Module K V₂
inst✝³ : Fintype ι₁
inst✝² : Fintype ι₂
inst✝¹ : DecidableEq ι₁
inst✝ : DecidableEq ι₂
B₁ : Basis ι₁ K V₁
B₂ : Basis ι₂ K V₂
M : Matrix ι₁ ι₂ K
⊢ ↑(LinearMap.toMatrix (Basis.dualBasis B₁) (Basis.dualBasis B₂))
      (↑(toLin (Basis.dualBasis B₁) (Basis.dualBasis B₂)) Mᵀ) =
    ↑(LinearMap.toMatrix (Basis.dualBasis B₁) (Basis.dualBasis B₂)) (↑Module.Dual.transpose (↑(toLin B₂ B₁) M))
[PROOFSTEP]
rw [LinearMap.toMatrix_toLin, LinearMap.toMatrix_transpose, LinearMap.toMatrix_toLin]


[GOAL]
n : ℕ
ε : ℝ
hε : 0 < ε
b : ℤ
hb : b ≠ 0
A : Fin n → ℤ
⊢ ∃ t, ∀ (i₀ i₁ : Fin n), t i₀ = t i₁ → ↑|A i₁ % b - A i₀ % b| < |b| • ε
[PROOFSTEP]
have hb' : (0 : ℝ) < ↑(abs b) := Int.cast_pos.mpr (abs_pos.mpr hb)
[GOAL]
n : ℕ
ε : ℝ
hε : 0 < ε
b : ℤ
hb : b ≠ 0
A : Fin n → ℤ
hb' : 0 < ↑|b|
⊢ ∃ t, ∀ (i₀ i₁ : Fin n), t i₀ = t i₁ → ↑|A i₁ % b - A i₀ % b| < |b| • ε
[PROOFSTEP]
have hbε : 0 < abs b • ε := by
  rw [Algebra.smul_def]
  exact mul_pos hb' hε
[GOAL]
n : ℕ
ε : ℝ
hε : 0 < ε
b : ℤ
hb : b ≠ 0
A : Fin n → ℤ
hb' : 0 < ↑|b|
⊢ 0 < |b| • ε
[PROOFSTEP]
rw [Algebra.smul_def]
[GOAL]
n : ℕ
ε : ℝ
hε : 0 < ε
b : ℤ
hb : b ≠ 0
A : Fin n → ℤ
hb' : 0 < ↑|b|
⊢ 0 < ↑(algebraMap ℤ ℝ) |b| * ε
[PROOFSTEP]
exact mul_pos hb' hε
[GOAL]
n : ℕ
ε : ℝ
hε : 0 < ε
b : ℤ
hb : b ≠ 0
A : Fin n → ℤ
hb' : 0 < ↑|b|
hbε : 0 < |b| • ε
⊢ ∃ t, ∀ (i₀ i₁ : Fin n), t i₀ = t i₁ → ↑|A i₁ % b - A i₀ % b| < |b| • ε
[PROOFSTEP]
have hfloor : ∀ i, 0 ≤ floor ((A i % b : ℤ) / abs b • ε : ℝ) := fun _ ↦
  floor_nonneg.mpr (div_nonneg (cast_nonneg.mpr (emod_nonneg _ hb)) hbε.le)
[GOAL]
n : ℕ
ε : ℝ
hε : 0 < ε
b : ℤ
hb : b ≠ 0
A : Fin n → ℤ
hb' : 0 < ↑|b|
hbε : 0 < |b| • ε
hfloor : ∀ (i : Fin n), 0 ≤ ⌊↑(A i % b) / |b| • ε⌋
⊢ ∃ t, ∀ (i₀ i₁ : Fin n), t i₀ = t i₁ → ↑|A i₁ % b - A i₀ % b| < |b| • ε
[PROOFSTEP]
refine' ⟨fun i ↦ ⟨natAbs (floor ((A i % b : ℤ) / abs b • ε : ℝ)), _⟩, _⟩
[GOAL]
case refine'_1
n : ℕ
ε : ℝ
hε : 0 < ε
b : ℤ
hb : b ≠ 0
A : Fin n → ℤ
hb' : 0 < ↑|b|
hbε : 0 < |b| • ε
hfloor : ∀ (i : Fin n), 0 ≤ ⌊↑(A i % b) / |b| • ε⌋
i : Fin n
⊢ natAbs ⌊↑(A i % b) / |b| • ε⌋ < ⌈1 / ε⌉₊
[PROOFSTEP]
rw [← ofNat_lt, natAbs_of_nonneg (hfloor i), floor_lt]
[GOAL]
case refine'_1
n : ℕ
ε : ℝ
hε : 0 < ε
b : ℤ
hb : b ≠ 0
A : Fin n → ℤ
hb' : 0 < ↑|b|
hbε : 0 < |b| • ε
hfloor : ∀ (i : Fin n), 0 ≤ ⌊↑(A i % b) / |b| • ε⌋
i : Fin n
⊢ ↑(A i % b) / |b| • ε < ↑↑⌈1 / ε⌉₊
[PROOFSTEP]
apply lt_of_lt_of_le _ (Nat.le_ceil _)
[GOAL]
n : ℕ
ε : ℝ
hε : 0 < ε
b : ℤ
hb : b ≠ 0
A : Fin n → ℤ
hb' : 0 < ↑|b|
hbε : 0 < |b| • ε
hfloor : ∀ (i : Fin n), 0 ≤ ⌊↑(A i % b) / |b| • ε⌋
i : Fin n
⊢ ↑(A i % b) / |b| • ε < 1 / ε
[PROOFSTEP]
rw [Algebra.smul_def, eq_intCast, ← div_div, div_lt_div_right hε, div_lt_iff hb', one_mul, cast_lt]
[GOAL]
n : ℕ
ε : ℝ
hε : 0 < ε
b : ℤ
hb : b ≠ 0
A : Fin n → ℤ
hb' : 0 < ↑|b|
hbε : 0 < |b| • ε
hfloor : ∀ (i : Fin n), 0 ≤ ⌊↑(A i % b) / |b| • ε⌋
i : Fin n
⊢ A i % b < |b|
[PROOFSTEP]
exact Int.emod_lt _ hb
[GOAL]
case refine'_2
n : ℕ
ε : ℝ
hε : 0 < ε
b : ℤ
hb : b ≠ 0
A : Fin n → ℤ
hb' : 0 < ↑|b|
hbε : 0 < |b| • ε
hfloor : ∀ (i : Fin n), 0 ≤ ⌊↑(A i % b) / |b| • ε⌋
⊢ ∀ (i₀ i₁ : Fin n),
    (fun i => { val := natAbs ⌊↑(A i % b) / |b| • ε⌋, isLt := (_ : natAbs ⌊↑(A i % b) / |b| • ε⌋ < ⌈1 / ε⌉₊) }) i₀ =
        (fun i => { val := natAbs ⌊↑(A i % b) / |b| • ε⌋, isLt := (_ : natAbs ⌊↑(A i % b) / |b| • ε⌋ < ⌈1 / ε⌉₊) }) i₁ →
      ↑|A i₁ % b - A i₀ % b| < |b| • ε
[PROOFSTEP]
intro i₀ i₁ hi
[GOAL]
case refine'_2
n : ℕ
ε : ℝ
hε : 0 < ε
b : ℤ
hb : b ≠ 0
A : Fin n → ℤ
hb' : 0 < ↑|b|
hbε : 0 < |b| • ε
hfloor : ∀ (i : Fin n), 0 ≤ ⌊↑(A i % b) / |b| • ε⌋
i₀ i₁ : Fin n
hi :
  (fun i => { val := natAbs ⌊↑(A i % b) / |b| • ε⌋, isLt := (_ : natAbs ⌊↑(A i % b) / |b| • ε⌋ < ⌈1 / ε⌉₊) }) i₀ =
    (fun i => { val := natAbs ⌊↑(A i % b) / |b| • ε⌋, isLt := (_ : natAbs ⌊↑(A i % b) / |b| • ε⌋ < ⌈1 / ε⌉₊) }) i₁
⊢ ↑|A i₁ % b - A i₀ % b| < |b| • ε
[PROOFSTEP]
have hi : (⌊↑(A i₀ % b) / abs b • ε⌋.natAbs : ℤ) = ⌊↑(A i₁ % b) / abs b • ε⌋.natAbs :=
  congr_arg ((↑) : ℕ → ℤ) (Fin.mk_eq_mk.mp hi)
[GOAL]
case refine'_2
n : ℕ
ε : ℝ
hε : 0 < ε
b : ℤ
hb : b ≠ 0
A : Fin n → ℤ
hb' : 0 < ↑|b|
hbε : 0 < |b| • ε
hfloor : ∀ (i : Fin n), 0 ≤ ⌊↑(A i % b) / |b| • ε⌋
i₀ i₁ : Fin n
hi✝ :
  (fun i => { val := natAbs ⌊↑(A i % b) / |b| • ε⌋, isLt := (_ : natAbs ⌊↑(A i % b) / |b| • ε⌋ < ⌈1 / ε⌉₊) }) i₀ =
    (fun i => { val := natAbs ⌊↑(A i % b) / |b| • ε⌋, isLt := (_ : natAbs ⌊↑(A i % b) / |b| • ε⌋ < ⌈1 / ε⌉₊) }) i₁
hi : ↑(natAbs ⌊↑(A i₀ % b) / |b| • ε⌋) = ↑(natAbs ⌊↑(A i₁ % b) / |b| • ε⌋)
⊢ ↑|A i₁ % b - A i₀ % b| < |b| • ε
[PROOFSTEP]
rw [natAbs_of_nonneg (hfloor i₀), natAbs_of_nonneg (hfloor i₁)] at hi
[GOAL]
case refine'_2
n : ℕ
ε : ℝ
hε : 0 < ε
b : ℤ
hb : b ≠ 0
A : Fin n → ℤ
hb' : 0 < ↑|b|
hbε : 0 < |b| • ε
hfloor : ∀ (i : Fin n), 0 ≤ ⌊↑(A i % b) / |b| • ε⌋
i₀ i₁ : Fin n
hi✝ :
  (fun i => { val := natAbs ⌊↑(A i % b) / |b| • ε⌋, isLt := (_ : natAbs ⌊↑(A i % b) / |b| • ε⌋ < ⌈1 / ε⌉₊) }) i₀ =
    (fun i => { val := natAbs ⌊↑(A i % b) / |b| • ε⌋, isLt := (_ : natAbs ⌊↑(A i % b) / |b| • ε⌋ < ⌈1 / ε⌉₊) }) i₁
hi : ⌊↑(A i₀ % b) / |b| • ε⌋ = ⌊↑(A i₁ % b) / |b| • ε⌋
⊢ ↑|A i₁ % b - A i₀ % b| < |b| • ε
[PROOFSTEP]
have hi := abs_sub_lt_one_of_floor_eq_floor hi
[GOAL]
case refine'_2
n : ℕ
ε : ℝ
hε : 0 < ε
b : ℤ
hb : b ≠ 0
A : Fin n → ℤ
hb' : 0 < ↑|b|
hbε : 0 < |b| • ε
hfloor : ∀ (i : Fin n), 0 ≤ ⌊↑(A i % b) / |b| • ε⌋
i₀ i₁ : Fin n
hi✝¹ :
  (fun i => { val := natAbs ⌊↑(A i % b) / |b| • ε⌋, isLt := (_ : natAbs ⌊↑(A i % b) / |b| • ε⌋ < ⌈1 / ε⌉₊) }) i₀ =
    (fun i => { val := natAbs ⌊↑(A i % b) / |b| • ε⌋, isLt := (_ : natAbs ⌊↑(A i % b) / |b| • ε⌋ < ⌈1 / ε⌉₊) }) i₁
hi✝ : ⌊↑(A i₀ % b) / |b| • ε⌋ = ⌊↑(A i₁ % b) / |b| • ε⌋
hi : |↑(A i₀ % b) / |b| • ε - ↑(A i₁ % b) / |b| • ε| < 1
⊢ ↑|A i₁ % b - A i₀ % b| < |b| • ε
[PROOFSTEP]
rw [abs_sub_comm, ← sub_div, abs_div, abs_of_nonneg hbε.le, div_lt_iff hbε, one_mul] at hi
[GOAL]
case refine'_2
n : ℕ
ε : ℝ
hε : 0 < ε
b : ℤ
hb : b ≠ 0
A : Fin n → ℤ
hb' : 0 < ↑|b|
hbε : 0 < |b| • ε
hfloor : ∀ (i : Fin n), 0 ≤ ⌊↑(A i % b) / |b| • ε⌋
i₀ i₁ : Fin n
hi✝¹ :
  (fun i => { val := natAbs ⌊↑(A i % b) / |b| • ε⌋, isLt := (_ : natAbs ⌊↑(A i % b) / |b| • ε⌋ < ⌈1 / ε⌉₊) }) i₀ =
    (fun i => { val := natAbs ⌊↑(A i % b) / |b| • ε⌋, isLt := (_ : natAbs ⌊↑(A i % b) / |b| • ε⌋ < ⌈1 / ε⌉₊) }) i₁
hi✝ : ⌊↑(A i₀ % b) / |b| • ε⌋ = ⌊↑(A i₁ % b) / |b| • ε⌋
hi : |↑(A i₁ % b) - ↑(A i₀ % b)| < |b| • ε
⊢ ↑|A i₁ % b - A i₀ % b| < |b| • ε
[PROOFSTEP]
rwa [Int.cast_abs, Int.cast_sub]


[GOAL]
𝕜 : Type u_1
inst✝⁶ : NontriviallyNormedField 𝕜
E : Type u_2
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
F : Type u_3
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
G : Type u_4
inst✝¹ : NormedAddCommGroup G
inst✝ : NormedSpace 𝕜 G
f : E →L[𝕜] F
x : E
⊢ ⊤ ≤ FormalMultilinearSeries.radius (fpowerSeries f x)
[PROOFSTEP]
simp
[GOAL]
𝕜 : Type u_1
inst✝⁶ : NontriviallyNormedField 𝕜
E : Type u_2
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
F : Type u_3
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
G : Type u_4
inst✝¹ : NormedAddCommGroup G
inst✝ : NormedSpace 𝕜 G
f : E →L[𝕜] F
x y✝ : E
x✝ : y✝ ∈ EMetric.ball 0 ⊤
⊢ HasSum (fun n => ↑(fpowerSeries f x (n + 2)) fun x => y✝)
    (↑f (x + y✝) - ∑ i in Finset.range 2, ↑(fpowerSeries f x i) fun x => y✝)
[PROOFSTEP]
simp [Finset.sum_range_succ, ← sub_sub, hasSum_zero, fpowerSeries]
[GOAL]
𝕜 : Type u_1
inst✝⁶ : NontriviallyNormedField 𝕜
E : Type u_2
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
F : Type u_3
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
G : Type u_4
inst✝¹ : NormedAddCommGroup G
inst✝ : NormedSpace 𝕜 G
f : E →L[𝕜] F →L[𝕜] G
x : E × F
⊢ ⊤ ≤ FormalMultilinearSeries.radius (fpowerSeriesBilinear f x)
[PROOFSTEP]
simp
[GOAL]
𝕜 : Type u_1
inst✝⁶ : NontriviallyNormedField 𝕜
E : Type u_2
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
F : Type u_3
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
G : Type u_4
inst✝¹ : NormedAddCommGroup G
inst✝ : NormedSpace 𝕜 G
f : E →L[𝕜] F →L[𝕜] G
x y✝ : E × F
x✝ : y✝ ∈ EMetric.ball 0 ⊤
⊢ HasSum (fun n => ↑(fpowerSeriesBilinear f x (n + 3)) fun x => y✝)
    (↑(↑f (x + y✝).fst) (x + y✝).snd - ∑ i in Finset.range 3, ↑(fpowerSeriesBilinear f x i) fun x => y✝)
[PROOFSTEP]
simp only [Finset.sum_range_succ, Finset.sum_range_one, Prod.fst_add, Prod.snd_add, f.map_add_add]
[GOAL]
𝕜 : Type u_1
inst✝⁶ : NontriviallyNormedField 𝕜
E : Type u_2
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
F : Type u_3
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
G : Type u_4
inst✝¹ : NormedAddCommGroup G
inst✝ : NormedSpace 𝕜 G
f : E →L[𝕜] F →L[𝕜] G
x y✝ : E × F
x✝ : y✝ ∈ EMetric.ball 0 ⊤
⊢ HasSum (fun n => ↑(fpowerSeriesBilinear f x (n + 3)) fun x => y✝)
    (↑(↑f x.fst) x.snd + ↑(↑(deriv₂ f) (x.fst, x.snd)) (y✝.fst, y✝.snd) + ↑(↑f y✝.fst) y✝.snd -
      ((((∑ x_1 in Finset.range 0, ↑(fpowerSeriesBilinear f x x_1) fun x => y✝) +
            ↑(fpowerSeriesBilinear f x 0) fun x => y✝) +
          ↑(fpowerSeriesBilinear f x 1) fun x => y✝) +
        ↑(fpowerSeriesBilinear f x 2) fun x => y✝))
[PROOFSTEP]
simp [fpowerSeriesBilinear, hasSum_zero]


[GOAL]
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : Fintype α
n : ℕ
⊢ card ↑(derangements (Fin (n + 2))) =
    (n + 1) * card ↑(derangements (Fin n)) + (n + 1) * card ↑(derangements (Fin (n + 1)))
[PROOFSTEP]
have h1 : ∀ a : Fin (n + 1), card ({ a }ᶜ : Set (Fin (n + 1))) = card (Fin n) :=
  by
  intro a
  simp only [Fintype.card_fin, Finset.card_fin, Fintype.card_ofFinset, Finset.filter_ne' _ a,
    Set.mem_compl_singleton_iff, Finset.card_erase_of_mem (Finset.mem_univ a), add_tsub_cancel_right]
[GOAL]
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : Fintype α
n : ℕ
⊢ ∀ (a : Fin (n + 1)), card ↑{a}ᶜ = card (Fin n)
[PROOFSTEP]
intro a
[GOAL]
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : Fintype α
n : ℕ
a : Fin (n + 1)
⊢ card ↑{a}ᶜ = card (Fin n)
[PROOFSTEP]
simp only [Fintype.card_fin, Finset.card_fin, Fintype.card_ofFinset, Finset.filter_ne' _ a, Set.mem_compl_singleton_iff,
  Finset.card_erase_of_mem (Finset.mem_univ a), add_tsub_cancel_right]
[GOAL]
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : Fintype α
n : ℕ
h1 : ∀ (a : Fin (n + 1)), card ↑{a}ᶜ = card (Fin n)
⊢ card ↑(derangements (Fin (n + 2))) =
    (n + 1) * card ↑(derangements (Fin n)) + (n + 1) * card ↑(derangements (Fin (n + 1)))
[PROOFSTEP]
have h2 : card (Fin (n + 2)) = card (Option (Fin (n + 1))) := by
  simp only [card_fin, card_option]
    -- rewrite the LHS and substitute in our fintype-level equivalence
[GOAL]
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : Fintype α
n : ℕ
h1 : ∀ (a : Fin (n + 1)), card ↑{a}ᶜ = card (Fin n)
⊢ card (Fin (n + 2)) = card (Option (Fin (n + 1)))
[PROOFSTEP]
simp only [card_fin, card_option]
  -- rewrite the LHS and substitute in our fintype-level equivalence
[GOAL]
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : Fintype α
n : ℕ
h1 : ∀ (a : Fin (n + 1)), card ↑{a}ᶜ = card (Fin n)
h2 : card (Fin (n + 2)) = card (Option (Fin (n + 1)))
⊢ card ↑(derangements (Fin (n + 2))) =
    (n + 1) * card ↑(derangements (Fin n)) + (n + 1) * card ↑(derangements (Fin (n + 1)))
[PROOFSTEP]
simp only [card_derangements_invariant h2, card_congr (@derangementsRecursionEquiv (Fin (n + 1)) _),
  -- push the cardinality through the Σ and ⊕ so that we can use `card_n`card_sigma, card_sum,
  card_derangements_invariant (h1 _), Finset.sum_const, nsmul_eq_mul, Finset.card_fin, mul_add, Nat.cast_id]
[GOAL]
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : Fintype α
n : ℕ
⊢ ↑(numDerangements (n + 1)) = (↑n + 1) * ↑(numDerangements n) - (-1) ^ n
[PROOFSTEP]
induction' n with n hn
[GOAL]
case zero
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : Fintype α
⊢ ↑(numDerangements (Nat.zero + 1)) = (↑Nat.zero + 1) * ↑(numDerangements Nat.zero) - (-1) ^ Nat.zero
[PROOFSTEP]
rfl
[GOAL]
case succ
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : Fintype α
n : ℕ
hn : ↑(numDerangements (n + 1)) = (↑n + 1) * ↑(numDerangements n) - (-1) ^ n
⊢ ↑(numDerangements (Nat.succ n + 1)) = (↑(Nat.succ n) + 1) * ↑(numDerangements (Nat.succ n)) - (-1) ^ Nat.succ n
[PROOFSTEP]
simp only [numDerangements_add_two, hn, pow_succ, Int.ofNat_mul, Int.ofNat_add, Int.ofNat_succ]
[GOAL]
case succ
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : Fintype α
n : ℕ
hn : ↑(numDerangements (n + 1)) = (↑n + 1) * ↑(numDerangements n) - (-1) ^ n
⊢ (↑n + 1) * (↑(numDerangements n) + ((↑n + 1) * ↑(numDerangements n) - (-1) ^ n)) =
    (↑n + 1 + 1) * ((↑n + 1) * ↑(numDerangements n) - (-1) ^ n) - -1 * (-1) ^ n
[PROOFSTEP]
ring
[GOAL]
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : Fintype α
n : ℕ
⊢ card ↑(derangements (Fin n)) = numDerangements n
[PROOFSTEP]
induction' n using Nat.strong_induction_on with n hyp
[GOAL]
case h
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : Fintype α
n : ℕ
hyp : ∀ (m : ℕ), m < n → card ↑(derangements (Fin m)) = numDerangements m
⊢ card ↑(derangements (Fin n)) = numDerangements n
[PROOFSTEP]
rcases n with _ | _ | n
[GOAL]
case h.zero
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : Fintype α
hyp : ∀ (m : ℕ), m < Nat.zero → card ↑(derangements (Fin m)) = numDerangements m
⊢ card ↑(derangements (Fin Nat.zero)) = numDerangements Nat.zero
[PROOFSTEP]
convert_to card ↑{f : Perm (Fin 0) | ∀ (x : Fin 0), f x ≠ x} = _ using 2
[GOAL]
case h.zero.convert_2
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : Fintype α
hyp : ∀ (m : ℕ), m < Nat.zero → card ↑(derangements (Fin m)) = numDerangements m
⊢ card ↑{f | ∀ (x : Fin 0), ↑f x ≠ x} = numDerangements Nat.zero
[PROOFSTEP]
rfl
[GOAL]
case h.succ.zero
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : Fintype α
hyp : ∀ (m : ℕ), m < Nat.succ Nat.zero → card ↑(derangements (Fin m)) = numDerangements m
⊢ card ↑(derangements (Fin (Nat.succ Nat.zero))) = numDerangements (Nat.succ Nat.zero)
[PROOFSTEP]
convert_to card ↑{f : Perm (Fin 1) | ∀ (x : Fin 1), f x ≠ x} = _ using 2
[GOAL]
case h.succ.zero.convert_2
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : Fintype α
hyp : ∀ (m : ℕ), m < Nat.succ Nat.zero → card ↑(derangements (Fin m)) = numDerangements m
⊢ card ↑{f | ∀ (x : Fin 1), ↑f x ≠ x} = numDerangements (Nat.succ Nat.zero)
[PROOFSTEP]
rfl
  -- knock out cases 0 and 1
    -- now we have n ≥ 2. rewrite everything in terms of card_derangements, so that we can use
    -- `card_derangements_fin_add_two`
[GOAL]
case h.succ.succ
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : Fintype α
n : ℕ
hyp : ∀ (m : ℕ), m < Nat.succ (Nat.succ n) → card ↑(derangements (Fin m)) = numDerangements m
⊢ card ↑(derangements (Fin (Nat.succ (Nat.succ n)))) = numDerangements (Nat.succ (Nat.succ n))
[PROOFSTEP]
rw [numDerangements_add_two, card_derangements_fin_add_two, mul_add, hyp _ (Nat.lt_add_of_pos_right zero_lt_two),
  hyp _ (lt_add_one _)]
[GOAL]
α✝ : Type u_1
inst✝³ : DecidableEq α✝
inst✝² : Fintype α✝
α : Type u_2
inst✝¹ : Fintype α
inst✝ : DecidableEq α
⊢ card ↑(derangements α) = numDerangements (card α)
[PROOFSTEP]
rw [← card_derangements_invariant (card_fin _)]
[GOAL]
α✝ : Type u_1
inst✝³ : DecidableEq α✝
inst✝² : Fintype α✝
α : Type u_2
inst✝¹ : Fintype α
inst✝ : DecidableEq α
⊢ card ↑(derangements (Fin (card α))) = numDerangements (card α)
[PROOFSTEP]
exact card_derangements_fin_eq_numDerangements
[GOAL]
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : Fintype α
n : ℕ
⊢ ↑(numDerangements n) = ∑ k in Finset.range (n + 1), (-1) ^ k * ↑(Nat.ascFactorial k (n - k))
[PROOFSTEP]
induction' n with n hn
[GOAL]
case zero
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : Fintype α
⊢ ↑(numDerangements Nat.zero) = ∑ k in Finset.range (Nat.zero + 1), (-1) ^ k * ↑(Nat.ascFactorial k (Nat.zero - k))
[PROOFSTEP]
rfl
[GOAL]
case succ
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : Fintype α
n : ℕ
hn : ↑(numDerangements n) = ∑ k in Finset.range (n + 1), (-1) ^ k * ↑(Nat.ascFactorial k (n - k))
⊢ ↑(numDerangements (Nat.succ n)) =
    ∑ k in Finset.range (Nat.succ n + 1), (-1) ^ k * ↑(Nat.ascFactorial k (Nat.succ n - k))
[PROOFSTEP]
rw [Finset.sum_range_succ, numDerangements_succ, hn, Finset.mul_sum, tsub_self, Nat.ascFactorial_zero, Int.ofNat_one,
  mul_one, pow_succ, neg_one_mul, sub_eq_add_neg, add_left_inj, Finset.sum_congr rfl]
  -- show that (n + 1) * (-1)^x * asc_fac x (n - x) = (-1)^x * asc_fac x (n.succ - x)
[GOAL]
case succ
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : Fintype α
n : ℕ
hn : ↑(numDerangements n) = ∑ k in Finset.range (n + 1), (-1) ^ k * ↑(Nat.ascFactorial k (n - k))
⊢ ∀ (x : ℕ),
    x ∈ Finset.range (n + 1) →
      (↑n + 1) * ((-1) ^ x * ↑(Nat.ascFactorial x (n - x))) = (-1) ^ x * ↑(Nat.ascFactorial x (Nat.succ n - x))
[PROOFSTEP]
intro x hx
[GOAL]
case succ
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : Fintype α
n : ℕ
hn : ↑(numDerangements n) = ∑ k in Finset.range (n + 1), (-1) ^ k * ↑(Nat.ascFactorial k (n - k))
x : ℕ
hx : x ∈ Finset.range (n + 1)
⊢ (↑n + 1) * ((-1) ^ x * ↑(Nat.ascFactorial x (n - x))) = (-1) ^ x * ↑(Nat.ascFactorial x (Nat.succ n - x))
[PROOFSTEP]
have h_le : x ≤ n := Finset.mem_range_succ_iff.mp hx
[GOAL]
case succ
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : Fintype α
n : ℕ
hn : ↑(numDerangements n) = ∑ k in Finset.range (n + 1), (-1) ^ k * ↑(Nat.ascFactorial k (n - k))
x : ℕ
hx : x ∈ Finset.range (n + 1)
h_le : x ≤ n
⊢ (↑n + 1) * ((-1) ^ x * ↑(Nat.ascFactorial x (n - x))) = (-1) ^ x * ↑(Nat.ascFactorial x (Nat.succ n - x))
[PROOFSTEP]
rw [Nat.succ_sub h_le, Nat.ascFactorial_succ, add_tsub_cancel_of_le h_le, Int.ofNat_mul, Int.ofNat_succ, mul_left_comm]


[GOAL]
α : Type u_1
inst✝ : CommMonoid α
s : Multiset α
a✝ : α
l : List α
a : α
h : a ∈ Quotient.mk (List.isSetoid α) l
⊢ a ∣ prod (Quotient.mk (List.isSetoid α) l)
[PROOFSTEP]
simpa using List.dvd_prod h
[GOAL]
α : Type u_1
inst✝ : CanonicallyOrderedMonoid α
m : Multiset α
l : List α
⊢ prod (Quotient.mk (List.isSetoid α) l) = 1 ↔ ∀ (x : α), x ∈ Quotient.mk (List.isSetoid α) l → x = 1
[PROOFSTEP]
simpa using List.prod_eq_one_iff l
[GOAL]
α : Type u_1
R : Type u_2
inst✝¹ : CanonicallyOrderedCommSemiring R
inst✝ : Nontrivial R
m : Multiset R
⊢ 0 < Multiset.prod m ↔ ∀ (x : R), x ∈ m → 0 < x
[PROOFSTEP]
rcases m with ⟨l⟩
[GOAL]
case mk
α : Type u_1
R : Type u_2
inst✝¹ : CanonicallyOrderedCommSemiring R
inst✝ : Nontrivial R
m : Multiset R
l : List R
⊢ 0 < Multiset.prod (Quot.mk Setoid.r l) ↔ ∀ (x : R), x ∈ Quot.mk Setoid.r l → 0 < x
[PROOFSTEP]
rw [Multiset.quot_mk_to_coe'', Multiset.coe_prod]
[GOAL]
case mk
α : Type u_1
R : Type u_2
inst✝¹ : CanonicallyOrderedCommSemiring R
inst✝ : Nontrivial R
m : Multiset R
l : List R
⊢ 0 < List.prod l ↔ ∀ (x : R), x ∈ ↑l → 0 < x
[PROOFSTEP]
exact CanonicallyOrderedCommSemiring.list_prod_pos
[GOAL]
α : Type u_1
inst✝ : NonUnitalNonAssocSemiring α
s : Multiset α
a : α
h : ∀ (b : α), b ∈ s → Commute a b
⊢ Commute a (sum s)
[PROOFSTEP]
induction s using Quotient.inductionOn
[GOAL]
case h
α : Type u_1
inst✝ : NonUnitalNonAssocSemiring α
s : Multiset α
a : α
a✝ : List α
h : ∀ (b : α), b ∈ Quotient.mk (List.isSetoid α) a✝ → Commute a b
⊢ Commute a (sum (Quotient.mk (List.isSetoid α) a✝))
[PROOFSTEP]
rw [quot_mk_to_coe, coe_sum]
[GOAL]
case h
α : Type u_1
inst✝ : NonUnitalNonAssocSemiring α
s : Multiset α
a : α
a✝ : List α
h : ∀ (b : α), b ∈ Quotient.mk (List.isSetoid α) a✝ → Commute a b
⊢ Commute a (List.sum a✝)
[PROOFSTEP]
exact Commute.list_sum_right _ _ h


[GOAL]
𝕜 : Type u_1
𝕜' : Type u_2
E : Type u_3
inst✝⁴ : NormedField 𝕜
inst✝³ : NormedField 𝕜'
inst✝² : SeminormedAddCommGroup E
inst✝¹ : NormedSpace 𝕜 E
inst✝ : NormedSpace 𝕜' E
r : ℝ
c : ↑(closedBall 0 1)
x : ↑(ball 0 r)
⊢ ‖↑c • ↑x‖ < r
[PROOFSTEP]
simpa only [norm_smul, one_mul] using
  mul_lt_mul' (mem_closedBall_zero_iff.1 c.2) (mem_ball_zero_iff.1 x.2) (norm_nonneg _) one_pos
[GOAL]
𝕜 : Type u_1
𝕜' : Type u_2
E : Type u_3
inst✝⁴ : NormedField 𝕜
inst✝³ : NormedField 𝕜'
inst✝² : SeminormedAddCommGroup E
inst✝¹ : NormedSpace 𝕜 E
inst✝ : NormedSpace 𝕜' E
r : ℝ
c : ↑(closedBall 0 1)
x : ↑(closedBall 0 r)
⊢ ‖↑c • ↑x‖ ≤ r
[PROOFSTEP]
simpa only [norm_smul, one_mul] using
  mul_le_mul (mem_closedBall_zero_iff.1 c.2) (mem_closedBall_zero_iff.1 x.2) (norm_nonneg _) zero_le_one
[GOAL]
𝕜 : Type u_1
𝕜' : Type u_2
E : Type u_3
inst✝⁴ : NormedField 𝕜
inst✝³ : NormedField 𝕜'
inst✝² : SeminormedAddCommGroup E
inst✝¹ : NormedSpace 𝕜 E
inst✝ : NormedSpace 𝕜' E
r : ℝ
c : ↑(sphere 0 1)
x : ↑(sphere 0 r)
⊢ ‖↑c • ↑x‖ = r
[PROOFSTEP]
rw [norm_smul, mem_sphere_zero_iff_norm.1 c.coe_prop, mem_sphere_zero_iff_norm.1 x.coe_prop, one_mul]
[GOAL]
𝕜 : Type u_1
𝕜' : Type u_2
E : Type u_3
inst✝⁵ : NormedField 𝕜
inst✝⁴ : NormedField 𝕜'
inst✝³ : SeminormedAddCommGroup E
inst✝² : NormedSpace 𝕜 E
inst✝¹ : NormedSpace 𝕜' E
r✝ : ℝ
inst✝ : CharZero 𝕜
r : ℝ
hr : r ≠ 0
x : ↑(sphere 0 r)
h : x = -x
⊢ ↑x = -↑x
[PROOFSTEP]
conv_lhs => rw [h]
[GOAL]
𝕜 : Type u_1
𝕜' : Type u_2
E : Type u_3
inst✝⁵ : NormedField 𝕜
inst✝⁴ : NormedField 𝕜'
inst✝³ : SeminormedAddCommGroup E
inst✝² : NormedSpace 𝕜 E
inst✝¹ : NormedSpace 𝕜' E
r✝ : ℝ
inst✝ : CharZero 𝕜
r : ℝ
hr : r ≠ 0
x : ↑(sphere 0 r)
h : x = -x
| ↑x
[PROOFSTEP]
rw [h]
[GOAL]
𝕜 : Type u_1
𝕜' : Type u_2
E : Type u_3
inst✝⁵ : NormedField 𝕜
inst✝⁴ : NormedField 𝕜'
inst✝³ : SeminormedAddCommGroup E
inst✝² : NormedSpace 𝕜 E
inst✝¹ : NormedSpace 𝕜' E
r✝ : ℝ
inst✝ : CharZero 𝕜
r : ℝ
hr : r ≠ 0
x : ↑(sphere 0 r)
h : x = -x
| ↑x
[PROOFSTEP]
rw [h]
[GOAL]
𝕜 : Type u_1
𝕜' : Type u_2
E : Type u_3
inst✝⁵ : NormedField 𝕜
inst✝⁴ : NormedField 𝕜'
inst✝³ : SeminormedAddCommGroup E
inst✝² : NormedSpace 𝕜 E
inst✝¹ : NormedSpace 𝕜' E
r✝ : ℝ
inst✝ : CharZero 𝕜
r : ℝ
hr : r ≠ 0
x : ↑(sphere 0 r)
h : x = -x
| ↑x
[PROOFSTEP]
rw [h]


[GOAL]
n : ℕ
x : ℕ × ℕ
⊢ x ∈ antidiagonal n ↔ x.fst + x.snd = n
[PROOFSTEP]
rw [antidiagonal, mem_coe, List.Nat.mem_antidiagonal]
[GOAL]
n : ℕ
⊢ ↑card (antidiagonal n) = n + 1
[PROOFSTEP]
rw [antidiagonal, coe_card, List.Nat.length_antidiagonal]
[GOAL]
n : ℕ
⊢ antidiagonal (n + 1) = (0, n + 1) ::ₘ map (Prod.map Nat.succ id) (antidiagonal n)
[PROOFSTEP]
simp only [antidiagonal, List.Nat.antidiagonal_succ, coe_map, cons_coe]
[GOAL]
n : ℕ
⊢ antidiagonal (n + 1) = (n + 1, 0) ::ₘ map (Prod.map id Nat.succ) (antidiagonal n)
[PROOFSTEP]
rw [antidiagonal, List.Nat.antidiagonal_succ', ← coe_add, add_comm, antidiagonal, coe_map, coe_add,
  List.singleton_append, cons_coe]
[GOAL]
n : ℕ
⊢ antidiagonal (n + 2) = (0, n + 2) ::ₘ (n + 2, 0) ::ₘ map (Prod.map Nat.succ Nat.succ) (antidiagonal n)
[PROOFSTEP]
rw [antidiagonal_succ, antidiagonal_succ', map_cons, map_map, Prod_map]
[GOAL]
n : ℕ
⊢ (0, n + 1 + 1) ::ₘ
      (Nat.succ (n + 1, 0).fst, id (n + 1, 0).snd) ::ₘ
        map (Prod.map Nat.succ id ∘ Prod.map id Nat.succ) (antidiagonal n) =
    (0, n + 2) ::ₘ (n + 2, 0) ::ₘ map (Prod.map Nat.succ Nat.succ) (antidiagonal n)
[PROOFSTEP]
rfl
[GOAL]
n : ℕ
⊢ map Prod.swap (antidiagonal n) = antidiagonal n
[PROOFSTEP]
rw [antidiagonal, coe_map, List.Nat.map_swap_antidiagonal, coe_reverse]


[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
σ : Type u_4
inst✝⁶ : CommSemiring R
inst✝⁵ : CommSemiring A
inst✝⁴ : CommSemiring B
inst✝³ : Algebra R A
inst✝² : Algebra A B
inst✝¹ : Algebra R B
inst✝ : IsScalarTower R A B
x : σ → B
p : MvPolynomial σ R
⊢ ↑(aeval x) (↑(map (algebraMap R A)) p) = ↑(aeval x) p
[PROOFSTEP]
rw [aeval_def, aeval_def, eval₂_map, IsScalarTower.algebraMap_eq R A B]
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
σ : Type u_4
inst✝⁶ : CommSemiring R
inst✝⁵ : CommSemiring A
inst✝⁴ : CommSemiring B
inst✝³ : Algebra R A
inst✝² : Algebra A B
inst✝¹ : Algebra R B
inst✝ : IsScalarTower R A B
x : σ → A
p : MvPolynomial σ R
⊢ ↑(aeval (↑(algebraMap A B) ∘ x)) p = ↑(algebraMap A B) (↑(aeval x) p)
[PROOFSTEP]
rw [aeval_def, aeval_def, ← coe_eval₂Hom, ← coe_eval₂Hom, map_eval₂Hom, ← IsScalarTower.algebraMap_eq]
  -- Porting note: added
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
σ : Type u_4
inst✝⁶ : CommSemiring R
inst✝⁵ : CommSemiring A
inst✝⁴ : CommSemiring B
inst✝³ : Algebra R A
inst✝² : Algebra A B
inst✝¹ : Algebra R B
inst✝ : IsScalarTower R A B
x : σ → A
p : MvPolynomial σ R
⊢ ↑(eval₂Hom (algebraMap R B) (↑(algebraMap A B) ∘ x)) p =
    ↑(eval₂Hom (algebraMap R B) fun i => ↑(algebraMap A B) (x i)) p
[PROOFSTEP]
simp only [Function.comp]
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
σ : Type u_4
inst✝⁸ : CommSemiring R
inst✝⁷ : CommSemiring A
inst✝⁶ : CommSemiring B
inst✝⁵ : Algebra R A
inst✝⁴ : Algebra A B
inst✝³ : Algebra R B
inst✝² : IsScalarTower R A B
inst✝¹ : NoZeroSMulDivisors A B
inst✝ : Nontrivial B
x : σ → A
p : MvPolynomial σ R
⊢ ↑(aeval (↑(algebraMap A B) ∘ x)) p = 0 ↔ ↑(aeval x) p = 0
[PROOFSTEP]
rw [aeval_algebraMap_apply, Algebra.algebraMap_eq_smul_one, smul_eq_zero, iff_false_intro (one_ne_zero' B),
  or_false_iff]
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
σ : Type u_4
inst✝⁶ : CommSemiring R
inst✝⁵ : CommSemiring A
inst✝⁴ : CommSemiring B
inst✝³ : Algebra R A
inst✝² : Algebra A B
inst✝¹ : Algebra R B
inst✝ : IsScalarTower R A B
x : σ → A
p : MvPolynomial σ R
h : Function.Injective ↑(algebraMap A B)
⊢ ↑(aeval (↑(algebraMap A B) ∘ x)) p = 0 ↔ ↑(aeval x) p = 0
[PROOFSTEP]
rw [aeval_algebraMap_apply, ← (algebraMap A B).map_zero, h.eq_iff]
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
σ : Type u_4
inst✝² : CommSemiring R
inst✝¹ : CommSemiring A
inst✝ : Algebra R A
S : Subalgebra R A
x : σ → { x // x ∈ S }
p : MvPolynomial σ R
⊢ ↑(aeval fun i => ↑(x i)) p = ↑(↑(aeval x) p)
[PROOFSTEP]
convert aeval_algebraMap_apply A x p


[GOAL]
n : Type u_1
inst✝² : Fintype n
inst✝¹ : DecidableEq n
R : Type u_2
inst✝ : Field R
A : Matrix n n R
hAps : Splits (RingHom.id R) (charpoly A)
⊢ det A = Multiset.prod (roots (charpoly A))
[PROOFSTEP]
rw [det_eq_sign_charpoly_coeff, ← charpoly_natDegree_eq_dim A,
  Polynomial.prod_roots_eq_coeff_zero_of_monic_of_split A.charpoly_monic hAps, ← mul_assoc, ← pow_two, pow_right_comm,
  neg_one_sq, one_pow, one_mul]
[GOAL]
n : Type u_1
inst✝² : Fintype n
inst✝¹ : DecidableEq n
R : Type u_2
inst✝ : Field R
A : Matrix n n R
hAps : Splits (RingHom.id R) (charpoly A)
⊢ trace A = Multiset.sum (roots (charpoly A))
[PROOFSTEP]
cases' isEmpty_or_nonempty n with h
[GOAL]
case inl
n : Type u_1
inst✝² : Fintype n
inst✝¹ : DecidableEq n
R : Type u_2
inst✝ : Field R
A : Matrix n n R
hAps : Splits (RingHom.id R) (charpoly A)
h : IsEmpty n
⊢ trace A = Multiset.sum (roots (charpoly A))
[PROOFSTEP]
rw [Matrix.trace, Fintype.sum_empty, Matrix.charpoly, det_eq_one_of_card_eq_zero (Fintype.card_eq_zero_iff.2 h),
  Polynomial.roots_one, Multiset.empty_eq_zero, Multiset.sum_zero]
[GOAL]
case inr
n : Type u_1
inst✝² : Fintype n
inst✝¹ : DecidableEq n
R : Type u_2
inst✝ : Field R
A : Matrix n n R
hAps : Splits (RingHom.id R) (charpoly A)
h✝ : Nonempty n
⊢ trace A = Multiset.sum (roots (charpoly A))
[PROOFSTEP]
rw [trace_eq_neg_charpoly_coeff, neg_eq_iff_eq_neg, ←
  Polynomial.sum_roots_eq_nextCoeff_of_monic_of_split A.charpoly_monic hAps, nextCoeff, charpoly_natDegree_eq_dim,
  if_neg (Fintype.card_ne_zero : Fintype.card n ≠ 0)]


[GOAL]
α : Type u
β : Type v
γ : Type w
inst✝ : CompleteLattice α
f : α →o α
p : α → Prop
step : ∀ (a : α), p a → a ≤ ↑lfp f → p (↑f a)
hSup : ∀ (s : Set α), (∀ (a : α), a ∈ s → p a) → p (sSup s)
⊢ p (↑lfp f)
[PROOFSTEP]
set s := {a | a ≤ lfp f ∧ p a}
[GOAL]
α : Type u
β : Type v
γ : Type w
inst✝ : CompleteLattice α
f : α →o α
p : α → Prop
step : ∀ (a : α), p a → a ≤ ↑lfp f → p (↑f a)
hSup : ∀ (s : Set α), (∀ (a : α), a ∈ s → p a) → p (sSup s)
s : Set α := {a | a ≤ ↑lfp f ∧ p a}
⊢ p (↑lfp f)
[PROOFSTEP]
specialize hSup s fun a => And.right
[GOAL]
α : Type u
β : Type v
γ : Type w
inst✝ : CompleteLattice α
f : α →o α
p : α → Prop
step : ∀ (a : α), p a → a ≤ ↑lfp f → p (↑f a)
s : Set α := {a | a ≤ ↑lfp f ∧ p a}
hSup : p (sSup s)
⊢ p (↑lfp f)
[PROOFSTEP]
suffices : sSup s = lfp f
[GOAL]
α : Type u
β : Type v
γ : Type w
inst✝ : CompleteLattice α
f : α →o α
p : α → Prop
step : ∀ (a : α), p a → a ≤ ↑lfp f → p (↑f a)
s : Set α := {a | a ≤ ↑lfp f ∧ p a}
hSup : p (sSup s)
this : sSup s = ↑lfp f
⊢ p (↑lfp f)
case this
α : Type u
β : Type v
γ : Type w
inst✝ : CompleteLattice α
f : α →o α
p : α → Prop
step : ∀ (a : α), p a → a ≤ ↑lfp f → p (↑f a)
s : Set α := {a | a ≤ ↑lfp f ∧ p a}
hSup : p (sSup s)
⊢ sSup s = ↑lfp f
[PROOFSTEP]
exact this ▸ hSup
[GOAL]
case this
α : Type u
β : Type v
γ : Type w
inst✝ : CompleteLattice α
f : α →o α
p : α → Prop
step : ∀ (a : α), p a → a ≤ ↑lfp f → p (↑f a)
s : Set α := {a | a ≤ ↑lfp f ∧ p a}
hSup : p (sSup s)
⊢ sSup s = ↑lfp f
[PROOFSTEP]
have h : sSup s ≤ lfp f := sSup_le fun b => And.left
[GOAL]
case this
α : Type u
β : Type v
γ : Type w
inst✝ : CompleteLattice α
f : α →o α
p : α → Prop
step : ∀ (a : α), p a → a ≤ ↑lfp f → p (↑f a)
s : Set α := {a | a ≤ ↑lfp f ∧ p a}
hSup : p (sSup s)
h : sSup s ≤ ↑lfp f
⊢ sSup s = ↑lfp f
[PROOFSTEP]
have hmem : f (sSup s) ∈ s := ⟨f.map_le_lfp h, step _ hSup h⟩
[GOAL]
case this
α : Type u
β : Type v
γ : Type w
inst✝ : CompleteLattice α
f : α →o α
p : α → Prop
step : ∀ (a : α), p a → a ≤ ↑lfp f → p (↑f a)
s : Set α := {a | a ≤ ↑lfp f ∧ p a}
hSup : p (sSup s)
h : sSup s ≤ ↑lfp f
hmem : ↑f (sSup s) ∈ s
⊢ sSup s = ↑lfp f
[PROOFSTEP]
exact h.antisymm (f.lfp_le <| le_sSup hmem)
[GOAL]
α : Type u
β : Type v
γ : Type w
inst✝¹ : CompleteLattice α
inst✝ : CompleteLattice β
f : β →o α
g : α →o β
h : α →o α →o α
⊢ ↑lfp (comp lfp h) = ↑lfp (onDiag h)
[PROOFSTEP]
let a := lfp (lfp.comp h)
[GOAL]
α : Type u
β : Type v
γ : Type w
inst✝¹ : CompleteLattice α
inst✝ : CompleteLattice β
f : β →o α
g : α →o β
h : α →o α →o α
a : α := ↑lfp (comp lfp h)
⊢ ↑lfp (comp lfp h) = ↑lfp (onDiag h)
[PROOFSTEP]
refine' (lfp_le _ _).antisymm (lfp_le _ (Eq.le _))
[GOAL]
case refine'_1
α : Type u
β : Type v
γ : Type w
inst✝¹ : CompleteLattice α
inst✝ : CompleteLattice β
f : β →o α
g : α →o β
h : α →o α →o α
a : α := ↑lfp (comp lfp h)
⊢ ↑(comp lfp h) (↑lfp (onDiag h)) ≤ ↑lfp (onDiag h)
[PROOFSTEP]
exact lfp_le _ h.onDiag.map_lfp.le
[GOAL]
case refine'_2
α : Type u
β : Type v
γ : Type w
inst✝¹ : CompleteLattice α
inst✝ : CompleteLattice β
f : β →o α
g : α →o β
h : α →o α →o α
a : α := ↑lfp (comp lfp h)
⊢ ↑(onDiag h) (↑lfp (comp lfp h)) = ↑lfp (comp lfp h)
[PROOFSTEP]
have ha : (lfp ∘ h) a = a := (lfp.comp h).map_lfp
[GOAL]
case refine'_2
α : Type u
β : Type v
γ : Type w
inst✝¹ : CompleteLattice α
inst✝ : CompleteLattice β
f : β →o α
g : α →o β
h : α →o α →o α
a : α := ↑lfp (comp lfp h)
ha : (↑lfp ∘ ↑h) a = a
⊢ ↑(onDiag h) (↑lfp (comp lfp h)) = ↑lfp (comp lfp h)
[PROOFSTEP]
calc
  h a a = h a (lfp (h a)) := congr_arg (h a) ha.symm
  _ = lfp (h a) := (h a).map_lfp
  _ = a := ha


[GOAL]
p : ℕ
p_prime : Nat.Prime p
m n : ℤ
k l : ℕ
hpm : ↑(p ^ k) ∣ m
hpn : ↑(p ^ l) ∣ n
hpmn : ↑(p ^ (k + l + 1)) ∣ m * n
hpm' : p ^ k ∣ natAbs m
hpn' : p ^ l ∣ natAbs n
⊢ p ^ (k + l + 1) ∣ natAbs m * natAbs n
[PROOFSTEP]
rw [← Int.natAbs_mul]
[GOAL]
p : ℕ
p_prime : Nat.Prime p
m n : ℤ
k l : ℕ
hpm : ↑(p ^ k) ∣ m
hpn : ↑(p ^ l) ∣ n
hpmn : ↑(p ^ (k + l + 1)) ∣ m * n
hpm' : p ^ k ∣ natAbs m
hpn' : p ^ l ∣ natAbs n
⊢ p ^ (k + l + 1) ∣ natAbs (m * n)
[PROOFSTEP]
apply Int.coe_nat_dvd.1 <| Int.dvd_natAbs.2 hpmn
[GOAL]
p : ℕ
p_prime : Nat.Prime p
m n : ℤ
k l : ℕ
hpm : ↑(p ^ k) ∣ m
hpn : ↑(p ^ l) ∣ n
hpmn : ↑(p ^ (k + l + 1)) ∣ m * n
hpm' : p ^ k ∣ natAbs m
hpn' : p ^ l ∣ natAbs n
hpmn' : p ^ (k + l + 1) ∣ natAbs m * natAbs n
hsd : p ^ (k + 1) ∣ natAbs m ∨ p ^ (l + 1) ∣ natAbs n :=
  Nat.succ_dvd_or_succ_dvd_of_succ_sum_dvd_mul p_prime hpm' hpn' hpmn'
hsd1 : p ^ (k + 1) ∣ natAbs m
⊢ ↑(p ^ (k + 1)) ∣ m
[PROOFSTEP]
apply Int.dvd_natAbs.1
[GOAL]
p : ℕ
p_prime : Nat.Prime p
m n : ℤ
k l : ℕ
hpm : ↑(p ^ k) ∣ m
hpn : ↑(p ^ l) ∣ n
hpmn : ↑(p ^ (k + l + 1)) ∣ m * n
hpm' : p ^ k ∣ natAbs m
hpn' : p ^ l ∣ natAbs n
hpmn' : p ^ (k + l + 1) ∣ natAbs m * natAbs n
hsd : p ^ (k + 1) ∣ natAbs m ∨ p ^ (l + 1) ∣ natAbs n :=
  Nat.succ_dvd_or_succ_dvd_of_succ_sum_dvd_mul p_prime hpm' hpn' hpmn'
hsd1 : p ^ (k + 1) ∣ natAbs m
⊢ ↑(p ^ (k + 1)) ∣ ↑(natAbs m)
[PROOFSTEP]
apply Int.coe_nat_dvd.2 hsd1
[GOAL]
p : ℕ
p_prime : Nat.Prime p
m n : ℤ
k l : ℕ
hpm : ↑(p ^ k) ∣ m
hpn : ↑(p ^ l) ∣ n
hpmn : ↑(p ^ (k + l + 1)) ∣ m * n
hpm' : p ^ k ∣ natAbs m
hpn' : p ^ l ∣ natAbs n
hpmn' : p ^ (k + l + 1) ∣ natAbs m * natAbs n
hsd : p ^ (k + 1) ∣ natAbs m ∨ p ^ (l + 1) ∣ natAbs n :=
  Nat.succ_dvd_or_succ_dvd_of_succ_sum_dvd_mul p_prime hpm' hpn' hpmn'
hsd2 : p ^ (l + 1) ∣ natAbs n
⊢ ↑(p ^ (l + 1)) ∣ n
[PROOFSTEP]
apply Int.dvd_natAbs.1
[GOAL]
p : ℕ
p_prime : Nat.Prime p
m n : ℤ
k l : ℕ
hpm : ↑(p ^ k) ∣ m
hpn : ↑(p ^ l) ∣ n
hpmn : ↑(p ^ (k + l + 1)) ∣ m * n
hpm' : p ^ k ∣ natAbs m
hpn' : p ^ l ∣ natAbs n
hpmn' : p ^ (k + l + 1) ∣ natAbs m * natAbs n
hsd : p ^ (k + 1) ∣ natAbs m ∨ p ^ (l + 1) ∣ natAbs n :=
  Nat.succ_dvd_or_succ_dvd_of_succ_sum_dvd_mul p_prime hpm' hpn' hpmn'
hsd2 : p ^ (l + 1) ∣ natAbs n
⊢ ↑(p ^ (l + 1)) ∣ ↑(natAbs n)
[PROOFSTEP]
apply Int.coe_nat_dvd.2 hsd2
[GOAL]
p : ℕ
hp : Nat.Prime p
k : ℤ
h : ↑p ∣ k ^ 2
⊢ p ∣ natAbs k
[PROOFSTEP]
apply @Nat.Prime.dvd_of_dvd_pow _ _ 2 hp
[GOAL]
p : ℕ
hp : Nat.Prime p
k : ℤ
h : ↑p ∣ k ^ 2
⊢ p ∣ natAbs k ^ 2
[PROOFSTEP]
rwa [sq, ← natAbs_mul, ← coe_nat_dvd_left, ← sq]


[GOAL]
C : Type u_1
D : Type u_2
E : Type u_3
inst✝⁶ : Category.{u_6, u_1} C
inst✝⁵ : Category.{u_5, u_2} D
inst✝⁴ : Category.{?u.20851, u_3} E
F : C ⥤ D
G : D ⥤ E
A : Type u_4
inst✝³ : AddMonoid A
inst✝² : HasShift C A
inst✝¹ : HasShift D A
inst✝ : HasShift E A
a b : A
e₁ : shiftFunctor C a ⋙ F ≅ F ⋙ shiftFunctor D a
e₂ : shiftFunctor C b ⋙ F ≅ F ⋙ shiftFunctor D b
X : C
⊢ NatTrans.app (isoAdd e₁ e₂).hom X =
    F.map (NatTrans.app (shiftFunctorAdd C a b).hom X) ≫
      NatTrans.app e₂.hom ((shiftFunctor C a).obj X) ≫
        (shiftFunctor D b).map (NatTrans.app e₁.hom X) ≫ NatTrans.app (shiftFunctorAdd D a b).inv (F.obj X)
[PROOFSTEP]
simp only [isoAdd, isoAdd'_hom_app, shiftFunctorAdd'_eq_shiftFunctorAdd]
[GOAL]
C : Type u_1
D : Type u_2
E : Type u_3
inst✝⁶ : Category.{u_6, u_1} C
inst✝⁵ : Category.{u_5, u_2} D
inst✝⁴ : Category.{?u.24197, u_3} E
F : C ⥤ D
G : D ⥤ E
A : Type u_4
inst✝³ : AddMonoid A
inst✝² : HasShift C A
inst✝¹ : HasShift D A
inst✝ : HasShift E A
a b : A
e₁ : shiftFunctor C a ⋙ F ≅ F ⋙ shiftFunctor D a
e₂ : shiftFunctor C b ⋙ F ≅ F ⋙ shiftFunctor D b
X : C
⊢ NatTrans.app (isoAdd e₁ e₂).inv X =
    NatTrans.app (shiftFunctorAdd D a b).hom (F.obj X) ≫
      (shiftFunctor D b).map (NatTrans.app e₁.inv X) ≫
        NatTrans.app e₂.inv ((shiftFunctor C a).obj X) ≫ F.map (NatTrans.app (shiftFunctorAdd C a b).inv X)
[PROOFSTEP]
simp only [isoAdd, isoAdd'_inv_app, shiftFunctorAdd'_eq_shiftFunctorAdd]
[GOAL]
C : Type u_1
D : Type u_2
E : Type u_3
inst✝⁷ : Category.{u_6, u_1} C
inst✝⁶ : Category.{u_5, u_2} D
inst✝⁵ : Category.{?u.38582, u_3} E
F : C ⥤ D
G : D ⥤ E
A : Type u_4
inst✝⁴ : AddMonoid A
inst✝³ : HasShift C A
inst✝² : HasShift D A
inst✝¹ : HasShift E A
inst✝ : CommShift F A
a b c : A
h : a + b = c
⊢ commShiftIso F c = CommShift.isoAdd' h (commShiftIso F a) (commShiftIso F b)
[PROOFSTEP]
subst h
[GOAL]
C : Type u_1
D : Type u_2
E : Type u_3
inst✝⁷ : Category.{u_6, u_1} C
inst✝⁶ : Category.{u_5, u_2} D
inst✝⁵ : Category.{?u.38582, u_3} E
F : C ⥤ D
G : D ⥤ E
A : Type u_4
inst✝⁴ : AddMonoid A
inst✝³ : HasShift C A
inst✝² : HasShift D A
inst✝¹ : HasShift E A
inst✝ : CommShift F A
a b : A
⊢ commShiftIso F (a + b) = CommShift.isoAdd' (_ : a + b = a + b) (commShiftIso F a) (commShiftIso F b)
[PROOFSTEP]
simp only [commShiftIso_add, CommShift.isoAdd]


[GOAL]
M : Type u_1
α : Type u_2
inst✝¹ : Monoid M
inst✝ : MulAction M α
s : Set α
x y : M
hx : x ∈ {ϕ | ∀ (x : ↑s), ϕ • ↑x = ↑x}
hy : y ∈ {ϕ | ∀ (x : ↑s), ϕ • ↑x = ↑x}
z : ↑s
⊢ (x * y) • ↑z = ↑z
[PROOFSTEP]
rw [mul_smul, hy z, hx z]
[GOAL]
M : Type u_1
α : Type u_2
inst✝¹ : Group M
inst✝ : MulAction M α
s : Set α
src✝ : Submonoid M := fixingSubmonoid M s
x✝ : M
hx : x✝ ∈ { toSubsemigroup := src✝.toSubsemigroup, one_mem' := (_ : 1 ∈ src✝.carrier) }.toSubsemigroup.carrier
z : ↑s
⊢ x✝⁻¹ • ↑z = ↑z
[PROOFSTEP]
rw [inv_smul_eq_iff, hx z]


[GOAL]
α : Type u_1
inst✝ : StrictOrderedSemiring α
n : ℕ
⊢ ↑n < ↑(n + 1)
[PROOFSTEP]
rw [Nat.cast_succ]
[GOAL]
α : Type u_1
inst✝ : StrictOrderedSemiring α
n : ℕ
⊢ ↑n < ↑n + 1
[PROOFSTEP]
apply lt_add_one


[GOAL]
n : ℕ
x : ℝ
⊢ deriv^[n] (fun y => Real.exp (-(y ^ 2 / 2))) x = (-1) ^ n * ↑(aeval x) (hermite n) * Real.exp (-(x ^ 2 / 2))
[PROOFSTEP]
rw [mul_assoc]
[GOAL]
n : ℕ
x : ℝ
⊢ deriv^[n] (fun y => Real.exp (-(y ^ 2 / 2))) x = (-1) ^ n * (↑(aeval x) (hermite n) * Real.exp (-(x ^ 2 / 2)))
[PROOFSTEP]
induction' n with n ih generalizing x
[GOAL]
case zero
x✝ x : ℝ
⊢ deriv^[Nat.zero] (fun y => Real.exp (-(y ^ 2 / 2))) x =
    (-1) ^ Nat.zero * (↑(aeval x) (hermite Nat.zero) * Real.exp (-(x ^ 2 / 2)))
[PROOFSTEP]
rw [Function.iterate_zero_apply, pow_zero, one_mul, hermite_zero, C_1, map_one, one_mul]
[GOAL]
case succ
x✝ : ℝ
n : ℕ
ih :
  ∀ (x : ℝ),
    deriv^[n] (fun y => Real.exp (-(y ^ 2 / 2))) x = (-1) ^ n * (↑(aeval x) (hermite n) * Real.exp (-(x ^ 2 / 2)))
x : ℝ
⊢ deriv^[Nat.succ n] (fun y => Real.exp (-(y ^ 2 / 2))) x =
    (-1) ^ Nat.succ n * (↑(aeval x) (hermite (Nat.succ n)) * Real.exp (-(x ^ 2 / 2)))
[PROOFSTEP]
replace ih : deriv^[n] _ = _ := _root_.funext ih
[GOAL]
case succ
x✝ : ℝ
n : ℕ
x : ℝ
ih :
  (deriv^[n] fun y => Real.exp (-(y ^ 2 / 2))) = fun x => (-1) ^ n * (↑(aeval x) (hermite n) * Real.exp (-(x ^ 2 / 2)))
⊢ deriv^[Nat.succ n] (fun y => Real.exp (-(y ^ 2 / 2))) x =
    (-1) ^ Nat.succ n * (↑(aeval x) (hermite (Nat.succ n)) * Real.exp (-(x ^ 2 / 2)))
[PROOFSTEP]
have deriv_gaussian : deriv (fun y => Real.exp (-(y ^ 2 / 2))) x = -x * Real.exp (-(x ^ 2 / 2)) := by
  rw [deriv_exp (by simp)]; simp;
  ring
    -- Porting note: was `simp [mul_comm, ← neg_mul]`
[GOAL]
x✝ : ℝ
n : ℕ
x : ℝ
ih :
  (deriv^[n] fun y => Real.exp (-(y ^ 2 / 2))) = fun x => (-1) ^ n * (↑(aeval x) (hermite n) * Real.exp (-(x ^ 2 / 2)))
⊢ deriv (fun y => Real.exp (-(y ^ 2 / 2))) x = -x * Real.exp (-(x ^ 2 / 2))
[PROOFSTEP]
rw [deriv_exp (by simp)]
[GOAL]
x✝ : ℝ
n : ℕ
x : ℝ
ih :
  (deriv^[n] fun y => Real.exp (-(y ^ 2 / 2))) = fun x => (-1) ^ n * (↑(aeval x) (hermite n) * Real.exp (-(x ^ 2 / 2)))
⊢ DifferentiableAt ℝ (fun y => -(y ^ 2 / 2)) x
[PROOFSTEP]
simp
[GOAL]
x✝ : ℝ
n : ℕ
x : ℝ
ih :
  (deriv^[n] fun y => Real.exp (-(y ^ 2 / 2))) = fun x => (-1) ^ n * (↑(aeval x) (hermite n) * Real.exp (-(x ^ 2 / 2)))
⊢ Real.exp (-(x ^ 2 / 2)) * deriv (fun y => -(y ^ 2 / 2)) x = -x * Real.exp (-(x ^ 2 / 2))
[PROOFSTEP]
simp
[GOAL]
x✝ : ℝ
n : ℕ
x : ℝ
ih :
  (deriv^[n] fun y => Real.exp (-(y ^ 2 / 2))) = fun x => (-1) ^ n * (↑(aeval x) (hermite n) * Real.exp (-(x ^ 2 / 2)))
⊢ Real.exp (-(x ^ 2 / 2)) * (2 * x / 2) = x * Real.exp (-(x ^ 2 / 2))
[PROOFSTEP]
ring
  -- Porting note: was `simp [mul_comm, ← neg_mul]`
[GOAL]
case succ
x✝ : ℝ
n : ℕ
x : ℝ
ih :
  (deriv^[n] fun y => Real.exp (-(y ^ 2 / 2))) = fun x => (-1) ^ n * (↑(aeval x) (hermite n) * Real.exp (-(x ^ 2 / 2)))
deriv_gaussian : deriv (fun y => Real.exp (-(y ^ 2 / 2))) x = -x * Real.exp (-(x ^ 2 / 2))
⊢ deriv^[Nat.succ n] (fun y => Real.exp (-(y ^ 2 / 2))) x =
    (-1) ^ Nat.succ n * (↑(aeval x) (hermite (Nat.succ n)) * Real.exp (-(x ^ 2 / 2)))
[PROOFSTEP]
rw [Function.iterate_succ_apply', ih, deriv_const_mul_field, deriv_mul, pow_succ (-1 : ℝ), deriv_gaussian, hermite_succ,
  map_sub, map_mul, aeval_X, Polynomial.deriv_aeval]
[GOAL]
case succ
x✝ : ℝ
n : ℕ
x : ℝ
ih :
  (deriv^[n] fun y => Real.exp (-(y ^ 2 / 2))) = fun x => (-1) ^ n * (↑(aeval x) (hermite n) * Real.exp (-(x ^ 2 / 2)))
deriv_gaussian : deriv (fun y => Real.exp (-(y ^ 2 / 2))) x = -x * Real.exp (-(x ^ 2 / 2))
⊢ (-1) ^ n *
      (↑(aeval x) (↑derivative (hermite n)) * Real.exp (-(x ^ 2 / 2)) +
        ↑(aeval x) (hermite n) * (-x * Real.exp (-(x ^ 2 / 2)))) =
    -1 * (-1) ^ n * ((x * ↑(aeval x) (hermite n) - ↑(aeval x) (↑derivative (hermite n))) * Real.exp (-(x ^ 2 / 2)))
case succ.hc
x✝ : ℝ
n : ℕ
x : ℝ
ih :
  (deriv^[n] fun y => Real.exp (-(y ^ 2 / 2))) = fun x => (-1) ^ n * (↑(aeval x) (hermite n) * Real.exp (-(x ^ 2 / 2)))
deriv_gaussian : deriv (fun y => Real.exp (-(y ^ 2 / 2))) x = -x * Real.exp (-(x ^ 2 / 2))
⊢ DifferentiableAt ℝ (fun x => ↑(aeval x) (hermite n)) x
case succ.hd
x✝ : ℝ
n : ℕ
x : ℝ
ih :
  (deriv^[n] fun y => Real.exp (-(y ^ 2 / 2))) = fun x => (-1) ^ n * (↑(aeval x) (hermite n) * Real.exp (-(x ^ 2 / 2)))
deriv_gaussian : deriv (fun y => Real.exp (-(y ^ 2 / 2))) x = -x * Real.exp (-(x ^ 2 / 2))
⊢ DifferentiableAt ℝ (fun x => Real.exp (-(x ^ 2 / 2))) x
[PROOFSTEP]
ring
[GOAL]
case succ.hc
x✝ : ℝ
n : ℕ
x : ℝ
ih :
  (deriv^[n] fun y => Real.exp (-(y ^ 2 / 2))) = fun x => (-1) ^ n * (↑(aeval x) (hermite n) * Real.exp (-(x ^ 2 / 2)))
deriv_gaussian : deriv (fun y => Real.exp (-(y ^ 2 / 2))) x = -x * Real.exp (-(x ^ 2 / 2))
⊢ DifferentiableAt ℝ (fun x => ↑(aeval x) (hermite n)) x
[PROOFSTEP]
apply Polynomial.differentiable_aeval
[GOAL]
case succ.hd
x✝ : ℝ
n : ℕ
x : ℝ
ih :
  (deriv^[n] fun y => Real.exp (-(y ^ 2 / 2))) = fun x => (-1) ^ n * (↑(aeval x) (hermite n) * Real.exp (-(x ^ 2 / 2)))
deriv_gaussian : deriv (fun y => Real.exp (-(y ^ 2 / 2))) x = -x * Real.exp (-(x ^ 2 / 2))
⊢ DifferentiableAt ℝ (fun x => Real.exp (-(x ^ 2 / 2))) x
[PROOFSTEP]
apply DifferentiableAt.exp
[GOAL]
case succ.hd.hc
x✝ : ℝ
n : ℕ
x : ℝ
ih :
  (deriv^[n] fun y => Real.exp (-(y ^ 2 / 2))) = fun x => (-1) ^ n * (↑(aeval x) (hermite n) * Real.exp (-(x ^ 2 / 2)))
deriv_gaussian : deriv (fun y => Real.exp (-(y ^ 2 / 2))) x = -x * Real.exp (-(x ^ 2 / 2))
⊢ DifferentiableAt ℝ (fun x => -(x ^ 2 / 2)) x
[PROOFSTEP]
simp
  -- Porting note: was just `simp`
[GOAL]
n : ℕ
x : ℝ
⊢ ↑(aeval x) (hermite n) = (-1) ^ n * deriv^[n] (fun y => Real.exp (-(y ^ 2 / 2))) x / Real.exp (-(x ^ 2 / 2))
[PROOFSTEP]
rw [deriv_gaussian_eq_hermite_mul_gaussian]
[GOAL]
n : ℕ
x : ℝ
⊢ ↑(aeval x) (hermite n) =
    (-1) ^ n * ((-1) ^ n * ↑(aeval x) (hermite n) * Real.exp (-(x ^ 2 / 2))) / Real.exp (-(x ^ 2 / 2))
[PROOFSTEP]
field_simp [Real.exp_ne_zero]
[GOAL]
n : ℕ
x : ℝ
⊢ ↑(aeval x) (hermite n) * Real.exp (-x ^ 2 / 2) =
    (-1) ^ n * ((-1) ^ n * ↑(aeval x) (hermite n) * Real.exp (-x ^ 2 / 2))
[PROOFSTEP]
rw [← @smul_eq_mul ℝ _ ((-1) ^ n), ← inv_smul_eq_iff₀, mul_assoc, smul_eq_mul, ← inv_pow, ← neg_inv, inv_one]
[GOAL]
case ha
n : ℕ
x : ℝ
⊢ (-1) ^ n ≠ 0
[PROOFSTEP]
exact pow_ne_zero _ (by norm_num)
[GOAL]
n : ℕ
x : ℝ
⊢ -1 ≠ 0
[PROOFSTEP]
norm_num
[GOAL]
n : ℕ
x : ℝ
⊢ ↑(aeval x) (hermite n) = (-1) ^ n * deriv^[n] (fun y => Real.exp (-(y ^ 2 / 2))) x * Real.exp (x ^ 2 / 2)
[PROOFSTEP]
rw [hermite_eq_deriv_gaussian, Real.exp_neg]
[GOAL]
n : ℕ
x : ℝ
⊢ (-1) ^ n * deriv^[n] (fun y => Real.exp (-(y ^ 2 / 2))) x / (Real.exp (x ^ 2 / 2))⁻¹ =
    (-1) ^ n * deriv^[n] (fun y => Real.exp (-(y ^ 2 / 2))) x * Real.exp (x ^ 2 / 2)
[PROOFSTEP]
field_simp [Real.exp_ne_zero]