[GOAL]
α : Type u_1
n : ℕ
xs : Vector α n
x : α
⊢ reverse (x ::ᵥ xs) = snoc (reverse xs) x
[PROOFSTEP]
cases xs
[GOAL]
case mk
α : Type u_1
n : ℕ
x : α
val✝ : List α
property✝ : List.length val✝ = n
⊢ reverse (x ::ᵥ { val := val✝, property := property✝ }) = snoc (reverse { val := val✝, property := property✝ }) x
[PROOFSTEP]
simp only [reverse, cons, toList_mk, List.reverse_cons, snoc]
[GOAL]
case mk
α : Type u_1
n : ℕ
x : α
val✝ : List α
property✝ : List.length val✝ = n
⊢ { val := List.reverse val✝ ++ [x],
      property := (_ : (fun l => List.length l = Nat.succ n) (List.reverse val✝ ++ [x])) } =
    append { val := List.reverse val✝, property := (_ : (fun l => List.length l = n) (List.reverse val✝)) }
      { val := [x], property := (_ : Nat.succ (List.length []) = Nat.succ 0) }
[PROOFSTEP]
congr
[GOAL]
α : Type u_1
n : ℕ
xs : Vector α n
x : α
⊢ reverse (snoc xs x) = x ::ᵥ reverse xs
[PROOFSTEP]
cases xs
[GOAL]
case mk
α : Type u_1
n : ℕ
x : α
val✝ : List α
property✝ : List.length val✝ = n
⊢ reverse (snoc { val := val✝, property := property✝ } x) = x ::ᵥ reverse { val := val✝, property := property✝ }
[PROOFSTEP]
simp only [reverse, snoc, cons, toList_mk]
[GOAL]
case mk
α : Type u_1
n : ℕ
x : α
val✝ : List α
property✝ : List.length val✝ = n
⊢ {
      val :=
        List.reverse
          (toList
            (append { val := val✝, property := property✝ }
              { val := [x], property := (_ : Nat.succ (List.length []) = Nat.succ 0) })),
      property :=
        (_ :
          (fun l => List.length l = n + 1)
            (List.reverse
              (toList
                (append { val := val✝, property := property✝ }
                  { val := [x], property := (_ : Nat.succ (List.length []) = Nat.succ 0) })))) } =
    { val := x :: List.reverse val✝, property := (_ : Nat.succ (List.length (List.reverse val✝)) = Nat.succ n) }
[PROOFSTEP]
congr
[GOAL]
case mk.e_val
α : Type u_1
n : ℕ
x : α
val✝ : List α
property✝ : List.length val✝ = n
⊢ List.reverse
      (toList
        (append { val := val✝, property := property✝ }
          { val := [x], property := (_ : Nat.succ (List.length []) = Nat.succ 0) })) =
    x :: List.reverse val✝
[PROOFSTEP]
simp [toList, (· ++ ·), Vector.append, Append.append]
[GOAL]
case mk.e_val
α : Type u_1
n : ℕ
x : α
val✝ : List α
property✝ : List.length val✝ = n
⊢ [] ++ [x] ++ List.reverse val✝ = x :: List.reverse val✝
[PROOFSTEP]
rfl
[GOAL]
α : Type u_1
n : ℕ
xs : Vector α n
val : α
⊢ replicate (n + 1) val = snoc (replicate n val) val
[PROOFSTEP]
clear xs
[GOAL]
α : Type u_1
n : ℕ
val : α
⊢ replicate (n + 1) val = snoc (replicate n val) val
[PROOFSTEP]
induction n
[GOAL]
case zero
α : Type u_1
n : ℕ
val : α
⊢ replicate (Nat.zero + 1) val = snoc (replicate Nat.zero val) val
case succ
α : Type u_1
n : ℕ
val : α
n✝ : ℕ
n_ih✝ : replicate (n✝ + 1) val = snoc (replicate n✝ val) val
⊢ replicate (Nat.succ n✝ + 1) val = snoc (replicate (Nat.succ n✝) val) val
[PROOFSTEP]
case zero => rfl
[GOAL]
α : Type u_1
n : ℕ
val : α
⊢ replicate (Nat.zero + 1) val = snoc (replicate Nat.zero val) val
[PROOFSTEP]
case zero => rfl
[GOAL]
α : Type u_1
n : ℕ
val : α
⊢ replicate (Nat.zero + 1) val = snoc (replicate Nat.zero val) val
[PROOFSTEP]
rfl
[GOAL]
case succ
α : Type u_1
n : ℕ
val : α
n✝ : ℕ
n_ih✝ : replicate (n✝ + 1) val = snoc (replicate n✝ val) val
⊢ replicate (Nat.succ n✝ + 1) val = snoc (replicate (Nat.succ n✝) val) val
[PROOFSTEP]
case succ n ih =>
  rw [replicate_succ]
  conv => {rhs; rw [replicate_succ]}
  rw [snoc_cons, ih]
[GOAL]
α : Type u_1
n✝ : ℕ
val : α
n : ℕ
ih : replicate (n + 1) val = snoc (replicate n val) val
⊢ replicate (Nat.succ n + 1) val = snoc (replicate (Nat.succ n) val) val
[PROOFSTEP]
case succ n ih =>
  rw [replicate_succ]
  conv => {rhs; rw [replicate_succ]}
  rw [snoc_cons, ih]
[GOAL]
α : Type u_1
n✝ : ℕ
val : α
n : ℕ
ih : replicate (n + 1) val = snoc (replicate n val) val
⊢ replicate (Nat.succ n + 1) val = snoc (replicate (Nat.succ n) val) val
[PROOFSTEP]
rw [replicate_succ]
[GOAL]
α : Type u_1
n✝ : ℕ
val : α
n : ℕ
ih : replicate (n + 1) val = snoc (replicate n val) val
⊢ val ::ᵥ replicate (n + 1) val = snoc (replicate (Nat.succ n) val) val
[PROOFSTEP]
conv => {rhs; rw [replicate_succ]}
[GOAL]
α : Type u_1
n✝ : ℕ
val : α
n : ℕ
ih : replicate (n + 1) val = snoc (replicate n val) val
| val ::ᵥ replicate (n + 1) val = snoc (replicate (Nat.succ n) val) val
[PROOFSTEP]
{rhs; rw [replicate_succ]}
[GOAL]
α : Type u_1
n✝ : ℕ
val : α
n : ℕ
ih : replicate (n + 1) val = snoc (replicate n val) val
| val ::ᵥ replicate (n + 1) val = snoc (replicate (Nat.succ n) val) val
[PROOFSTEP]
{rhs; rw [replicate_succ]}
[GOAL]
α : Type u_1
n✝ : ℕ
val : α
n : ℕ
ih : replicate (n + 1) val = snoc (replicate n val) val
| val ::ᵥ replicate (n + 1) val = snoc (replicate (Nat.succ n) val) val
[PROOFSTEP]
rhs
[GOAL]
α : Type u_1
n✝ : ℕ
val : α
n : ℕ
ih : replicate (n + 1) val = snoc (replicate n val) val
| snoc (replicate (Nat.succ n) val) val
[PROOFSTEP]
rw [replicate_succ]
[GOAL]
α : Type u_1
n✝ : ℕ
val : α
n : ℕ
ih : replicate (n + 1) val = snoc (replicate n val) val
⊢ val ::ᵥ replicate (n + 1) val = snoc (val ::ᵥ replicate n val) val
[PROOFSTEP]
rw [snoc_cons, ih]
[GOAL]
α : Type ?u.2475
C : {n : ℕ} → Vector α n → Sort u_1
n : ℕ
v : Vector α n
nil : C Vector.nil
snoc : {n : ℕ} → (xs : Vector α n) → (x : α) → C xs → C (Vector.snoc xs x)
⊢ (fun {n} v => C (reverse v)) (reverse v) = C v
[PROOFSTEP]
simp
[GOAL]
α : Type ?u.2475
C : {n : ℕ} → Vector α n → Sort u_1
n✝ : ℕ
v : Vector α n✝
nil : C Vector.nil
snoc : {n : ℕ} → (xs : Vector α n) → (x : α) → C xs → C (Vector.snoc xs x)
n : ℕ
x : α
xs : Vector α n
r : C (reverse xs)
⊢ C (Vector.snoc (reverse xs) x) = (fun {n} v => C (reverse v)) (x ::ᵥ xs)
[PROOFSTEP]
simp
[GOAL]
α : Type ?u.2985
β : Type ?u.2988
C : {n : ℕ} → Vector α n → Vector β n → Sort u_1
n : ℕ
v : Vector α n
w : Vector β n
nil : C Vector.nil Vector.nil
snoc :
  {n : ℕ} →
    (xs : Vector α n) → (ys : Vector β n) → (x : α) → (y : β) → C xs ys → C (Vector.snoc xs x) (Vector.snoc ys y)
⊢ (fun {n} v w => C (reverse v) (reverse w)) (reverse v) (reverse w) = C v w
[PROOFSTEP]
simp
[GOAL]
α : Type ?u.2985
β : Type ?u.2988
C : {n : ℕ} → Vector α n → Vector β n → Sort u_1
n✝ : ℕ
v : Vector α n✝
w : Vector β n✝
nil : C Vector.nil Vector.nil
snoc :
  {n : ℕ} →
    (xs : Vector α n) → (ys : Vector β n) → (x : α) → (y : β) → C xs ys → C (Vector.snoc xs x) (Vector.snoc ys y)
n : ℕ
x : α
y : β
xs : Vector α n
ys : Vector β n
r : C (reverse xs) (reverse ys)
⊢ C (Vector.snoc (reverse xs) x) (Vector.snoc (reverse ys) y) =
    (fun {n} v w => C (reverse v) (reverse w)) (x ::ᵥ xs) (y ::ᵥ ys)
[PROOFSTEP]
simp
[GOAL]
α : Type u_2
n : ℕ
xs : Vector α n
α✝ : Type u_1
f : α → α✝
x : α
⊢ map f (snoc xs x) = snoc (map f xs) (f x)
[PROOFSTEP]
induction xs using Vector.inductionOn
[GOAL]
case h_nil
α : Type u_2
n : ℕ
xs : Vector α n
α✝ : Type u_1
f : α → α✝
x : α
⊢ map f (snoc nil x) = snoc (map f nil) (f x)
[PROOFSTEP]
simp_all
[GOAL]
case h_cons
α : Type u_2
n : ℕ
xs : Vector α n
α✝ : Type u_1
f : α → α✝
x : α
n✝ : ℕ
x✝ : α
w✝ : Vector α n✝
a✝ : map f (snoc w✝ x) = snoc (map f w✝) (f x)
⊢ map f (snoc (x✝ ::ᵥ w✝) x) = snoc (map f (x✝ ::ᵥ w✝)) (f x)
[PROOFSTEP]
simp_all
[GOAL]
α : Type u_2
n : ℕ
xs : Vector α n
α✝ : Type
β✝ : Type u_1
f : α → α✝ → α✝ × β✝
x : α
s : α✝
⊢ mapAccumr f (snoc xs x) s =
    let q := f x s;
    let r := mapAccumr f xs q.fst;
    (r.fst, snoc r.snd q.snd)
[PROOFSTEP]
induction xs using Vector.inductionOn
[GOAL]
case h_nil
α : Type u_2
n : ℕ
xs : Vector α n
α✝ : Type
β✝ : Type u_1
f : α → α✝ → α✝ × β✝
x : α
s : α✝
⊢ mapAccumr f (snoc nil x) s =
    let q := f x s;
    let r := mapAccumr f nil q.fst;
    (r.fst, snoc r.snd q.snd)
[PROOFSTEP]
rfl
[GOAL]
case h_cons
α : Type u_2
n : ℕ
xs : Vector α n
α✝ : Type
β✝ : Type u_1
f : α → α✝ → α✝ × β✝
x : α
s : α✝
n✝ : ℕ
x✝ : α
w✝ : Vector α n✝
a✝ :
  mapAccumr f (snoc w✝ x) s =
    let q := f x s;
    let r := mapAccumr f w✝ q.fst;
    (r.fst, snoc r.snd q.snd)
⊢ mapAccumr f (snoc (x✝ ::ᵥ w✝) x) s =
    let q := f x s;
    let r := mapAccumr f (x✝ ::ᵥ w✝) q.fst;
    (r.fst, snoc r.snd q.snd)
[PROOFSTEP]
simp [*]
[GOAL]
α : Type u_2
n : ℕ
β : Type u_3
xs : Vector α n
ys : Vector β n
α✝ : Type u_1
f : α → β → α✝
x : α
y : β
⊢ map₂ f (snoc xs x) (snoc ys y) = snoc (map₂ f xs ys) (f x y)
[PROOFSTEP]
induction xs, ys using Vector.inductionOn₂
[GOAL]
case nil
α : Type u_2
n : ℕ
β : Type u_3
xs : Vector α n
ys : Vector β n
α✝ : Type u_1
f : α → β → α✝
x : α
y : β
⊢ map₂ f (snoc nil x) (snoc nil y) = snoc (map₂ f nil nil) (f x y)
[PROOFSTEP]
simp_all
[GOAL]
case cons
α : Type u_2
n : ℕ
β : Type u_3
xs : Vector α n
ys : Vector β n
α✝ : Type u_1
f : α → β → α✝
x : α
y : β
n✝ : ℕ
a✝¹ : α
b✝ : β
x✝ : Vector α n✝
y✝ : Vector β n✝
a✝ : map₂ f (snoc x✝ x) (snoc y✝ y) = snoc (map₂ f x✝ y✝) (f x y)
⊢ map₂ f (snoc (a✝¹ ::ᵥ x✝) x) (snoc (b✝ ::ᵥ y✝) y) = snoc (map₂ f (a✝¹ ::ᵥ x✝) (b✝ ::ᵥ y✝)) (f x y)
[PROOFSTEP]
simp_all
[GOAL]
α : Type
n : ℕ
β : Type
xs : Vector α n
ys : Vector β n
σ φ : Type
c : σ
f : α → β → σ → σ × φ
x : α
y : β
⊢ mapAccumr₂ f (snoc xs x) (snoc ys y) c =
    let q := f x y c;
    let r := mapAccumr₂ f xs ys q.fst;
    (r.fst, snoc r.snd q.snd)
[PROOFSTEP]
induction xs, ys using Vector.inductionOn₂
[GOAL]
case nil
α : Type
n : ℕ
β : Type
xs : Vector α n
ys : Vector β n
σ φ : Type
c : σ
f : α → β → σ → σ × φ
x : α
y : β
⊢ mapAccumr₂ f (snoc nil x) (snoc nil y) c =
    let q := f x y c;
    let r := mapAccumr₂ f nil nil q.fst;
    (r.fst, snoc r.snd q.snd)
[PROOFSTEP]
simp_all
[GOAL]
case cons
α : Type
n : ℕ
β : Type
xs : Vector α n
ys : Vector β n
σ φ : Type
c : σ
f : α → β → σ → σ × φ
x : α
y : β
n✝ : ℕ
a✝¹ : α
b✝ : β
x✝ : Vector α n✝
y✝ : Vector β n✝
a✝ :
  mapAccumr₂ f (snoc x✝ x) (snoc y✝ y) c =
    let q := f x y c;
    let r := mapAccumr₂ f x✝ y✝ q.fst;
    (r.fst, snoc r.snd q.snd)
⊢ mapAccumr₂ f (snoc (a✝¹ ::ᵥ x✝) x) (snoc (b✝ ::ᵥ y✝) y) c =
    let q := f x y c;
    let r := mapAccumr₂ f (a✝¹ ::ᵥ x✝) (b✝ ::ᵥ y✝) q.fst;
    (r.fst, snoc r.snd q.snd)
[PROOFSTEP]
simp_all


[GOAL]
z : ℂ
⊢ HasSum (fun n => (z * I) ^ (2 * n) / ↑(2 * n)!) (cos z)
[PROOFSTEP]
rw [Complex.cos, Complex.exp_eq_exp_ℂ]
[GOAL]
z : ℂ
⊢ HasSum (fun n => (z * I) ^ (2 * n) / ↑(2 * n)!) ((_root_.exp ℂ (z * I) + _root_.exp ℂ (-z * I)) / 2)
[PROOFSTEP]
have := ((expSeries_div_hasSum_exp ℂ (z * Complex.I)).add (expSeries_div_hasSum_exp ℂ (-z * Complex.I))).div_const 2
[GOAL]
z : ℂ
this :
  HasSum (fun i => ((z * I) ^ i / ↑i ! + (-z * I) ^ i / ↑i !) / 2) ((_root_.exp ℂ (z * I) + _root_.exp ℂ (-z * I)) / 2)
⊢ HasSum (fun n => (z * I) ^ (2 * n) / ↑(2 * n)!) ((_root_.exp ℂ (z * I) + _root_.exp ℂ (-z * I)) / 2)
[PROOFSTEP]
replace := (Nat.divModEquiv 2).symm.hasSum_iff.mpr this
[GOAL]
z : ℂ
this :
  HasSum ((fun i => ((z * I) ^ i / ↑i ! + (-z * I) ^ i / ↑i !) / 2) ∘ ↑(Nat.divModEquiv 2).symm)
    ((_root_.exp ℂ (z * I) + _root_.exp ℂ (-z * I)) / 2)
⊢ HasSum (fun n => (z * I) ^ (2 * n) / ↑(2 * n)!) ((_root_.exp ℂ (z * I) + _root_.exp ℂ (-z * I)) / 2)
[PROOFSTEP]
dsimp [Function.comp] at this
[GOAL]
z : ℂ
this :
  HasSum
    (fun x =>
      ((z * I) ^ (x.fst * 2 + ↑x.snd) / ↑(x.fst * 2 + ↑x.snd)! +
          (-z * I) ^ (x.fst * 2 + ↑x.snd) / ↑(x.fst * 2 + ↑x.snd)!) /
        2)
    ((_root_.exp ℂ (z * I) + _root_.exp ℂ (-z * I)) / 2)
⊢ HasSum (fun n => (z * I) ^ (2 * n) / ↑(2 * n)!) ((_root_.exp ℂ (z * I) + _root_.exp ℂ (-z * I)) / 2)
[PROOFSTEP]
simp_rw [← mul_comm 2 _] at this
[GOAL]
z : ℂ
this :
  HasSum
    (fun x =>
      ((z * I) ^ (2 * x.fst + ↑x.snd) / ↑(2 * x.fst + ↑x.snd)! +
          (-z * I) ^ (2 * x.fst + ↑x.snd) / ↑(2 * x.fst + ↑x.snd)!) /
        2)
    ((_root_.exp ℂ (z * I) + _root_.exp ℂ (-z * I)) / 2)
⊢ HasSum (fun n => (z * I) ^ (2 * n) / ↑(2 * n)!) ((_root_.exp ℂ (z * I) + _root_.exp ℂ (-z * I)) / 2)
[PROOFSTEP]
refine' this.prod_fiberwise fun k => _
[GOAL]
z : ℂ
this :
  HasSum
    (fun x =>
      ((z * I) ^ (2 * x.fst + ↑x.snd) / ↑(2 * x.fst + ↑x.snd)! +
          (-z * I) ^ (2 * x.fst + ↑x.snd) / ↑(2 * x.fst + ↑x.snd)!) /
        2)
    ((_root_.exp ℂ (z * I) + _root_.exp ℂ (-z * I)) / 2)
k : ℕ
⊢ HasSum
    (fun c =>
      ((z * I) ^ (2 * (k, c).fst + ↑(k, c).snd) / ↑(2 * (k, c).fst + ↑(k, c).snd)! +
          (-z * I) ^ (2 * (k, c).fst + ↑(k, c).snd) / ↑(2 * (k, c).fst + ↑(k, c).snd)!) /
        2)
    ((z * I) ^ (2 * k) / ↑(2 * k)!)
[PROOFSTEP]
dsimp only
[GOAL]
z : ℂ
this :
  HasSum
    (fun x =>
      ((z * I) ^ (2 * x.fst + ↑x.snd) / ↑(2 * x.fst + ↑x.snd)! +
          (-z * I) ^ (2 * x.fst + ↑x.snd) / ↑(2 * x.fst + ↑x.snd)!) /
        2)
    ((_root_.exp ℂ (z * I) + _root_.exp ℂ (-z * I)) / 2)
k : ℕ
⊢ HasSum (fun c => ((z * I) ^ (2 * k + ↑c) / ↑(2 * k + ↑c)! + (-z * I) ^ (2 * k + ↑c) / ↑(2 * k + ↑c)!) / 2)
    ((z * I) ^ (2 * k) / ↑(2 * k)!)
[PROOFSTEP]
convert hasSum_fintype (_ : Fin 2 → ℂ) using 1
[GOAL]
case h.e'_6
z : ℂ
this :
  HasSum
    (fun x =>
      ((z * I) ^ (2 * x.fst + ↑x.snd) / ↑(2 * x.fst + ↑x.snd)! +
          (-z * I) ^ (2 * x.fst + ↑x.snd) / ↑(2 * x.fst + ↑x.snd)!) /
        2)
    ((_root_.exp ℂ (z * I) + _root_.exp ℂ (-z * I)) / 2)
k : ℕ
⊢ (z * I) ^ (2 * k) / ↑(2 * k)! =
    Finset.sum Finset.univ fun b =>
      ((z * I) ^ (2 * k + ↑b) / ↑(2 * k + ↑b)! + (-z * I) ^ (2 * k + ↑b) / ↑(2 * k + ↑b)!) / 2
[PROOFSTEP]
rw [Fin.sum_univ_two]
[GOAL]
case h.e'_6
z : ℂ
this :
  HasSum
    (fun x =>
      ((z * I) ^ (2 * x.fst + ↑x.snd) / ↑(2 * x.fst + ↑x.snd)! +
          (-z * I) ^ (2 * x.fst + ↑x.snd) / ↑(2 * x.fst + ↑x.snd)!) /
        2)
    ((_root_.exp ℂ (z * I) + _root_.exp ℂ (-z * I)) / 2)
k : ℕ
⊢ (z * I) ^ (2 * k) / ↑(2 * k)! =
    ((z * I) ^ (2 * k + ↑0) / ↑(2 * k + ↑0)! + (-z * I) ^ (2 * k + ↑0) / ↑(2 * k + ↑0)!) / 2 +
      ((z * I) ^ (2 * k + ↑1) / ↑(2 * k + ↑1)! + (-z * I) ^ (2 * k + ↑1) / ↑(2 * k + ↑1)!) / 2
[PROOFSTEP]
simp_rw [Fin.val_zero, Fin.val_one, add_zero, pow_succ', pow_mul, mul_pow, neg_sq, ← two_mul, neg_mul, mul_neg, neg_div,
  add_right_neg, zero_div, add_zero, mul_div_cancel_left _ (two_ne_zero : (2 : ℂ) ≠ 0)]
[GOAL]
z : ℂ
⊢ HasSum (fun n => (z * I) ^ (2 * n + 1) / ↑(2 * n + 1)! / I) (sin z)
[PROOFSTEP]
rw [Complex.sin, Complex.exp_eq_exp_ℂ]
[GOAL]
z : ℂ
⊢ HasSum (fun n => (z * I) ^ (2 * n + 1) / ↑(2 * n + 1)! / I) ((_root_.exp ℂ (-z * I) - _root_.exp ℂ (z * I)) * I / 2)
[PROOFSTEP]
have :=
  (((expSeries_div_hasSum_exp ℂ (-z * Complex.I)).sub (expSeries_div_hasSum_exp ℂ (z * Complex.I))).mul_right
        Complex.I).div_const
    2
[GOAL]
z : ℂ
this :
  HasSum (fun i => ((-z * I) ^ i / ↑i ! - (z * I) ^ i / ↑i !) * I / 2)
    ((_root_.exp ℂ (-z * I) - _root_.exp ℂ (z * I)) * I / 2)
⊢ HasSum (fun n => (z * I) ^ (2 * n + 1) / ↑(2 * n + 1)! / I) ((_root_.exp ℂ (-z * I) - _root_.exp ℂ (z * I)) * I / 2)
[PROOFSTEP]
replace := (Nat.divModEquiv 2).symm.hasSum_iff.mpr this
[GOAL]
z : ℂ
this :
  HasSum ((fun i => ((-z * I) ^ i / ↑i ! - (z * I) ^ i / ↑i !) * I / 2) ∘ ↑(Nat.divModEquiv 2).symm)
    ((_root_.exp ℂ (-z * I) - _root_.exp ℂ (z * I)) * I / 2)
⊢ HasSum (fun n => (z * I) ^ (2 * n + 1) / ↑(2 * n + 1)! / I) ((_root_.exp ℂ (-z * I) - _root_.exp ℂ (z * I)) * I / 2)
[PROOFSTEP]
dsimp [Function.comp] at this
[GOAL]
z : ℂ
this :
  HasSum
    (fun x =>
      ((-z * I) ^ (x.fst * 2 + ↑x.snd) / ↑(x.fst * 2 + ↑x.snd)! -
            (z * I) ^ (x.fst * 2 + ↑x.snd) / ↑(x.fst * 2 + ↑x.snd)!) *
          I /
        2)
    ((_root_.exp ℂ (-z * I) - _root_.exp ℂ (z * I)) * I / 2)
⊢ HasSum (fun n => (z * I) ^ (2 * n + 1) / ↑(2 * n + 1)! / I) ((_root_.exp ℂ (-z * I) - _root_.exp ℂ (z * I)) * I / 2)
[PROOFSTEP]
simp_rw [← mul_comm 2 _] at this
[GOAL]
z : ℂ
this :
  HasSum
    (fun x =>
      ((-z * I) ^ (2 * x.fst + ↑x.snd) / ↑(2 * x.fst + ↑x.snd)! -
            (z * I) ^ (2 * x.fst + ↑x.snd) / ↑(2 * x.fst + ↑x.snd)!) *
          I /
        2)
    ((_root_.exp ℂ (-z * I) - _root_.exp ℂ (z * I)) * I / 2)
⊢ HasSum (fun n => (z * I) ^ (2 * n + 1) / ↑(2 * n + 1)! / I) ((_root_.exp ℂ (-z * I) - _root_.exp ℂ (z * I)) * I / 2)
[PROOFSTEP]
refine' this.prod_fiberwise fun k => _
[GOAL]
z : ℂ
this :
  HasSum
    (fun x =>
      ((-z * I) ^ (2 * x.fst + ↑x.snd) / ↑(2 * x.fst + ↑x.snd)! -
            (z * I) ^ (2 * x.fst + ↑x.snd) / ↑(2 * x.fst + ↑x.snd)!) *
          I /
        2)
    ((_root_.exp ℂ (-z * I) - _root_.exp ℂ (z * I)) * I / 2)
k : ℕ
⊢ HasSum
    (fun c =>
      ((-z * I) ^ (2 * (k, c).fst + ↑(k, c).snd) / ↑(2 * (k, c).fst + ↑(k, c).snd)! -
            (z * I) ^ (2 * (k, c).fst + ↑(k, c).snd) / ↑(2 * (k, c).fst + ↑(k, c).snd)!) *
          I /
        2)
    ((z * I) ^ (2 * k + 1) / ↑(2 * k + 1)! / I)
[PROOFSTEP]
dsimp only
[GOAL]
z : ℂ
this :
  HasSum
    (fun x =>
      ((-z * I) ^ (2 * x.fst + ↑x.snd) / ↑(2 * x.fst + ↑x.snd)! -
            (z * I) ^ (2 * x.fst + ↑x.snd) / ↑(2 * x.fst + ↑x.snd)!) *
          I /
        2)
    ((_root_.exp ℂ (-z * I) - _root_.exp ℂ (z * I)) * I / 2)
k : ℕ
⊢ HasSum (fun c => ((-z * I) ^ (2 * k + ↑c) / ↑(2 * k + ↑c)! - (z * I) ^ (2 * k + ↑c) / ↑(2 * k + ↑c)!) * I / 2)
    ((z * I) ^ (2 * k + 1) / ↑(2 * k + 1)! / I)
[PROOFSTEP]
convert hasSum_fintype (_ : Fin 2 → ℂ) using 1
[GOAL]
case h.e'_6
z : ℂ
this :
  HasSum
    (fun x =>
      ((-z * I) ^ (2 * x.fst + ↑x.snd) / ↑(2 * x.fst + ↑x.snd)! -
            (z * I) ^ (2 * x.fst + ↑x.snd) / ↑(2 * x.fst + ↑x.snd)!) *
          I /
        2)
    ((_root_.exp ℂ (-z * I) - _root_.exp ℂ (z * I)) * I / 2)
k : ℕ
⊢ (z * I) ^ (2 * k + 1) / ↑(2 * k + 1)! / I =
    Finset.sum Finset.univ fun b =>
      ((-z * I) ^ (2 * k + ↑b) / ↑(2 * k + ↑b)! - (z * I) ^ (2 * k + ↑b) / ↑(2 * k + ↑b)!) * I / 2
[PROOFSTEP]
rw [Fin.sum_univ_two]
[GOAL]
case h.e'_6
z : ℂ
this :
  HasSum
    (fun x =>
      ((-z * I) ^ (2 * x.fst + ↑x.snd) / ↑(2 * x.fst + ↑x.snd)! -
            (z * I) ^ (2 * x.fst + ↑x.snd) / ↑(2 * x.fst + ↑x.snd)!) *
          I /
        2)
    ((_root_.exp ℂ (-z * I) - _root_.exp ℂ (z * I)) * I / 2)
k : ℕ
⊢ (z * I) ^ (2 * k + 1) / ↑(2 * k + 1)! / I =
    ((-z * I) ^ (2 * k + ↑0) / ↑(2 * k + ↑0)! - (z * I) ^ (2 * k + ↑0) / ↑(2 * k + ↑0)!) * I / 2 +
      ((-z * I) ^ (2 * k + ↑1) / ↑(2 * k + ↑1)! - (z * I) ^ (2 * k + ↑1) / ↑(2 * k + ↑1)!) * I / 2
[PROOFSTEP]
simp_rw [Fin.val_zero, Fin.val_one, add_zero, pow_succ', pow_mul, mul_pow, neg_sq, sub_self, zero_mul, zero_div,
  zero_add, neg_mul, mul_neg, neg_div, ← neg_add', ← two_mul, neg_mul, neg_div, mul_assoc,
  mul_div_cancel_left _ (two_ne_zero : (2 : ℂ) ≠ 0), Complex.div_I]
[GOAL]
z : ℂ
⊢ HasSum (fun n => (-1) ^ n * z ^ (2 * n) / ↑(2 * n)!) (cos z)
[PROOFSTEP]
convert Complex.hasSum_cos' z using 1
[GOAL]
case h.e'_5
z : ℂ
⊢ (fun n => (-1) ^ n * z ^ (2 * n) / ↑(2 * n)!) = fun n => (z * I) ^ (2 * n) / ↑(2 * n)!
[PROOFSTEP]
simp_rw [mul_pow, pow_mul, Complex.I_sq, mul_comm]
[GOAL]
z : ℂ
⊢ HasSum (fun n => (-1) ^ n * z ^ (2 * n + 1) / ↑(2 * n + 1)!) (sin z)
[PROOFSTEP]
convert Complex.hasSum_sin' z using 1
[GOAL]
case h.e'_5
z : ℂ
⊢ (fun n => (-1) ^ n * z ^ (2 * n + 1) / ↑(2 * n + 1)!) = fun n => (z * I) ^ (2 * n + 1) / ↑(2 * n + 1)! / I
[PROOFSTEP]
simp_rw [mul_pow, pow_succ', pow_mul, Complex.I_sq, ← mul_assoc, mul_div_assoc, div_right_comm,
  div_self Complex.I_ne_zero, mul_comm _ ((-1 : ℂ) ^ _), mul_one_div, mul_div_assoc, mul_assoc]
[GOAL]
r : ℝ
⊢ HasSum (fun n => (-1) ^ n * r ^ (2 * n) / ↑(2 * n)!) (cos r)
[PROOFSTEP]
exact_mod_cast Complex.hasSum_cos r
[GOAL]
r : ℝ
⊢ HasSum (fun n => (-1) ^ n * r ^ (2 * n + 1) / ↑(2 * n + 1)!) (sin r)
[PROOFSTEP]
exact_mod_cast Complex.hasSum_sin r


[GOAL]
E : Type u_1
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : HasContDiffBump E
inst✝ : MeasurableSpace E
c : E
f : ContDiffBump c
x✝ : E
n : ℕ∞
μ : Measure E
x : E
⊢ ContDiffBump.normed f μ (c - x) = ContDiffBump.normed f μ (c + x)
[PROOFSTEP]
simp_rw [f.normed_def, f.sub]
[GOAL]
E : Type u_1
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : HasContDiffBump E
inst✝ : MeasurableSpace E
c : E
f✝ : ContDiffBump c
x✝ : E
n : ℕ∞
μ : Measure E
f : ContDiffBump 0
x : E
⊢ ContDiffBump.normed f μ (-x) = ContDiffBump.normed f μ x
[PROOFSTEP]
simp_rw [f.normed_def, f.neg]
[GOAL]
E : Type u_1
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : HasContDiffBump E
inst✝⁴ : MeasurableSpace E
c : E
f : ContDiffBump c
x : E
n : ℕ∞
μ : Measure E
inst✝³ : BorelSpace E
inst✝² : FiniteDimensional ℝ E
inst✝¹ : IsLocallyFiniteMeasure μ
inst✝ : IsOpenPosMeasure μ
⊢ 0 < ∫ (x : E), ↑f x ∂μ
[PROOFSTEP]
refine' (integral_pos_iff_support_of_nonneg f.nonneg' f.integrable).mpr _
[GOAL]
E : Type u_1
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : HasContDiffBump E
inst✝⁴ : MeasurableSpace E
c : E
f : ContDiffBump c
x : E
n : ℕ∞
μ : Measure E
inst✝³ : BorelSpace E
inst✝² : FiniteDimensional ℝ E
inst✝¹ : IsLocallyFiniteMeasure μ
inst✝ : IsOpenPosMeasure μ
⊢ 0 < ↑↑μ (support fun i => ↑f i)
[PROOFSTEP]
rw [f.support_eq]
[GOAL]
E : Type u_1
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : HasContDiffBump E
inst✝⁴ : MeasurableSpace E
c : E
f : ContDiffBump c
x : E
n : ℕ∞
μ : Measure E
inst✝³ : BorelSpace E
inst✝² : FiniteDimensional ℝ E
inst✝¹ : IsLocallyFiniteMeasure μ
inst✝ : IsOpenPosMeasure μ
⊢ 0 < ↑↑μ (ball c f.rOut)
[PROOFSTEP]
exact measure_ball_pos μ c f.rOut_pos
[GOAL]
E : Type u_1
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : HasContDiffBump E
inst✝⁴ : MeasurableSpace E
c : E
f : ContDiffBump c
x : E
n : ℕ∞
μ : Measure E
inst✝³ : BorelSpace E
inst✝² : FiniteDimensional ℝ E
inst✝¹ : IsLocallyFiniteMeasure μ
inst✝ : IsOpenPosMeasure μ
⊢ ∫ (x : E), ContDiffBump.normed f μ x ∂μ = 1
[PROOFSTEP]
simp_rw [ContDiffBump.normed, div_eq_mul_inv, mul_comm (f _), ← smul_eq_mul, integral_smul]
[GOAL]
E : Type u_1
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : HasContDiffBump E
inst✝⁴ : MeasurableSpace E
c : E
f : ContDiffBump c
x : E
n : ℕ∞
μ : Measure E
inst✝³ : BorelSpace E
inst✝² : FiniteDimensional ℝ E
inst✝¹ : IsLocallyFiniteMeasure μ
inst✝ : IsOpenPosMeasure μ
⊢ (∫ (x : E), ↑f x ∂μ)⁻¹ • ∫ (x : E), ↑f x ∂μ = 1
[PROOFSTEP]
exact inv_mul_cancel f.integral_pos.ne'
[GOAL]
E : Type u_1
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : HasContDiffBump E
inst✝⁴ : MeasurableSpace E
c : E
f : ContDiffBump c
x : E
n : ℕ∞
μ : Measure E
inst✝³ : BorelSpace E
inst✝² : FiniteDimensional ℝ E
inst✝¹ : IsLocallyFiniteMeasure μ
inst✝ : IsOpenPosMeasure μ
⊢ support (ContDiffBump.normed f μ) = ball c f.rOut
[PROOFSTEP]
unfold ContDiffBump.normed
[GOAL]
E : Type u_1
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : HasContDiffBump E
inst✝⁴ : MeasurableSpace E
c : E
f : ContDiffBump c
x : E
n : ℕ∞
μ : Measure E
inst✝³ : BorelSpace E
inst✝² : FiniteDimensional ℝ E
inst✝¹ : IsLocallyFiniteMeasure μ
inst✝ : IsOpenPosMeasure μ
⊢ (support fun x => ↑f x / ∫ (x : E), ↑f x ∂μ) = ball c f.rOut
[PROOFSTEP]
rw [support_div, f.support_eq, support_const f.integral_pos.ne', inter_univ]
[GOAL]
E : Type u_1
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : HasContDiffBump E
inst✝⁴ : MeasurableSpace E
c : E
f : ContDiffBump c
x : E
n : ℕ∞
μ : Measure E
inst✝³ : BorelSpace E
inst✝² : FiniteDimensional ℝ E
inst✝¹ : IsLocallyFiniteMeasure μ
inst✝ : IsOpenPosMeasure μ
⊢ tsupport (ContDiffBump.normed f μ) = closedBall c f.rOut
[PROOFSTEP]
rw [tsupport, f.support_normed_eq, closure_ball _ f.rOut_pos.ne']
[GOAL]
E : Type u_1
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : HasContDiffBump E
inst✝⁴ : MeasurableSpace E
c : E
f : ContDiffBump c
x : E
n : ℕ∞
μ : Measure E
inst✝³ : BorelSpace E
inst✝² : FiniteDimensional ℝ E
inst✝¹ : IsLocallyFiniteMeasure μ
inst✝ : IsOpenPosMeasure μ
⊢ HasCompactSupport (ContDiffBump.normed f μ)
[PROOFSTEP]
simp only [HasCompactSupport, f.tsupport_normed_eq (μ := μ), isCompact_closedBall]
[GOAL]
E : Type u_1
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : HasContDiffBump E
inst✝⁴ : MeasurableSpace E
c : E
f : ContDiffBump c
x : E
n : ℕ∞
μ : Measure E
inst✝³ : BorelSpace E
inst✝² : FiniteDimensional ℝ E
inst✝¹ : IsLocallyFiniteMeasure μ
inst✝ : IsOpenPosMeasure μ
ι : Type u_2
φ : ι → ContDiffBump c
l : Filter ι
hφ : Tendsto (fun i => (φ i).rOut) l (𝓝 0)
⊢ Tendsto (fun i => support fun x => ContDiffBump.normed (φ i) μ x) l (smallSets (𝓝 c))
[PROOFSTEP]
simp_rw [NormedAddCommGroup.tendsto_nhds_zero, Real.norm_eq_abs, abs_eq_self.mpr (φ _).rOut_pos.le] at hφ
[GOAL]
E : Type u_1
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : HasContDiffBump E
inst✝⁴ : MeasurableSpace E
c : E
f : ContDiffBump c
x : E
n : ℕ∞
μ : Measure E
inst✝³ : BorelSpace E
inst✝² : FiniteDimensional ℝ E
inst✝¹ : IsLocallyFiniteMeasure μ
inst✝ : IsOpenPosMeasure μ
ι : Type u_2
φ : ι → ContDiffBump c
l : Filter ι
hφ : ∀ (ε : ℝ), ε > 0 → ∀ᶠ (x : ι) in l, (φ x).rOut < ε
⊢ Tendsto (fun i => support fun x => ContDiffBump.normed (φ i) μ x) l (smallSets (𝓝 c))
[PROOFSTEP]
rw [nhds_basis_ball.smallSets.tendsto_right_iff]
[GOAL]
E : Type u_1
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : HasContDiffBump E
inst✝⁴ : MeasurableSpace E
c : E
f : ContDiffBump c
x : E
n : ℕ∞
μ : Measure E
inst✝³ : BorelSpace E
inst✝² : FiniteDimensional ℝ E
inst✝¹ : IsLocallyFiniteMeasure μ
inst✝ : IsOpenPosMeasure μ
ι : Type u_2
φ : ι → ContDiffBump c
l : Filter ι
hφ : ∀ (ε : ℝ), ε > 0 → ∀ᶠ (x : ι) in l, (φ x).rOut < ε
⊢ ∀ (i : ℝ), 0 < i → ∀ᶠ (x : ι) in l, (support fun x_1 => ContDiffBump.normed (φ x) μ x_1) ∈ 𝒫 ball c i
[PROOFSTEP]
refine fun ε hε ↦ (hφ ε hε).mono fun i hi ↦ ?_
[GOAL]
E : Type u_1
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : HasContDiffBump E
inst✝⁴ : MeasurableSpace E
c : E
f : ContDiffBump c
x : E
n : ℕ∞
μ : Measure E
inst✝³ : BorelSpace E
inst✝² : FiniteDimensional ℝ E
inst✝¹ : IsLocallyFiniteMeasure μ
inst✝ : IsOpenPosMeasure μ
ι : Type u_2
φ : ι → ContDiffBump c
l : Filter ι
hφ : ∀ (ε : ℝ), ε > 0 → ∀ᶠ (x : ι) in l, (φ x).rOut < ε
ε : ℝ
hε : 0 < ε
i : ι
hi : (φ i).rOut < ε
⊢ (support fun x => ContDiffBump.normed (φ i) μ x) ∈ 𝒫 ball c ε
[PROOFSTEP]
rw [(φ i).support_normed_eq]
[GOAL]
E : Type u_1
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : HasContDiffBump E
inst✝⁴ : MeasurableSpace E
c : E
f : ContDiffBump c
x : E
n : ℕ∞
μ : Measure E
inst✝³ : BorelSpace E
inst✝² : FiniteDimensional ℝ E
inst✝¹ : IsLocallyFiniteMeasure μ
inst✝ : IsOpenPosMeasure μ
ι : Type u_2
φ : ι → ContDiffBump c
l : Filter ι
hφ : ∀ (ε : ℝ), ε > 0 → ∀ᶠ (x : ι) in l, (φ x).rOut < ε
ε : ℝ
hε : 0 < ε
i : ι
hi : (φ i).rOut < ε
⊢ ball c (φ i).rOut ∈ 𝒫 ball c ε
[PROOFSTEP]
exact ball_subset_ball hi.le
[GOAL]
E : Type u_1
inst✝¹⁰ : NormedAddCommGroup E
inst✝⁹ : NormedSpace ℝ E
inst✝⁸ : HasContDiffBump E
inst✝⁷ : MeasurableSpace E
c : E
f : ContDiffBump c
x : E
n : ℕ∞
μ : Measure E
inst✝⁶ : BorelSpace E
inst✝⁵ : FiniteDimensional ℝ E
inst✝⁴ : IsLocallyFiniteMeasure μ
inst✝³ : IsOpenPosMeasure μ
X : Type u_2
inst✝² : NormedAddCommGroup X
inst✝¹ : NormedSpace ℝ X
inst✝ : CompleteSpace X
z : X
⊢ ∫ (x : E), ContDiffBump.normed f μ x • z ∂μ = z
[PROOFSTEP]
simp_rw [integral_smul_const, f.integral_normed (μ := μ), one_smul]
[GOAL]
E : Type u_1
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : HasContDiffBump E
inst✝⁴ : MeasurableSpace E
c : E
f : ContDiffBump c
x : E
n : ℕ∞
μ : Measure E
inst✝³ : BorelSpace E
inst✝² : FiniteDimensional ℝ E
inst✝¹ : IsLocallyFiniteMeasure μ
inst✝ : IsOpenPosMeasure μ
⊢ ENNReal.toReal (↑↑μ (closedBall c f.rIn)) ≤ ∫ (x : E), ↑f x ∂μ
[PROOFSTEP]
calc
  (μ (closedBall c f.rIn)).toReal = ∫ x in closedBall c f.rIn, 1 ∂μ := by simp
  _ = ∫ x in closedBall c f.rIn, f x ∂μ :=
    (set_integral_congr (measurableSet_closedBall) (fun x hx ↦ (one_of_mem_closedBall f hx).symm))
  _ ≤ ∫ x, f x ∂μ := set_integral_le_integral f.integrable (eventually_of_forall (fun x ↦ f.nonneg))
[GOAL]
E : Type u_1
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : HasContDiffBump E
inst✝⁴ : MeasurableSpace E
c : E
f : ContDiffBump c
x : E
n : ℕ∞
μ : Measure E
inst✝³ : BorelSpace E
inst✝² : FiniteDimensional ℝ E
inst✝¹ : IsLocallyFiniteMeasure μ
inst✝ : IsOpenPosMeasure μ
⊢ ENNReal.toReal (↑↑μ (closedBall c f.rIn)) = ∫ (x : E) in closedBall c f.rIn, 1 ∂μ
[PROOFSTEP]
simp
[GOAL]
E : Type u_1
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : HasContDiffBump E
inst✝⁴ : MeasurableSpace E
c : E
f : ContDiffBump c
x✝ : E
n : ℕ∞
μ : Measure E
inst✝³ : BorelSpace E
inst✝² : FiniteDimensional ℝ E
inst✝¹ : IsLocallyFiniteMeasure μ
inst✝ : IsOpenPosMeasure μ
x : E
⊢ ContDiffBump.normed f μ x ≤ 1 / ENNReal.toReal (↑↑μ (closedBall c f.rIn))
[PROOFSTEP]
rw [normed_def]
[GOAL]
E : Type u_1
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : HasContDiffBump E
inst✝⁴ : MeasurableSpace E
c : E
f : ContDiffBump c
x✝ : E
n : ℕ∞
μ : Measure E
inst✝³ : BorelSpace E
inst✝² : FiniteDimensional ℝ E
inst✝¹ : IsLocallyFiniteMeasure μ
inst✝ : IsOpenPosMeasure μ
x : E
⊢ ↑f x / ∫ (x : E), ↑f x ∂μ ≤ 1 / ENNReal.toReal (↑↑μ (closedBall c f.rIn))
[PROOFSTEP]
gcongr
[GOAL]
case hd
E : Type u_1
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : HasContDiffBump E
inst✝⁴ : MeasurableSpace E
c : E
f : ContDiffBump c
x✝ : E
n : ℕ∞
μ : Measure E
inst✝³ : BorelSpace E
inst✝² : FiniteDimensional ℝ E
inst✝¹ : IsLocallyFiniteMeasure μ
inst✝ : IsOpenPosMeasure μ
x : E
⊢ 0 < ENNReal.toReal (↑↑μ (closedBall c f.rIn))
[PROOFSTEP]
exact ENNReal.toReal_pos (measure_closedBall_pos _ _ f.rIn_pos).ne' measure_closedBall_lt_top.ne
[GOAL]
case hac
E : Type u_1
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : HasContDiffBump E
inst✝⁴ : MeasurableSpace E
c : E
f : ContDiffBump c
x✝ : E
n : ℕ∞
μ : Measure E
inst✝³ : BorelSpace E
inst✝² : FiniteDimensional ℝ E
inst✝¹ : IsLocallyFiniteMeasure μ
inst✝ : IsOpenPosMeasure μ
x : E
⊢ ↑f x ≤ 1
[PROOFSTEP]
exact f.le_one
[GOAL]
case hbd
E : Type u_1
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : HasContDiffBump E
inst✝⁴ : MeasurableSpace E
c : E
f : ContDiffBump c
x✝ : E
n : ℕ∞
μ : Measure E
inst✝³ : BorelSpace E
inst✝² : FiniteDimensional ℝ E
inst✝¹ : IsLocallyFiniteMeasure μ
inst✝ : IsOpenPosMeasure μ
x : E
⊢ ENNReal.toReal (↑↑μ (closedBall c f.rIn)) ≤ ∫ (x : E), ↑f x ∂μ
[PROOFSTEP]
exact f.measure_closedBall_le_integral μ
[GOAL]
E : Type u_1
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : HasContDiffBump E
inst✝⁴ : MeasurableSpace E
c : E
f : ContDiffBump c
x : E
n : ℕ∞
μ : Measure E
inst✝³ : BorelSpace E
inst✝² : FiniteDimensional ℝ E
inst✝¹ : IsLocallyFiniteMeasure μ
inst✝ : IsOpenPosMeasure μ
⊢ ∫ (x : E), ↑f x ∂μ ≤ ENNReal.toReal (↑↑μ (closedBall c f.rOut))
[PROOFSTEP]
calc
  ∫ x, f x ∂μ = ∫ x in closedBall c f.rOut, f x ∂μ :=
    by
    apply (set_integral_eq_integral_of_forall_compl_eq_zero (fun x hx ↦ ?_)).symm
    apply f.zero_of_le_dist (le_of_lt _)
    simpa using hx
  _ ≤ ∫ x in closedBall c f.rOut, 1 ∂μ :=
    by
    apply set_integral_mono f.integrable.integrableOn _ (fun x ↦ f.le_one)
    simp [measure_closedBall_lt_top]
  _ = (μ (closedBall c f.rOut)).toReal := by simp
[GOAL]
E : Type u_1
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : HasContDiffBump E
inst✝⁴ : MeasurableSpace E
c : E
f : ContDiffBump c
x : E
n : ℕ∞
μ : Measure E
inst✝³ : BorelSpace E
inst✝² : FiniteDimensional ℝ E
inst✝¹ : IsLocallyFiniteMeasure μ
inst✝ : IsOpenPosMeasure μ
⊢ ∫ (x : E), ↑f x ∂μ = ∫ (x : E) in closedBall c f.rOut, ↑f x ∂μ
[PROOFSTEP]
apply (set_integral_eq_integral_of_forall_compl_eq_zero (fun x hx ↦ ?_)).symm
[GOAL]
E : Type u_1
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : HasContDiffBump E
inst✝⁴ : MeasurableSpace E
c : E
f : ContDiffBump c
x✝ : E
n : ℕ∞
μ : Measure E
inst✝³ : BorelSpace E
inst✝² : FiniteDimensional ℝ E
inst✝¹ : IsLocallyFiniteMeasure μ
inst✝ : IsOpenPosMeasure μ
x : E
hx : ¬x ∈ closedBall c f.rOut
⊢ ↑f x = 0
[PROOFSTEP]
apply f.zero_of_le_dist (le_of_lt _)
[GOAL]
E : Type u_1
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : HasContDiffBump E
inst✝⁴ : MeasurableSpace E
c : E
f : ContDiffBump c
x✝ : E
n : ℕ∞
μ : Measure E
inst✝³ : BorelSpace E
inst✝² : FiniteDimensional ℝ E
inst✝¹ : IsLocallyFiniteMeasure μ
inst✝ : IsOpenPosMeasure μ
x : E
hx : ¬x ∈ closedBall c f.rOut
⊢ f.rOut < dist x c
[PROOFSTEP]
simpa using hx
[GOAL]
E : Type u_1
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : HasContDiffBump E
inst✝⁴ : MeasurableSpace E
c : E
f : ContDiffBump c
x : E
n : ℕ∞
μ : Measure E
inst✝³ : BorelSpace E
inst✝² : FiniteDimensional ℝ E
inst✝¹ : IsLocallyFiniteMeasure μ
inst✝ : IsOpenPosMeasure μ
⊢ ∫ (x : E) in closedBall c f.rOut, ↑f x ∂μ ≤ ∫ (x : E) in closedBall c f.rOut, 1 ∂μ
[PROOFSTEP]
apply set_integral_mono f.integrable.integrableOn _ (fun x ↦ f.le_one)
[GOAL]
E : Type u_1
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : HasContDiffBump E
inst✝⁴ : MeasurableSpace E
c : E
f : ContDiffBump c
x : E
n : ℕ∞
μ : Measure E
inst✝³ : BorelSpace E
inst✝² : FiniteDimensional ℝ E
inst✝¹ : IsLocallyFiniteMeasure μ
inst✝ : IsOpenPosMeasure μ
⊢ IntegrableOn (fun x => 1) (closedBall c f.rOut)
[PROOFSTEP]
simp [measure_closedBall_lt_top]
[GOAL]
E : Type u_1
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : HasContDiffBump E
inst✝⁴ : MeasurableSpace E
c : E
f : ContDiffBump c
x : E
n : ℕ∞
μ : Measure E
inst✝³ : BorelSpace E
inst✝² : FiniteDimensional ℝ E
inst✝¹ : IsLocallyFiniteMeasure μ
inst✝ : IsOpenPosMeasure μ
⊢ ∫ (x : E) in closedBall c f.rOut, 1 ∂μ = ENNReal.toReal (↑↑μ (closedBall c f.rOut))
[PROOFSTEP]
simp
[GOAL]
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : NormedSpace ℝ E
inst✝⁶ : HasContDiffBump E
inst✝⁵ : MeasurableSpace E
c : E
f : ContDiffBump c
x : E
n : ℕ∞
μ : Measure E
inst✝⁴ : BorelSpace E
inst✝³ : FiniteDimensional ℝ E
inst✝² : IsLocallyFiniteMeasure μ
inst✝¹ : IsOpenPosMeasure μ
inst✝ : IsAddHaarMeasure μ
K : ℝ
h : f.rOut ≤ K * f.rIn
⊢ ENNReal.toReal (↑↑μ (closedBall c f.rOut)) / K ^ finrank ℝ E ≤ ∫ (x : E), ↑f x ∂μ
[PROOFSTEP]
have K_pos : 0 < K := by simpa [f.rIn_pos, not_lt.2 f.rIn_pos.le] using mul_pos_iff.1 (f.rOut_pos.trans_le h)
[GOAL]
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : NormedSpace ℝ E
inst✝⁶ : HasContDiffBump E
inst✝⁵ : MeasurableSpace E
c : E
f : ContDiffBump c
x : E
n : ℕ∞
μ : Measure E
inst✝⁴ : BorelSpace E
inst✝³ : FiniteDimensional ℝ E
inst✝² : IsLocallyFiniteMeasure μ
inst✝¹ : IsOpenPosMeasure μ
inst✝ : IsAddHaarMeasure μ
K : ℝ
h : f.rOut ≤ K * f.rIn
⊢ 0 < K
[PROOFSTEP]
simpa [f.rIn_pos, not_lt.2 f.rIn_pos.le] using mul_pos_iff.1 (f.rOut_pos.trans_le h)
[GOAL]
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : NormedSpace ℝ E
inst✝⁶ : HasContDiffBump E
inst✝⁵ : MeasurableSpace E
c : E
f : ContDiffBump c
x : E
n : ℕ∞
μ : Measure E
inst✝⁴ : BorelSpace E
inst✝³ : FiniteDimensional ℝ E
inst✝² : IsLocallyFiniteMeasure μ
inst✝¹ : IsOpenPosMeasure μ
inst✝ : IsAddHaarMeasure μ
K : ℝ
h : f.rOut ≤ K * f.rIn
K_pos : 0 < K
⊢ ENNReal.toReal (↑↑μ (closedBall c f.rOut)) / K ^ finrank ℝ E ≤ ∫ (x : E), ↑f x ∂μ
[PROOFSTEP]
apply le_trans _ (f.measure_closedBall_le_integral μ)
[GOAL]
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : NormedSpace ℝ E
inst✝⁶ : HasContDiffBump E
inst✝⁵ : MeasurableSpace E
c : E
f : ContDiffBump c
x : E
n : ℕ∞
μ : Measure E
inst✝⁴ : BorelSpace E
inst✝³ : FiniteDimensional ℝ E
inst✝² : IsLocallyFiniteMeasure μ
inst✝¹ : IsOpenPosMeasure μ
inst✝ : IsAddHaarMeasure μ
K : ℝ
h : f.rOut ≤ K * f.rIn
K_pos : 0 < K
⊢ ENNReal.toReal (↑↑μ (closedBall c f.rOut)) / K ^ finrank ℝ E ≤ ENNReal.toReal (↑↑μ (closedBall c f.rIn))
[PROOFSTEP]
rw [div_le_iff (pow_pos K_pos _), addHaar_closedBall' _ _ f.rIn_pos.le, addHaar_closedBall' _ _ f.rOut_pos.le,
  ENNReal.toReal_mul, ENNReal.toReal_mul, ENNReal.toReal_ofReal (pow_nonneg f.rOut_pos.le _),
  ENNReal.toReal_ofReal (pow_nonneg f.rIn_pos.le _), mul_assoc, mul_comm _ (K ^ _), ← mul_assoc, ← mul_pow,
  mul_comm _ K]
[GOAL]
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : NormedSpace ℝ E
inst✝⁶ : HasContDiffBump E
inst✝⁵ : MeasurableSpace E
c : E
f : ContDiffBump c
x : E
n : ℕ∞
μ : Measure E
inst✝⁴ : BorelSpace E
inst✝³ : FiniteDimensional ℝ E
inst✝² : IsLocallyFiniteMeasure μ
inst✝¹ : IsOpenPosMeasure μ
inst✝ : IsAddHaarMeasure μ
K : ℝ
h : f.rOut ≤ K * f.rIn
K_pos : 0 < K
⊢ f.rOut ^ finrank ℝ E * ENNReal.toReal (↑↑μ (closedBall 0 1)) ≤
    (K * f.rIn) ^ finrank ℝ E * ENNReal.toReal (↑↑μ (closedBall 0 1))
[PROOFSTEP]
gcongr
[GOAL]
case h.ha
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : NormedSpace ℝ E
inst✝⁶ : HasContDiffBump E
inst✝⁵ : MeasurableSpace E
c : E
f : ContDiffBump c
x : E
n : ℕ∞
μ : Measure E
inst✝⁴ : BorelSpace E
inst✝³ : FiniteDimensional ℝ E
inst✝² : IsLocallyFiniteMeasure μ
inst✝¹ : IsOpenPosMeasure μ
inst✝ : IsAddHaarMeasure μ
K : ℝ
h : f.rOut ≤ K * f.rIn
K_pos : 0 < K
⊢ 0 ≤ f.rOut
[PROOFSTEP]
exact f.rOut_pos.le
[GOAL]
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : NormedSpace ℝ E
inst✝⁶ : HasContDiffBump E
inst✝⁵ : MeasurableSpace E
c : E
f : ContDiffBump c
x✝ : E
n : ℕ∞
μ : Measure E
inst✝⁴ : BorelSpace E
inst✝³ : FiniteDimensional ℝ E
inst✝² : IsLocallyFiniteMeasure μ
inst✝¹ : IsOpenPosMeasure μ
inst✝ : IsAddHaarMeasure μ
K : ℝ
h : f.rOut ≤ K * f.rIn
x : E
⊢ ContDiffBump.normed f μ x ≤ K ^ finrank ℝ E / ENNReal.toReal (↑↑μ (closedBall c f.rOut))
[PROOFSTEP]
have K_pos : 0 < K := by simpa [f.rIn_pos, not_lt.2 f.rIn_pos.le] using mul_pos_iff.1 (f.rOut_pos.trans_le h)
[GOAL]
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : NormedSpace ℝ E
inst✝⁶ : HasContDiffBump E
inst✝⁵ : MeasurableSpace E
c : E
f : ContDiffBump c
x✝ : E
n : ℕ∞
μ : Measure E
inst✝⁴ : BorelSpace E
inst✝³ : FiniteDimensional ℝ E
inst✝² : IsLocallyFiniteMeasure μ
inst✝¹ : IsOpenPosMeasure μ
inst✝ : IsAddHaarMeasure μ
K : ℝ
h : f.rOut ≤ K * f.rIn
x : E
⊢ 0 < K
[PROOFSTEP]
simpa [f.rIn_pos, not_lt.2 f.rIn_pos.le] using mul_pos_iff.1 (f.rOut_pos.trans_le h)
[GOAL]
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : NormedSpace ℝ E
inst✝⁶ : HasContDiffBump E
inst✝⁵ : MeasurableSpace E
c : E
f : ContDiffBump c
x✝ : E
n : ℕ∞
μ : Measure E
inst✝⁴ : BorelSpace E
inst✝³ : FiniteDimensional ℝ E
inst✝² : IsLocallyFiniteMeasure μ
inst✝¹ : IsOpenPosMeasure μ
inst✝ : IsAddHaarMeasure μ
K : ℝ
h : f.rOut ≤ K * f.rIn
x : E
K_pos : 0 < K
⊢ ContDiffBump.normed f μ x ≤ K ^ finrank ℝ E / ENNReal.toReal (↑↑μ (closedBall c f.rOut))
[PROOFSTEP]
have : f x / ∫ y, f y ∂μ ≤ 1 / ∫ y, f y ∂μ := by
  gcongr
  · exact f.integral_pos.le
  · exact f.le_one
[GOAL]
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : NormedSpace ℝ E
inst✝⁶ : HasContDiffBump E
inst✝⁵ : MeasurableSpace E
c : E
f : ContDiffBump c
x✝ : E
n : ℕ∞
μ : Measure E
inst✝⁴ : BorelSpace E
inst✝³ : FiniteDimensional ℝ E
inst✝² : IsLocallyFiniteMeasure μ
inst✝¹ : IsOpenPosMeasure μ
inst✝ : IsAddHaarMeasure μ
K : ℝ
h : f.rOut ≤ K * f.rIn
x : E
K_pos : 0 < K
⊢ ↑f x / ∫ (y : E), ↑f y ∂μ ≤ 1 / ∫ (y : E), ↑f y ∂μ
[PROOFSTEP]
gcongr
[GOAL]
case hc
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : NormedSpace ℝ E
inst✝⁶ : HasContDiffBump E
inst✝⁵ : MeasurableSpace E
c : E
f : ContDiffBump c
x✝ : E
n : ℕ∞
μ : Measure E
inst✝⁴ : BorelSpace E
inst✝³ : FiniteDimensional ℝ E
inst✝² : IsLocallyFiniteMeasure μ
inst✝¹ : IsOpenPosMeasure μ
inst✝ : IsAddHaarMeasure μ
K : ℝ
h : f.rOut ≤ K * f.rIn
x : E
K_pos : 0 < K
⊢ 0 ≤ ∫ (y : E), ↑f y ∂μ
[PROOFSTEP]
exact f.integral_pos.le
[GOAL]
case h
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : NormedSpace ℝ E
inst✝⁶ : HasContDiffBump E
inst✝⁵ : MeasurableSpace E
c : E
f : ContDiffBump c
x✝ : E
n : ℕ∞
μ : Measure E
inst✝⁴ : BorelSpace E
inst✝³ : FiniteDimensional ℝ E
inst✝² : IsLocallyFiniteMeasure μ
inst✝¹ : IsOpenPosMeasure μ
inst✝ : IsAddHaarMeasure μ
K : ℝ
h : f.rOut ≤ K * f.rIn
x : E
K_pos : 0 < K
⊢ ↑f x ≤ 1
[PROOFSTEP]
exact f.le_one
[GOAL]
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : NormedSpace ℝ E
inst✝⁶ : HasContDiffBump E
inst✝⁵ : MeasurableSpace E
c : E
f : ContDiffBump c
x✝ : E
n : ℕ∞
μ : Measure E
inst✝⁴ : BorelSpace E
inst✝³ : FiniteDimensional ℝ E
inst✝² : IsLocallyFiniteMeasure μ
inst✝¹ : IsOpenPosMeasure μ
inst✝ : IsAddHaarMeasure μ
K : ℝ
h : f.rOut ≤ K * f.rIn
x : E
K_pos : 0 < K
this : ↑f x / ∫ (y : E), ↑f y ∂μ ≤ 1 / ∫ (y : E), ↑f y ∂μ
⊢ ContDiffBump.normed f μ x ≤ K ^ finrank ℝ E / ENNReal.toReal (↑↑μ (closedBall c f.rOut))
[PROOFSTEP]
apply this.trans
[GOAL]
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : NormedSpace ℝ E
inst✝⁶ : HasContDiffBump E
inst✝⁵ : MeasurableSpace E
c : E
f : ContDiffBump c
x✝ : E
n : ℕ∞
μ : Measure E
inst✝⁴ : BorelSpace E
inst✝³ : FiniteDimensional ℝ E
inst✝² : IsLocallyFiniteMeasure μ
inst✝¹ : IsOpenPosMeasure μ
inst✝ : IsAddHaarMeasure μ
K : ℝ
h : f.rOut ≤ K * f.rIn
x : E
K_pos : 0 < K
this : ↑f x / ∫ (y : E), ↑f y ∂μ ≤ 1 / ∫ (y : E), ↑f y ∂μ
⊢ 1 / ∫ (y : E), ↑f y ∂μ ≤ K ^ finrank ℝ E / ENNReal.toReal (↑↑μ (closedBall c f.rOut))
[PROOFSTEP]
rw [div_le_div_iff f.integral_pos, one_mul, ← div_le_iff' (pow_pos K_pos _)]
[GOAL]
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : NormedSpace ℝ E
inst✝⁶ : HasContDiffBump E
inst✝⁵ : MeasurableSpace E
c : E
f : ContDiffBump c
x✝ : E
n : ℕ∞
μ : Measure E
inst✝⁴ : BorelSpace E
inst✝³ : FiniteDimensional ℝ E
inst✝² : IsLocallyFiniteMeasure μ
inst✝¹ : IsOpenPosMeasure μ
inst✝ : IsAddHaarMeasure μ
K : ℝ
h : f.rOut ≤ K * f.rIn
x : E
K_pos : 0 < K
this : ↑f x / ∫ (y : E), ↑f y ∂μ ≤ 1 / ∫ (y : E), ↑f y ∂μ
⊢ ENNReal.toReal (↑↑μ (closedBall c f.rOut)) / K ^ finrank ℝ E ≤ ∫ (x : E), ↑f x ∂μ
[PROOFSTEP]
exact f.measure_closedBall_div_le_integral μ K h
[GOAL]
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : NormedSpace ℝ E
inst✝⁶ : HasContDiffBump E
inst✝⁵ : MeasurableSpace E
c : E
f : ContDiffBump c
x✝ : E
n : ℕ∞
μ : Measure E
inst✝⁴ : BorelSpace E
inst✝³ : FiniteDimensional ℝ E
inst✝² : IsLocallyFiniteMeasure μ
inst✝¹ : IsOpenPosMeasure μ
inst✝ : IsAddHaarMeasure μ
K : ℝ
h : f.rOut ≤ K * f.rIn
x : E
K_pos : 0 < K
this : ↑f x / ∫ (y : E), ↑f y ∂μ ≤ 1 / ∫ (y : E), ↑f y ∂μ
⊢ 0 < ENNReal.toReal (↑↑μ (closedBall c f.rOut))
[PROOFSTEP]
exact ENNReal.toReal_pos (measure_closedBall_pos _ _ f.rOut_pos).ne' measure_closedBall_lt_top.ne


[GOAL]
C : Type u₁
inst✝² : Category.{v₁, u₁} C
D : Type u₂
inst✝¹ : Category.{v₂, u₂} D
E : Type u₃
inst✝ : Category.{v₃, u₃} E
X : (C × D) × E
⊢ (𝟭 ((C × D) × E)).obj X = (associator C D E ⋙ inverseAssociator C D E).obj X
[PROOFSTEP]
simp
[GOAL]
C : Type u₁
inst✝² : Category.{v₁, u₁} C
D : Type u₂
inst✝¹ : Category.{v₂, u₂} D
E : Type u₃
inst✝ : Category.{v₃, u₃} E
X : C × D × E
⊢ (inverseAssociator C D E ⋙ associator C D E).obj X = (𝟭 (C × D × E)).obj X
[PROOFSTEP]
simp
[GOAL]
C : Type u₁
inst✝² : Category.{v₁, u₁} C
D : Type u₂
inst✝¹ : Category.{v₂, u₂} D
E : Type u₃
inst✝ : Category.{v₃, u₃} E
⊢ IsEquivalence (associativity C D E).functor
[PROOFSTEP]
infer_instance
[GOAL]
C : Type u₁
inst✝² : Category.{v₁, u₁} C
D : Type u₂
inst✝¹ : Category.{v₂, u₂} D
E : Type u₃
inst✝ : Category.{v₃, u₃} E
⊢ IsEquivalence (associativity C D E).inverse
[PROOFSTEP]
infer_instance


[GOAL]
f : Natβ Natα.zero → WType Natβ
⊢ ofNat (toNat (mk Natα.zero f)) = mk Natα.zero f
[PROOFSTEP]
rw [toNat, ofNat]
[GOAL]
f : Natβ Natα.zero → WType Natβ
⊢ mk Natα.zero Empty.elim = mk Natα.zero f
[PROOFSTEP]
congr
[GOAL]
case e_f
f : Natβ Natα.zero → WType Natβ
⊢ Empty.elim = f
[PROOFSTEP]
ext x
[GOAL]
case e_f.h
f : Natβ Natα.zero → WType Natβ
x : Empty
⊢ Empty.elim x = f x
[PROOFSTEP]
cases x
[GOAL]
f : Natβ Natα.succ → WType Natβ
⊢ ofNat (toNat (mk Natα.succ f)) = mk Natα.succ f
[PROOFSTEP]
simp only [toNat, ofNat, leftInverse_nat (f ()), mk.injEq, heq_eq_eq, true_and]
[GOAL]
f : Natβ Natα.succ → WType Natβ
⊢ (fun x => f ()) = f
[PROOFSTEP]
rfl
[GOAL]
n : ℕ
⊢ toNat (ofNat (Nat.succ n)) = Nat.succ n
[PROOFSTEP]
rw [ofNat, toNat, rightInverse_nat n]
[GOAL]
γ : Type u
f : Listβ γ Listα.nil → WType (Listβ γ)
⊢ ofList γ (toList γ (mk Listα.nil f)) = mk Listα.nil f
[PROOFSTEP]
simp only [toList, ofList, mk.injEq, heq_eq_eq, true_and]
[GOAL]
γ : Type u
f : Listβ γ Listα.nil → WType (Listβ γ)
⊢ PEmpty.elim = f
[PROOFSTEP]
ext x
[GOAL]
case h
γ : Type u
f : Listβ γ Listα.nil → WType (Listβ γ)
x : PEmpty
⊢ PEmpty.elim x = f x
[PROOFSTEP]
cases x
[GOAL]
γ : Type u
x : γ
f : Listβ γ (Listα.cons x) → WType (Listβ γ)
⊢ ofList γ (toList γ (mk (Listα.cons x) f)) = mk (Listα.cons x) f
[PROOFSTEP]
simp only [ofList, leftInverse_list (f PUnit.unit), mk.injEq, heq_eq_eq, true_and]
[GOAL]
γ : Type u
x : γ
f : Listβ γ (Listα.cons x) → WType (Listβ γ)
⊢ (fun x => f PUnit.unit) = f
[PROOFSTEP]
rfl
[GOAL]
γ : Type u
hd : γ
tl : List γ
⊢ toList γ (ofList γ (hd :: tl)) = hd :: tl
[PROOFSTEP]
simp only [toList, rightInverse_list tl]


[GOAL]
G : Type u_1
inst✝² : NormedAddCommGroup G
inst✝¹ : CompleteSpace G
H : Type u_2
inst✝ : NormedAddCommGroup H
f : NormedAddGroupHom G H
K : AddSubgroup H
C ε : ℝ
hC : 0 < C
hε : 0 < ε
hyp : NormedAddGroupHom.SurjectiveOnWith f K C
⊢ NormedAddGroupHom.SurjectiveOnWith f (AddSubgroup.topologicalClosure K) (C + ε)
[PROOFSTEP]
rintro (h : H)
  (h_in : h ∈ K.topologicalClosure)
    -- We first get rid of the easy case where `h = 0`.
[GOAL]
G : Type u_1
inst✝² : NormedAddCommGroup G
inst✝¹ : CompleteSpace G
H : Type u_2
inst✝ : NormedAddCommGroup H
f : NormedAddGroupHom G H
K : AddSubgroup H
C ε : ℝ
hC : 0 < C
hε : 0 < ε
hyp : NormedAddGroupHom.SurjectiveOnWith f K C
h : H
h_in : h ∈ AddSubgroup.topologicalClosure K
⊢ ∃ g, ↑f g = h ∧ ‖g‖ ≤ (C + ε) * ‖h‖
[PROOFSTEP]
by_cases hyp_h : h = 0
[GOAL]
case pos
G : Type u_1
inst✝² : NormedAddCommGroup G
inst✝¹ : CompleteSpace G
H : Type u_2
inst✝ : NormedAddCommGroup H
f : NormedAddGroupHom G H
K : AddSubgroup H
C ε : ℝ
hC : 0 < C
hε : 0 < ε
hyp : NormedAddGroupHom.SurjectiveOnWith f K C
h : H
h_in : h ∈ AddSubgroup.topologicalClosure K
hyp_h : h = 0
⊢ ∃ g, ↑f g = h ∧ ‖g‖ ≤ (C + ε) * ‖h‖
[PROOFSTEP]
rw [hyp_h]
[GOAL]
case pos
G : Type u_1
inst✝² : NormedAddCommGroup G
inst✝¹ : CompleteSpace G
H : Type u_2
inst✝ : NormedAddCommGroup H
f : NormedAddGroupHom G H
K : AddSubgroup H
C ε : ℝ
hC : 0 < C
hε : 0 < ε
hyp : NormedAddGroupHom.SurjectiveOnWith f K C
h : H
h_in : h ∈ AddSubgroup.topologicalClosure K
hyp_h : h = 0
⊢ ∃ g, ↑f g = 0 ∧ ‖g‖ ≤ (C + ε) * ‖0‖
[PROOFSTEP]
use 0
[GOAL]
case h
G : Type u_1
inst✝² : NormedAddCommGroup G
inst✝¹ : CompleteSpace G
H : Type u_2
inst✝ : NormedAddCommGroup H
f : NormedAddGroupHom G H
K : AddSubgroup H
C ε : ℝ
hC : 0 < C
hε : 0 < ε
hyp : NormedAddGroupHom.SurjectiveOnWith f K C
h : H
h_in : h ∈ AddSubgroup.topologicalClosure K
hyp_h : h = 0
⊢ ↑f 0 = 0 ∧ ‖0‖ ≤ (C + ε) * ‖0‖
[PROOFSTEP]
simp
  /- The desired preimage will be constructed as the sum of a series. Convergence of
      the series will be guaranteed by completeness of `G`. We first write `h` as the sum
      of a sequence `v` of elements of `K` which starts close to `h` and then quickly goes to zero.
      The sequence `b` below quantifies this. -/
[GOAL]
case neg
G : Type u_1
inst✝² : NormedAddCommGroup G
inst✝¹ : CompleteSpace G
H : Type u_2
inst✝ : NormedAddCommGroup H
f : NormedAddGroupHom G H
K : AddSubgroup H
C ε : ℝ
hC : 0 < C
hε : 0 < ε
hyp : NormedAddGroupHom.SurjectiveOnWith f K C
h : H
h_in : h ∈ AddSubgroup.topologicalClosure K
hyp_h : ¬h = 0
⊢ ∃ g, ↑f g = h ∧ ‖g‖ ≤ (C + ε) * ‖h‖
[PROOFSTEP]
set b : ℕ → ℝ := fun i => (1 / 2) ^ i * (ε * ‖h‖ / 2) / C
[GOAL]
case neg
G : Type u_1
inst✝² : NormedAddCommGroup G
inst✝¹ : CompleteSpace G
H : Type u_2
inst✝ : NormedAddCommGroup H
f : NormedAddGroupHom G H
K : AddSubgroup H
C ε : ℝ
hC : 0 < C
hε : 0 < ε
hyp : NormedAddGroupHom.SurjectiveOnWith f K C
h : H
h_in : h ∈ AddSubgroup.topologicalClosure K
hyp_h : ¬h = 0
b : ℕ → ℝ := fun i => (1 / 2) ^ i * (ε * ‖h‖ / 2) / C
⊢ ∃ g, ↑f g = h ∧ ‖g‖ ≤ (C + ε) * ‖h‖
[PROOFSTEP]
have b_pos : ∀ i, 0 < b i := by
  intro i
  field_simp [hC]
  exact div_pos (mul_pos hε (norm_pos_iff.mpr hyp_h)) (mul_pos (by norm_num : (0 : ℝ) < 2 ^ i * 2) hC)
[GOAL]
G : Type u_1
inst✝² : NormedAddCommGroup G
inst✝¹ : CompleteSpace G
H : Type u_2
inst✝ : NormedAddCommGroup H
f : NormedAddGroupHom G H
K : AddSubgroup H
C ε : ℝ
hC : 0 < C
hε : 0 < ε
hyp : NormedAddGroupHom.SurjectiveOnWith f K C
h : H
h_in : h ∈ AddSubgroup.topologicalClosure K
hyp_h : ¬h = 0
b : ℕ → ℝ := fun i => (1 / 2) ^ i * (ε * ‖h‖ / 2) / C
⊢ ∀ (i : ℕ), 0 < b i
[PROOFSTEP]
intro i
[GOAL]
G : Type u_1
inst✝² : NormedAddCommGroup G
inst✝¹ : CompleteSpace G
H : Type u_2
inst✝ : NormedAddCommGroup H
f : NormedAddGroupHom G H
K : AddSubgroup H
C ε : ℝ
hC : 0 < C
hε : 0 < ε
hyp : NormedAddGroupHom.SurjectiveOnWith f K C
h : H
h_in : h ∈ AddSubgroup.topologicalClosure K
hyp_h : ¬h = 0
b : ℕ → ℝ := fun i => (1 / 2) ^ i * (ε * ‖h‖ / 2) / C
i : ℕ
⊢ 0 < b i
[PROOFSTEP]
field_simp [hC]
[GOAL]
G : Type u_1
inst✝² : NormedAddCommGroup G
inst✝¹ : CompleteSpace G
H : Type u_2
inst✝ : NormedAddCommGroup H
f : NormedAddGroupHom G H
K : AddSubgroup H
C ε : ℝ
hC : 0 < C
hε : 0 < ε
hyp : NormedAddGroupHom.SurjectiveOnWith f K C
h : H
h_in : h ∈ AddSubgroup.topologicalClosure K
hyp_h : ¬h = 0
b : ℕ → ℝ := fun i => (1 / 2) ^ i * (ε * ‖h‖ / 2) / C
i : ℕ
⊢ 0 < ε * ‖h‖ / (2 ^ i * 2 * C)
[PROOFSTEP]
exact div_pos (mul_pos hε (norm_pos_iff.mpr hyp_h)) (mul_pos (by norm_num : (0 : ℝ) < 2 ^ i * 2) hC)
[GOAL]
G : Type u_1
inst✝² : NormedAddCommGroup G
inst✝¹ : CompleteSpace G
H : Type u_2
inst✝ : NormedAddCommGroup H
f : NormedAddGroupHom G H
K : AddSubgroup H
C ε : ℝ
hC : 0 < C
hε : 0 < ε
hyp : NormedAddGroupHom.SurjectiveOnWith f K C
h : H
h_in : h ∈ AddSubgroup.topologicalClosure K
hyp_h : ¬h = 0
b : ℕ → ℝ := fun i => (1 / 2) ^ i * (ε * ‖h‖ / 2) / C
i : ℕ
⊢ 0 < 2 ^ i * 2
[PROOFSTEP]
norm_num
[GOAL]
case neg
G : Type u_1
inst✝² : NormedAddCommGroup G
inst✝¹ : CompleteSpace G
H : Type u_2
inst✝ : NormedAddCommGroup H
f : NormedAddGroupHom G H
K : AddSubgroup H
C ε : ℝ
hC : 0 < C
hε : 0 < ε
hyp : NormedAddGroupHom.SurjectiveOnWith f K C
h : H
h_in : h ∈ AddSubgroup.topologicalClosure K
hyp_h : ¬h = 0
b : ℕ → ℝ := fun i => (1 / 2) ^ i * (ε * ‖h‖ / 2) / C
b_pos : ∀ (i : ℕ), 0 < b i
⊢ ∃ g, ↑f g = h ∧ ‖g‖ ≤ (C + ε) * ‖h‖
[PROOFSTEP]
obtain
  ⟨v : ℕ → H, lim_v : Tendsto (fun n : ℕ => ∑ k in range (n + 1), v k) atTop (𝓝 h), v_in : ∀ n, v n ∈ K, hv₀ :
    ‖v 0 - h‖ < b 0, hv : ∀ n > 0, ‖v n‖ < b n⟩ :=
  controlled_sum_of_mem_closure h_in b_pos
[GOAL]
case neg.intro.intro.intro.intro
G : Type u_1
inst✝² : NormedAddCommGroup G
inst✝¹ : CompleteSpace G
H : Type u_2
inst✝ : NormedAddCommGroup H
f : NormedAddGroupHom G H
K : AddSubgroup H
C ε : ℝ
hC : 0 < C
hε : 0 < ε
hyp : NormedAddGroupHom.SurjectiveOnWith f K C
h : H
h_in : h ∈ AddSubgroup.topologicalClosure K
hyp_h : ¬h = 0
b : ℕ → ℝ := fun i => (1 / 2) ^ i * (ε * ‖h‖ / 2) / C
b_pos : ∀ (i : ℕ), 0 < b i
v : ℕ → H
lim_v : Tendsto (fun n => ∑ k in range (n + 1), v k) atTop (𝓝 h)
v_in : ∀ (n : ℕ), v n ∈ K
hv₀ : ‖v 0 - h‖ < b 0
hv : ∀ (n : ℕ), n > 0 → ‖v n‖ < b n
⊢ ∃ g, ↑f g = h ∧ ‖g‖ ≤ (C + ε) * ‖h‖
[PROOFSTEP]
have : ∀ n, ∃ m' : G, f m' = v n ∧ ‖m'‖ ≤ C * ‖v n‖ := fun n : ℕ => hyp (v n) (v_in n)
[GOAL]
case neg.intro.intro.intro.intro
G : Type u_1
inst✝² : NormedAddCommGroup G
inst✝¹ : CompleteSpace G
H : Type u_2
inst✝ : NormedAddCommGroup H
f : NormedAddGroupHom G H
K : AddSubgroup H
C ε : ℝ
hC : 0 < C
hε : 0 < ε
hyp : NormedAddGroupHom.SurjectiveOnWith f K C
h : H
h_in : h ∈ AddSubgroup.topologicalClosure K
hyp_h : ¬h = 0
b : ℕ → ℝ := fun i => (1 / 2) ^ i * (ε * ‖h‖ / 2) / C
b_pos : ∀ (i : ℕ), 0 < b i
v : ℕ → H
lim_v : Tendsto (fun n => ∑ k in range (n + 1), v k) atTop (𝓝 h)
v_in : ∀ (n : ℕ), v n ∈ K
hv₀ : ‖v 0 - h‖ < b 0
hv : ∀ (n : ℕ), n > 0 → ‖v n‖ < b n
this : ∀ (n : ℕ), ∃ m', ↑f m' = v n ∧ ‖m'‖ ≤ C * ‖v n‖
⊢ ∃ g, ↑f g = h ∧ ‖g‖ ≤ (C + ε) * ‖h‖
[PROOFSTEP]
choose u hu hnorm_u using this
[GOAL]
case neg.intro.intro.intro.intro
G : Type u_1
inst✝² : NormedAddCommGroup G
inst✝¹ : CompleteSpace G
H : Type u_2
inst✝ : NormedAddCommGroup H
f : NormedAddGroupHom G H
K : AddSubgroup H
C ε : ℝ
hC : 0 < C
hε : 0 < ε
hyp : NormedAddGroupHom.SurjectiveOnWith f K C
h : H
h_in : h ∈ AddSubgroup.topologicalClosure K
hyp_h : ¬h = 0
b : ℕ → ℝ := fun i => (1 / 2) ^ i * (ε * ‖h‖ / 2) / C
b_pos : ∀ (i : ℕ), 0 < b i
v : ℕ → H
lim_v : Tendsto (fun n => ∑ k in range (n + 1), v k) atTop (𝓝 h)
v_in : ∀ (n : ℕ), v n ∈ K
hv₀ : ‖v 0 - h‖ < b 0
hv : ∀ (n : ℕ), n > 0 → ‖v n‖ < b n
u : ℕ → G
hu : ∀ (n : ℕ), ↑f (u n) = v n
hnorm_u : ∀ (n : ℕ), ‖u n‖ ≤ C * ‖v n‖
⊢ ∃ g, ↑f g = h ∧ ‖g‖ ≤ (C + ε) * ‖h‖
[PROOFSTEP]
set s : ℕ → G := fun n => ∑ k in range (n + 1), u k
[GOAL]
case neg.intro.intro.intro.intro
G : Type u_1
inst✝² : NormedAddCommGroup G
inst✝¹ : CompleteSpace G
H : Type u_2
inst✝ : NormedAddCommGroup H
f : NormedAddGroupHom G H
K : AddSubgroup H
C ε : ℝ
hC : 0 < C
hε : 0 < ε
hyp : NormedAddGroupHom.SurjectiveOnWith f K C
h : H
h_in : h ∈ AddSubgroup.topologicalClosure K
hyp_h : ¬h = 0
b : ℕ → ℝ := fun i => (1 / 2) ^ i * (ε * ‖h‖ / 2) / C
b_pos : ∀ (i : ℕ), 0 < b i
v : ℕ → H
lim_v : Tendsto (fun n => ∑ k in range (n + 1), v k) atTop (𝓝 h)
v_in : ∀ (n : ℕ), v n ∈ K
hv₀ : ‖v 0 - h‖ < b 0
hv : ∀ (n : ℕ), n > 0 → ‖v n‖ < b n
u : ℕ → G
hu : ∀ (n : ℕ), ↑f (u n) = v n
hnorm_u : ∀ (n : ℕ), ‖u n‖ ≤ C * ‖v n‖
s : ℕ → G := fun n => ∑ k in range (n + 1), u k
⊢ ∃ g, ↑f g = h ∧ ‖g‖ ≤ (C + ε) * ‖h‖
[PROOFSTEP]
have : CauchySeq s :=
  by
  apply NormedAddCommGroup.cauchy_series_of_le_geometric'' (by norm_num) one_half_lt_one
  rintro n (hn : n ≥ 1)
  calc
    ‖u n‖ ≤ C * ‖v n‖ := hnorm_u n
    _ ≤ C * b n := by gcongr; exact (hv _ <| Nat.succ_le_iff.mp hn).le
    _ = (1 / 2) ^ n * (ε * ‖h‖ / 2) := by simp [mul_div_cancel' _ hC.ne.symm]
    _ = ε * ‖h‖ / 2 * (1 / 2) ^ n :=
      mul_comm _
        _
          -- We now show that the limit `g` of `s` is the desired preimage.
[GOAL]
G : Type u_1
inst✝² : NormedAddCommGroup G
inst✝¹ : CompleteSpace G
H : Type u_2
inst✝ : NormedAddCommGroup H
f : NormedAddGroupHom G H
K : AddSubgroup H
C ε : ℝ
hC : 0 < C
hε : 0 < ε
hyp : NormedAddGroupHom.SurjectiveOnWith f K C
h : H
h_in : h ∈ AddSubgroup.topologicalClosure K
hyp_h : ¬h = 0
b : ℕ → ℝ := fun i => (1 / 2) ^ i * (ε * ‖h‖ / 2) / C
b_pos : ∀ (i : ℕ), 0 < b i
v : ℕ → H
lim_v : Tendsto (fun n => ∑ k in range (n + 1), v k) atTop (𝓝 h)
v_in : ∀ (n : ℕ), v n ∈ K
hv₀ : ‖v 0 - h‖ < b 0
hv : ∀ (n : ℕ), n > 0 → ‖v n‖ < b n
u : ℕ → G
hu : ∀ (n : ℕ), ↑f (u n) = v n
hnorm_u : ∀ (n : ℕ), ‖u n‖ ≤ C * ‖v n‖
s : ℕ → G := fun n => ∑ k in range (n + 1), u k
⊢ CauchySeq s
[PROOFSTEP]
apply NormedAddCommGroup.cauchy_series_of_le_geometric'' (by norm_num) one_half_lt_one
[GOAL]
G : Type u_1
inst✝² : NormedAddCommGroup G
inst✝¹ : CompleteSpace G
H : Type u_2
inst✝ : NormedAddCommGroup H
f : NormedAddGroupHom G H
K : AddSubgroup H
C ε : ℝ
hC : 0 < C
hε : 0 < ε
hyp : NormedAddGroupHom.SurjectiveOnWith f K C
h : H
h_in : h ∈ AddSubgroup.topologicalClosure K
hyp_h : ¬h = 0
b : ℕ → ℝ := fun i => (1 / 2) ^ i * (ε * ‖h‖ / 2) / C
b_pos : ∀ (i : ℕ), 0 < b i
v : ℕ → H
lim_v : Tendsto (fun n => ∑ k in range (n + 1), v k) atTop (𝓝 h)
v_in : ∀ (n : ℕ), v n ∈ K
hv₀ : ‖v 0 - h‖ < b 0
hv : ∀ (n : ℕ), n > 0 → ‖v n‖ < b n
u : ℕ → G
hu : ∀ (n : ℕ), ↑f (u n) = v n
hnorm_u : ∀ (n : ℕ), ‖u n‖ ≤ C * ‖v n‖
s : ℕ → G := fun n => ∑ k in range (n + 1), u k
⊢ 0 < 1 / 2
[PROOFSTEP]
norm_num
[GOAL]
G : Type u_1
inst✝² : NormedAddCommGroup G
inst✝¹ : CompleteSpace G
H : Type u_2
inst✝ : NormedAddCommGroup H
f : NormedAddGroupHom G H
K : AddSubgroup H
C ε : ℝ
hC : 0 < C
hε : 0 < ε
hyp : NormedAddGroupHom.SurjectiveOnWith f K C
h : H
h_in : h ∈ AddSubgroup.topologicalClosure K
hyp_h : ¬h = 0
b : ℕ → ℝ := fun i => (1 / 2) ^ i * (ε * ‖h‖ / 2) / C
b_pos : ∀ (i : ℕ), 0 < b i
v : ℕ → H
lim_v : Tendsto (fun n => ∑ k in range (n + 1), v k) atTop (𝓝 h)
v_in : ∀ (n : ℕ), v n ∈ K
hv₀ : ‖v 0 - h‖ < b 0
hv : ∀ (n : ℕ), n > 0 → ‖v n‖ < b n
u : ℕ → G
hu : ∀ (n : ℕ), ↑f (u n) = v n
hnorm_u : ∀ (n : ℕ), ‖u n‖ ≤ C * ‖v n‖
s : ℕ → G := fun n => ∑ k in range (n + 1), u k
⊢ ∀ (n : ℕ), n ≥ ?m.14929 → ‖u n‖ ≤ ?m.14927 * (1 / 2) ^ n
G : Type u_1
inst✝² : NormedAddCommGroup G
inst✝¹ : CompleteSpace G
H : Type u_2
inst✝ : NormedAddCommGroup H
f : NormedAddGroupHom G H
K : AddSubgroup H
C ε : ℝ
hC : 0 < C
hε : 0 < ε
hyp : NormedAddGroupHom.SurjectiveOnWith f K C
h : H
h_in : h ∈ AddSubgroup.topologicalClosure K
hyp_h : ¬h = 0
b : ℕ → ℝ := fun i => (1 / 2) ^ i * (ε * ‖h‖ / 2) / C
b_pos : ∀ (i : ℕ), 0 < b i
v : ℕ → H
lim_v : Tendsto (fun n => ∑ k in range (n + 1), v k) atTop (𝓝 h)
v_in : ∀ (n : ℕ), v n ∈ K
hv₀ : ‖v 0 - h‖ < b 0
hv : ∀ (n : ℕ), n > 0 → ‖v n‖ < b n
u : ℕ → G
hu : ∀ (n : ℕ), ↑f (u n) = v n
hnorm_u : ∀ (n : ℕ), ‖u n‖ ≤ C * ‖v n‖
s : ℕ → G := fun n => ∑ k in range (n + 1), u k
⊢ ℝ
G : Type u_1
inst✝² : NormedAddCommGroup G
inst✝¹ : CompleteSpace G
H : Type u_2
inst✝ : NormedAddCommGroup H
f : NormedAddGroupHom G H
K : AddSubgroup H
C ε : ℝ
hC : 0 < C
hε : 0 < ε
hyp : NormedAddGroupHom.SurjectiveOnWith f K C
h : H
h_in : h ∈ AddSubgroup.topologicalClosure K
hyp_h : ¬h = 0
b : ℕ → ℝ := fun i => (1 / 2) ^ i * (ε * ‖h‖ / 2) / C
b_pos : ∀ (i : ℕ), 0 < b i
v : ℕ → H
lim_v : Tendsto (fun n => ∑ k in range (n + 1), v k) atTop (𝓝 h)
v_in : ∀ (n : ℕ), v n ∈ K
hv₀ : ‖v 0 - h‖ < b 0
hv : ∀ (n : ℕ), n > 0 → ‖v n‖ < b n
u : ℕ → G
hu : ∀ (n : ℕ), ↑f (u n) = v n
hnorm_u : ∀ (n : ℕ), ‖u n‖ ≤ C * ‖v n‖
s : ℕ → G := fun n => ∑ k in range (n + 1), u k
⊢ ℕ
[PROOFSTEP]
rintro n (hn : n ≥ 1)
[GOAL]
G : Type u_1
inst✝² : NormedAddCommGroup G
inst✝¹ : CompleteSpace G
H : Type u_2
inst✝ : NormedAddCommGroup H
f : NormedAddGroupHom G H
K : AddSubgroup H
C ε : ℝ
hC : 0 < C
hε : 0 < ε
hyp : NormedAddGroupHom.SurjectiveOnWith f K C
h : H
h_in : h ∈ AddSubgroup.topologicalClosure K
hyp_h : ¬h = 0
b : ℕ → ℝ := fun i => (1 / 2) ^ i * (ε * ‖h‖ / 2) / C
b_pos : ∀ (i : ℕ), 0 < b i
v : ℕ → H
lim_v : Tendsto (fun n => ∑ k in range (n + 1), v k) atTop (𝓝 h)
v_in : ∀ (n : ℕ), v n ∈ K
hv₀ : ‖v 0 - h‖ < b 0
hv : ∀ (n : ℕ), n > 0 → ‖v n‖ < b n
u : ℕ → G
hu : ∀ (n : ℕ), ↑f (u n) = v n
hnorm_u : ∀ (n : ℕ), ‖u n‖ ≤ C * ‖v n‖
s : ℕ → G := fun n => ∑ k in range (n + 1), u k
n : ℕ
hn : n ≥ 1
⊢ ‖u n‖ ≤ ?m.14927 * (1 / 2) ^ n
G : Type u_1
inst✝² : NormedAddCommGroup G
inst✝¹ : CompleteSpace G
H : Type u_2
inst✝ : NormedAddCommGroup H
f : NormedAddGroupHom G H
K : AddSubgroup H
C ε : ℝ
hC : 0 < C
hε : 0 < ε
hyp : NormedAddGroupHom.SurjectiveOnWith f K C
h : H
h_in : h ∈ AddSubgroup.topologicalClosure K
hyp_h : ¬h = 0
b : ℕ → ℝ := fun i => (1 / 2) ^ i * (ε * ‖h‖ / 2) / C
b_pos : ∀ (i : ℕ), 0 < b i
v : ℕ → H
lim_v : Tendsto (fun n => ∑ k in range (n + 1), v k) atTop (𝓝 h)
v_in : ∀ (n : ℕ), v n ∈ K
hv₀ : ‖v 0 - h‖ < b 0
hv : ∀ (n : ℕ), n > 0 → ‖v n‖ < b n
u : ℕ → G
hu : ∀ (n : ℕ), ↑f (u n) = v n
hnorm_u : ∀ (n : ℕ), ‖u n‖ ≤ C * ‖v n‖
s : ℕ → G := fun n => ∑ k in range (n + 1), u k
⊢ ℝ
[PROOFSTEP]
calc
  ‖u n‖ ≤ C * ‖v n‖ := hnorm_u n
  _ ≤ C * b n := by gcongr; exact (hv _ <| Nat.succ_le_iff.mp hn).le
  _ = (1 / 2) ^ n * (ε * ‖h‖ / 2) := by simp [mul_div_cancel' _ hC.ne.symm]
  _ = ε * ‖h‖ / 2 * (1 / 2) ^ n :=
    mul_comm _
      _
        -- We now show that the limit `g` of `s` is the desired preimage.
[GOAL]
G : Type u_1
inst✝² : NormedAddCommGroup G
inst✝¹ : CompleteSpace G
H : Type u_2
inst✝ : NormedAddCommGroup H
f : NormedAddGroupHom G H
K : AddSubgroup H
C ε : ℝ
hC : 0 < C
hε : 0 < ε
hyp : NormedAddGroupHom.SurjectiveOnWith f K C
h : H
h_in : h ∈ AddSubgroup.topologicalClosure K
hyp_h : ¬h = 0
b : ℕ → ℝ := fun i => (1 / 2) ^ i * (ε * ‖h‖ / 2) / C
b_pos : ∀ (i : ℕ), 0 < b i
v : ℕ → H
lim_v : Tendsto (fun n => ∑ k in range (n + 1), v k) atTop (𝓝 h)
v_in : ∀ (n : ℕ), v n ∈ K
hv₀ : ‖v 0 - h‖ < b 0
hv : ∀ (n : ℕ), n > 0 → ‖v n‖ < b n
u : ℕ → G
hu : ∀ (n : ℕ), ↑f (u n) = v n
hnorm_u : ∀ (n : ℕ), ‖u n‖ ≤ C * ‖v n‖
s : ℕ → G := fun n => ∑ k in range (n + 1), u k
n : ℕ
hn : n ≥ 1
⊢ C * ‖v n‖ ≤ C * b n
[PROOFSTEP]
gcongr
[GOAL]
case h
G : Type u_1
inst✝² : NormedAddCommGroup G
inst✝¹ : CompleteSpace G
H : Type u_2
inst✝ : NormedAddCommGroup H
f : NormedAddGroupHom G H
K : AddSubgroup H
C ε : ℝ
hC : 0 < C
hε : 0 < ε
hyp : NormedAddGroupHom.SurjectiveOnWith f K C
h : H
h_in : h ∈ AddSubgroup.topologicalClosure K
hyp_h : ¬h = 0
b : ℕ → ℝ := fun i => (1 / 2) ^ i * (ε * ‖h‖ / 2) / C
b_pos : ∀ (i : ℕ), 0 < b i
v : ℕ → H
lim_v : Tendsto (fun n => ∑ k in range (n + 1), v k) atTop (𝓝 h)
v_in : ∀ (n : ℕ), v n ∈ K
hv₀ : ‖v 0 - h‖ < b 0
hv : ∀ (n : ℕ), n > 0 → ‖v n‖ < b n
u : ℕ → G
hu : ∀ (n : ℕ), ↑f (u n) = v n
hnorm_u : ∀ (n : ℕ), ‖u n‖ ≤ C * ‖v n‖
s : ℕ → G := fun n => ∑ k in range (n + 1), u k
n : ℕ
hn : n ≥ 1
⊢ ‖v n‖ ≤ b n
[PROOFSTEP]
exact (hv _ <| Nat.succ_le_iff.mp hn).le
[GOAL]
G : Type u_1
inst✝² : NormedAddCommGroup G
inst✝¹ : CompleteSpace G
H : Type u_2
inst✝ : NormedAddCommGroup H
f : NormedAddGroupHom G H
K : AddSubgroup H
C ε : ℝ
hC : 0 < C
hε : 0 < ε
hyp : NormedAddGroupHom.SurjectiveOnWith f K C
h : H
h_in : h ∈ AddSubgroup.topologicalClosure K
hyp_h : ¬h = 0
b : ℕ → ℝ := fun i => (1 / 2) ^ i * (ε * ‖h‖ / 2) / C
b_pos : ∀ (i : ℕ), 0 < b i
v : ℕ → H
lim_v : Tendsto (fun n => ∑ k in range (n + 1), v k) atTop (𝓝 h)
v_in : ∀ (n : ℕ), v n ∈ K
hv₀ : ‖v 0 - h‖ < b 0
hv : ∀ (n : ℕ), n > 0 → ‖v n‖ < b n
u : ℕ → G
hu : ∀ (n : ℕ), ↑f (u n) = v n
hnorm_u : ∀ (n : ℕ), ‖u n‖ ≤ C * ‖v n‖
s : ℕ → G := fun n => ∑ k in range (n + 1), u k
n : ℕ
hn : n ≥ 1
⊢ C * b n = (1 / 2) ^ n * (ε * ‖h‖ / 2)
[PROOFSTEP]
simp [mul_div_cancel' _ hC.ne.symm]
[GOAL]
case neg.intro.intro.intro.intro
G : Type u_1
inst✝² : NormedAddCommGroup G
inst✝¹ : CompleteSpace G
H : Type u_2
inst✝ : NormedAddCommGroup H
f : NormedAddGroupHom G H
K : AddSubgroup H
C ε : ℝ
hC : 0 < C
hε : 0 < ε
hyp : NormedAddGroupHom.SurjectiveOnWith f K C
h : H
h_in : h ∈ AddSubgroup.topologicalClosure K
hyp_h : ¬h = 0
b : ℕ → ℝ := fun i => (1 / 2) ^ i * (ε * ‖h‖ / 2) / C
b_pos : ∀ (i : ℕ), 0 < b i
v : ℕ → H
lim_v : Tendsto (fun n => ∑ k in range (n + 1), v k) atTop (𝓝 h)
v_in : ∀ (n : ℕ), v n ∈ K
hv₀ : ‖v 0 - h‖ < b 0
hv : ∀ (n : ℕ), n > 0 → ‖v n‖ < b n
u : ℕ → G
hu : ∀ (n : ℕ), ↑f (u n) = v n
hnorm_u : ∀ (n : ℕ), ‖u n‖ ≤ C * ‖v n‖
s : ℕ → G := fun n => ∑ k in range (n + 1), u k
this : CauchySeq s
⊢ ∃ g, ↑f g = h ∧ ‖g‖ ≤ (C + ε) * ‖h‖
[PROOFSTEP]
obtain ⟨g : G, hg⟩ := cauchySeq_tendsto_of_complete this
[GOAL]
case neg.intro.intro.intro.intro.intro
G : Type u_1
inst✝² : NormedAddCommGroup G
inst✝¹ : CompleteSpace G
H : Type u_2
inst✝ : NormedAddCommGroup H
f : NormedAddGroupHom G H
K : AddSubgroup H
C ε : ℝ
hC : 0 < C
hε : 0 < ε
hyp : NormedAddGroupHom.SurjectiveOnWith f K C
h : H
h_in : h ∈ AddSubgroup.topologicalClosure K
hyp_h : ¬h = 0
b : ℕ → ℝ := fun i => (1 / 2) ^ i * (ε * ‖h‖ / 2) / C
b_pos : ∀ (i : ℕ), 0 < b i
v : ℕ → H
lim_v : Tendsto (fun n => ∑ k in range (n + 1), v k) atTop (𝓝 h)
v_in : ∀ (n : ℕ), v n ∈ K
hv₀ : ‖v 0 - h‖ < b 0
hv : ∀ (n : ℕ), n > 0 → ‖v n‖ < b n
u : ℕ → G
hu : ∀ (n : ℕ), ↑f (u n) = v n
hnorm_u : ∀ (n : ℕ), ‖u n‖ ≤ C * ‖v n‖
s : ℕ → G := fun n => ∑ k in range (n + 1), u k
this : CauchySeq s
g : G
hg : Tendsto s atTop (𝓝 g)
⊢ ∃ g, ↑f g = h ∧ ‖g‖ ≤ (C + ε) * ‖h‖
[PROOFSTEP]
refine' ⟨g, _, _⟩
[GOAL]
case neg.intro.intro.intro.intro.intro.refine'_1
G : Type u_1
inst✝² : NormedAddCommGroup G
inst✝¹ : CompleteSpace G
H : Type u_2
inst✝ : NormedAddCommGroup H
f : NormedAddGroupHom G H
K : AddSubgroup H
C ε : ℝ
hC : 0 < C
hε : 0 < ε
hyp : NormedAddGroupHom.SurjectiveOnWith f K C
h : H
h_in : h ∈ AddSubgroup.topologicalClosure K
hyp_h : ¬h = 0
b : ℕ → ℝ := fun i => (1 / 2) ^ i * (ε * ‖h‖ / 2) / C
b_pos : ∀ (i : ℕ), 0 < b i
v : ℕ → H
lim_v : Tendsto (fun n => ∑ k in range (n + 1), v k) atTop (𝓝 h)
v_in : ∀ (n : ℕ), v n ∈ K
hv₀ : ‖v 0 - h‖ < b 0
hv : ∀ (n : ℕ), n > 0 → ‖v n‖ < b n
u : ℕ → G
hu : ∀ (n : ℕ), ↑f (u n) = v n
hnorm_u : ∀ (n : ℕ), ‖u n‖ ≤ C * ‖v n‖
s : ℕ → G := fun n => ∑ k in range (n + 1), u k
this : CauchySeq s
g : G
hg : Tendsto s atTop (𝓝 g)
⊢ ↑f g = h
[PROOFSTEP]
have : f ∘ s = fun n => ∑ k in range (n + 1), v k := by
  ext n
  simp [map_sum, hu]
    /- In the above equality, the left-hand-side converges to `f g` by continuity of `f` and
          definition of `g` while the right-hand-side converges to `h` by construction of `v` so
          `g` is indeed a preimage of `h`. -/
[GOAL]
G : Type u_1
inst✝² : NormedAddCommGroup G
inst✝¹ : CompleteSpace G
H : Type u_2
inst✝ : NormedAddCommGroup H
f : NormedAddGroupHom G H
K : AddSubgroup H
C ε : ℝ
hC : 0 < C
hε : 0 < ε
hyp : NormedAddGroupHom.SurjectiveOnWith f K C
h : H
h_in : h ∈ AddSubgroup.topologicalClosure K
hyp_h : ¬h = 0
b : ℕ → ℝ := fun i => (1 / 2) ^ i * (ε * ‖h‖ / 2) / C
b_pos : ∀ (i : ℕ), 0 < b i
v : ℕ → H
lim_v : Tendsto (fun n => ∑ k in range (n + 1), v k) atTop (𝓝 h)
v_in : ∀ (n : ℕ), v n ∈ K
hv₀ : ‖v 0 - h‖ < b 0
hv : ∀ (n : ℕ), n > 0 → ‖v n‖ < b n
u : ℕ → G
hu : ∀ (n : ℕ), ↑f (u n) = v n
hnorm_u : ∀ (n : ℕ), ‖u n‖ ≤ C * ‖v n‖
s : ℕ → G := fun n => ∑ k in range (n + 1), u k
this : CauchySeq s
g : G
hg : Tendsto s atTop (𝓝 g)
⊢ ↑f ∘ s = fun n => ∑ k in range (n + 1), v k
[PROOFSTEP]
ext n
[GOAL]
case h
G : Type u_1
inst✝² : NormedAddCommGroup G
inst✝¹ : CompleteSpace G
H : Type u_2
inst✝ : NormedAddCommGroup H
f : NormedAddGroupHom G H
K : AddSubgroup H
C ε : ℝ
hC : 0 < C
hε : 0 < ε
hyp : NormedAddGroupHom.SurjectiveOnWith f K C
h : H
h_in : h ∈ AddSubgroup.topologicalClosure K
hyp_h : ¬h = 0
b : ℕ → ℝ := fun i => (1 / 2) ^ i * (ε * ‖h‖ / 2) / C
b_pos : ∀ (i : ℕ), 0 < b i
v : ℕ → H
lim_v : Tendsto (fun n => ∑ k in range (n + 1), v k) atTop (𝓝 h)
v_in : ∀ (n : ℕ), v n ∈ K
hv₀ : ‖v 0 - h‖ < b 0
hv : ∀ (n : ℕ), n > 0 → ‖v n‖ < b n
u : ℕ → G
hu : ∀ (n : ℕ), ↑f (u n) = v n
hnorm_u : ∀ (n : ℕ), ‖u n‖ ≤ C * ‖v n‖
s : ℕ → G := fun n => ∑ k in range (n + 1), u k
this : CauchySeq s
g : G
hg : Tendsto s atTop (𝓝 g)
n : ℕ
⊢ (↑f ∘ s) n = ∑ k in range (n + 1), v k
[PROOFSTEP]
simp [map_sum, hu]
  /- In the above equality, the left-hand-side converges to `f g` by continuity of `f` and
        definition of `g` while the right-hand-side converges to `h` by construction of `v` so
        `g` is indeed a preimage of `h`. -/
[GOAL]
case neg.intro.intro.intro.intro.intro.refine'_1
G : Type u_1
inst✝² : NormedAddCommGroup G
inst✝¹ : CompleteSpace G
H : Type u_2
inst✝ : NormedAddCommGroup H
f : NormedAddGroupHom G H
K : AddSubgroup H
C ε : ℝ
hC : 0 < C
hε : 0 < ε
hyp : NormedAddGroupHom.SurjectiveOnWith f K C
h : H
h_in : h ∈ AddSubgroup.topologicalClosure K
hyp_h : ¬h = 0
b : ℕ → ℝ := fun i => (1 / 2) ^ i * (ε * ‖h‖ / 2) / C
b_pos : ∀ (i : ℕ), 0 < b i
v : ℕ → H
lim_v : Tendsto (fun n => ∑ k in range (n + 1), v k) atTop (𝓝 h)
v_in : ∀ (n : ℕ), v n ∈ K
hv₀ : ‖v 0 - h‖ < b 0
hv : ∀ (n : ℕ), n > 0 → ‖v n‖ < b n
u : ℕ → G
hu : ∀ (n : ℕ), ↑f (u n) = v n
hnorm_u : ∀ (n : ℕ), ‖u n‖ ≤ C * ‖v n‖
s : ℕ → G := fun n => ∑ k in range (n + 1), u k
this✝ : CauchySeq s
g : G
hg : Tendsto s atTop (𝓝 g)
this : ↑f ∘ s = fun n => ∑ k in range (n + 1), v k
⊢ ↑f g = h
[PROOFSTEP]
rw [← this] at lim_v
[GOAL]
case neg.intro.intro.intro.intro.intro.refine'_1
G : Type u_1
inst✝² : NormedAddCommGroup G
inst✝¹ : CompleteSpace G
H : Type u_2
inst✝ : NormedAddCommGroup H
f : NormedAddGroupHom G H
K : AddSubgroup H
C ε : ℝ
hC : 0 < C
hε : 0 < ε
hyp : NormedAddGroupHom.SurjectiveOnWith f K C
h : H
h_in : h ∈ AddSubgroup.topologicalClosure K
hyp_h : ¬h = 0
b : ℕ → ℝ := fun i => (1 / 2) ^ i * (ε * ‖h‖ / 2) / C
b_pos : ∀ (i : ℕ), 0 < b i
v : ℕ → H
v_in : ∀ (n : ℕ), v n ∈ K
hv₀ : ‖v 0 - h‖ < b 0
hv : ∀ (n : ℕ), n > 0 → ‖v n‖ < b n
u : ℕ → G
hu : ∀ (n : ℕ), ↑f (u n) = v n
hnorm_u : ∀ (n : ℕ), ‖u n‖ ≤ C * ‖v n‖
s : ℕ → G := fun n => ∑ k in range (n + 1), u k
lim_v : Tendsto (↑f ∘ s) atTop (𝓝 h)
this✝ : CauchySeq s
g : G
hg : Tendsto s atTop (𝓝 g)
this : ↑f ∘ s = fun n => ∑ k in range (n + 1), v k
⊢ ↑f g = h
[PROOFSTEP]
exact tendsto_nhds_unique ((f.continuous.tendsto g).comp hg) lim_v
[GOAL]
case neg.intro.intro.intro.intro.intro.refine'_2
G : Type u_1
inst✝² : NormedAddCommGroup G
inst✝¹ : CompleteSpace G
H : Type u_2
inst✝ : NormedAddCommGroup H
f : NormedAddGroupHom G H
K : AddSubgroup H
C ε : ℝ
hC : 0 < C
hε : 0 < ε
hyp : NormedAddGroupHom.SurjectiveOnWith f K C
h : H
h_in : h ∈ AddSubgroup.topologicalClosure K
hyp_h : ¬h = 0
b : ℕ → ℝ := fun i => (1 / 2) ^ i * (ε * ‖h‖ / 2) / C
b_pos : ∀ (i : ℕ), 0 < b i
v : ℕ → H
lim_v : Tendsto (fun n => ∑ k in range (n + 1), v k) atTop (𝓝 h)
v_in : ∀ (n : ℕ), v n ∈ K
hv₀ : ‖v 0 - h‖ < b 0
hv : ∀ (n : ℕ), n > 0 → ‖v n‖ < b n
u : ℕ → G
hu : ∀ (n : ℕ), ↑f (u n) = v n
hnorm_u : ∀ (n : ℕ), ‖u n‖ ≤ C * ‖v n‖
s : ℕ → G := fun n => ∑ k in range (n + 1), u k
this : CauchySeq s
g : G
hg : Tendsto s atTop (𝓝 g)
⊢ ‖g‖ ≤ (C + ε) * ‖h‖
[PROOFSTEP]
suffices : ∀ n, ‖s n‖ ≤ (C + ε) * ‖h‖
[GOAL]
case neg.intro.intro.intro.intro.intro.refine'_2
G : Type u_1
inst✝² : NormedAddCommGroup G
inst✝¹ : CompleteSpace G
H : Type u_2
inst✝ : NormedAddCommGroup H
f : NormedAddGroupHom G H
K : AddSubgroup H
C ε : ℝ
hC : 0 < C
hε : 0 < ε
hyp : NormedAddGroupHom.SurjectiveOnWith f K C
h : H
h_in : h ∈ AddSubgroup.topologicalClosure K
hyp_h : ¬h = 0
b : ℕ → ℝ := fun i => (1 / 2) ^ i * (ε * ‖h‖ / 2) / C
b_pos : ∀ (i : ℕ), 0 < b i
v : ℕ → H
lim_v : Tendsto (fun n => ∑ k in range (n + 1), v k) atTop (𝓝 h)
v_in : ∀ (n : ℕ), v n ∈ K
hv₀ : ‖v 0 - h‖ < b 0
hv : ∀ (n : ℕ), n > 0 → ‖v n‖ < b n
u : ℕ → G
hu : ∀ (n : ℕ), ↑f (u n) = v n
hnorm_u : ∀ (n : ℕ), ‖u n‖ ≤ C * ‖v n‖
s : ℕ → G := fun n => ∑ k in range (n + 1), u k
this✝ : CauchySeq s
g : G
hg : Tendsto s atTop (𝓝 g)
this : ∀ (n : ℕ), ‖s n‖ ≤ (C + ε) * ‖h‖
⊢ ‖g‖ ≤ (C + ε) * ‖h‖
case this
G : Type u_1
inst✝² : NormedAddCommGroup G
inst✝¹ : CompleteSpace G
H : Type u_2
inst✝ : NormedAddCommGroup H
f : NormedAddGroupHom G H
K : AddSubgroup H
C ε : ℝ
hC : 0 < C
hε : 0 < ε
hyp : NormedAddGroupHom.SurjectiveOnWith f K C
h : H
h_in : h ∈ AddSubgroup.topologicalClosure K
hyp_h : ¬h = 0
b : ℕ → ℝ := fun i => (1 / 2) ^ i * (ε * ‖h‖ / 2) / C
b_pos : ∀ (i : ℕ), 0 < b i
v : ℕ → H
lim_v : Tendsto (fun n => ∑ k in range (n + 1), v k) atTop (𝓝 h)
v_in : ∀ (n : ℕ), v n ∈ K
hv₀ : ‖v 0 - h‖ < b 0
hv : ∀ (n : ℕ), n > 0 → ‖v n‖ < b n
u : ℕ → G
hu : ∀ (n : ℕ), ↑f (u n) = v n
hnorm_u : ∀ (n : ℕ), ‖u n‖ ≤ C * ‖v n‖
s : ℕ → G := fun n => ∑ k in range (n + 1), u k
this : CauchySeq s
g : G
hg : Tendsto s atTop (𝓝 g)
⊢ ∀ (n : ℕ), ‖s n‖ ≤ (C + ε) * ‖h‖
[PROOFSTEP]
exact le_of_tendsto' (continuous_norm.continuousAt.tendsto.comp hg) this
[GOAL]
case this
G : Type u_1
inst✝² : NormedAddCommGroup G
inst✝¹ : CompleteSpace G
H : Type u_2
inst✝ : NormedAddCommGroup H
f : NormedAddGroupHom G H
K : AddSubgroup H
C ε : ℝ
hC : 0 < C
hε : 0 < ε
hyp : NormedAddGroupHom.SurjectiveOnWith f K C
h : H
h_in : h ∈ AddSubgroup.topologicalClosure K
hyp_h : ¬h = 0
b : ℕ → ℝ := fun i => (1 / 2) ^ i * (ε * ‖h‖ / 2) / C
b_pos : ∀ (i : ℕ), 0 < b i
v : ℕ → H
lim_v : Tendsto (fun n => ∑ k in range (n + 1), v k) atTop (𝓝 h)
v_in : ∀ (n : ℕ), v n ∈ K
hv₀ : ‖v 0 - h‖ < b 0
hv : ∀ (n : ℕ), n > 0 → ‖v n‖ < b n
u : ℕ → G
hu : ∀ (n : ℕ), ↑f (u n) = v n
hnorm_u : ∀ (n : ℕ), ‖u n‖ ≤ C * ‖v n‖
s : ℕ → G := fun n => ∑ k in range (n + 1), u k
this : CauchySeq s
g : G
hg : Tendsto s atTop (𝓝 g)
⊢ ∀ (n : ℕ), ‖s n‖ ≤ (C + ε) * ‖h‖
[PROOFSTEP]
intro n
[GOAL]
case this
G : Type u_1
inst✝² : NormedAddCommGroup G
inst✝¹ : CompleteSpace G
H : Type u_2
inst✝ : NormedAddCommGroup H
f : NormedAddGroupHom G H
K : AddSubgroup H
C ε : ℝ
hC : 0 < C
hε : 0 < ε
hyp : NormedAddGroupHom.SurjectiveOnWith f K C
h : H
h_in : h ∈ AddSubgroup.topologicalClosure K
hyp_h : ¬h = 0
b : ℕ → ℝ := fun i => (1 / 2) ^ i * (ε * ‖h‖ / 2) / C
b_pos : ∀ (i : ℕ), 0 < b i
v : ℕ → H
lim_v : Tendsto (fun n => ∑ k in range (n + 1), v k) atTop (𝓝 h)
v_in : ∀ (n : ℕ), v n ∈ K
hv₀ : ‖v 0 - h‖ < b 0
hv : ∀ (n : ℕ), n > 0 → ‖v n‖ < b n
u : ℕ → G
hu : ∀ (n : ℕ), ↑f (u n) = v n
hnorm_u : ∀ (n : ℕ), ‖u n‖ ≤ C * ‖v n‖
s : ℕ → G := fun n => ∑ k in range (n + 1), u k
this : CauchySeq s
g : G
hg : Tendsto s atTop (𝓝 g)
n : ℕ
⊢ ‖s n‖ ≤ (C + ε) * ‖h‖
[PROOFSTEP]
have hnorm₀ : ‖u 0‖ ≤ C * b 0 + C * ‖h‖ :=
  by
  have :=
    calc
      ‖v 0‖ ≤ ‖h‖ + ‖v 0 - h‖ := norm_le_insert' _ _
      _ ≤ ‖h‖ + b 0 := by gcongr
  calc
    ‖u 0‖ ≤ C * ‖v 0‖ := hnorm_u 0
    _ ≤ C * (‖h‖ + b 0) := by gcongr
    _ = C * b 0 + C * ‖h‖ := by rw [add_comm, mul_add]
[GOAL]
G : Type u_1
inst✝² : NormedAddCommGroup G
inst✝¹ : CompleteSpace G
H : Type u_2
inst✝ : NormedAddCommGroup H
f : NormedAddGroupHom G H
K : AddSubgroup H
C ε : ℝ
hC : 0 < C
hε : 0 < ε
hyp : NormedAddGroupHom.SurjectiveOnWith f K C
h : H
h_in : h ∈ AddSubgroup.topologicalClosure K
hyp_h : ¬h = 0
b : ℕ → ℝ := fun i => (1 / 2) ^ i * (ε * ‖h‖ / 2) / C
b_pos : ∀ (i : ℕ), 0 < b i
v : ℕ → H
lim_v : Tendsto (fun n => ∑ k in range (n + 1), v k) atTop (𝓝 h)
v_in : ∀ (n : ℕ), v n ∈ K
hv₀ : ‖v 0 - h‖ < b 0
hv : ∀ (n : ℕ), n > 0 → ‖v n‖ < b n
u : ℕ → G
hu : ∀ (n : ℕ), ↑f (u n) = v n
hnorm_u : ∀ (n : ℕ), ‖u n‖ ≤ C * ‖v n‖
s : ℕ → G := fun n => ∑ k in range (n + 1), u k
this : CauchySeq s
g : G
hg : Tendsto s atTop (𝓝 g)
n : ℕ
⊢ ‖u 0‖ ≤ C * b 0 + C * ‖h‖
[PROOFSTEP]
have :=
  calc
    ‖v 0‖ ≤ ‖h‖ + ‖v 0 - h‖ := norm_le_insert' _ _
    _ ≤ ‖h‖ + b 0 := by gcongr
[GOAL]
G : Type u_1
inst✝² : NormedAddCommGroup G
inst✝¹ : CompleteSpace G
H : Type u_2
inst✝ : NormedAddCommGroup H
f : NormedAddGroupHom G H
K : AddSubgroup H
C ε : ℝ
hC : 0 < C
hε : 0 < ε
hyp : NormedAddGroupHom.SurjectiveOnWith f K C
h : H
h_in : h ∈ AddSubgroup.topologicalClosure K
hyp_h : ¬h = 0
b : ℕ → ℝ := fun i => (1 / 2) ^ i * (ε * ‖h‖ / 2) / C
b_pos : ∀ (i : ℕ), 0 < b i
v : ℕ → H
lim_v : Tendsto (fun n => ∑ k in range (n + 1), v k) atTop (𝓝 h)
v_in : ∀ (n : ℕ), v n ∈ K
hv₀ : ‖v 0 - h‖ < b 0
hv : ∀ (n : ℕ), n > 0 → ‖v n‖ < b n
u : ℕ → G
hu : ∀ (n : ℕ), ↑f (u n) = v n
hnorm_u : ∀ (n : ℕ), ‖u n‖ ≤ C * ‖v n‖
s : ℕ → G := fun n => ∑ k in range (n + 1), u k
this : CauchySeq s
g : G
hg : Tendsto s atTop (𝓝 g)
n : ℕ
⊢ ‖h‖ + ‖v 0 - h‖ ≤ ‖h‖ + b 0
[PROOFSTEP]
gcongr
[GOAL]
G : Type u_1
inst✝² : NormedAddCommGroup G
inst✝¹ : CompleteSpace G
H : Type u_2
inst✝ : NormedAddCommGroup H
f : NormedAddGroupHom G H
K : AddSubgroup H
C ε : ℝ
hC : 0 < C
hε : 0 < ε
hyp : NormedAddGroupHom.SurjectiveOnWith f K C
h : H
h_in : h ∈ AddSubgroup.topologicalClosure K
hyp_h : ¬h = 0
b : ℕ → ℝ := fun i => (1 / 2) ^ i * (ε * ‖h‖ / 2) / C
b_pos : ∀ (i : ℕ), 0 < b i
v : ℕ → H
lim_v : Tendsto (fun n => ∑ k in range (n + 1), v k) atTop (𝓝 h)
v_in : ∀ (n : ℕ), v n ∈ K
hv₀ : ‖v 0 - h‖ < b 0
hv : ∀ (n : ℕ), n > 0 → ‖v n‖ < b n
u : ℕ → G
hu : ∀ (n : ℕ), ↑f (u n) = v n
hnorm_u : ∀ (n : ℕ), ‖u n‖ ≤ C * ‖v n‖
s : ℕ → G := fun n => ∑ k in range (n + 1), u k
this✝ : CauchySeq s
g : G
hg : Tendsto s atTop (𝓝 g)
n : ℕ
this : ‖v 0‖ ≤ ‖h‖ + b 0
⊢ ‖u 0‖ ≤ C * b 0 + C * ‖h‖
[PROOFSTEP]
calc
  ‖u 0‖ ≤ C * ‖v 0‖ := hnorm_u 0
  _ ≤ C * (‖h‖ + b 0) := by gcongr
  _ = C * b 0 + C * ‖h‖ := by rw [add_comm, mul_add]
[GOAL]
G : Type u_1
inst✝² : NormedAddCommGroup G
inst✝¹ : CompleteSpace G
H : Type u_2
inst✝ : NormedAddCommGroup H
f : NormedAddGroupHom G H
K : AddSubgroup H
C ε : ℝ
hC : 0 < C
hε : 0 < ε
hyp : NormedAddGroupHom.SurjectiveOnWith f K C
h : H
h_in : h ∈ AddSubgroup.topologicalClosure K
hyp_h : ¬h = 0
b : ℕ → ℝ := fun i => (1 / 2) ^ i * (ε * ‖h‖ / 2) / C
b_pos : ∀ (i : ℕ), 0 < b i
v : ℕ → H
lim_v : Tendsto (fun n => ∑ k in range (n + 1), v k) atTop (𝓝 h)
v_in : ∀ (n : ℕ), v n ∈ K
hv₀ : ‖v 0 - h‖ < b 0
hv : ∀ (n : ℕ), n > 0 → ‖v n‖ < b n
u : ℕ → G
hu : ∀ (n : ℕ), ↑f (u n) = v n
hnorm_u : ∀ (n : ℕ), ‖u n‖ ≤ C * ‖v n‖
s : ℕ → G := fun n => ∑ k in range (n + 1), u k
this✝ : CauchySeq s
g : G
hg : Tendsto s atTop (𝓝 g)
n : ℕ
this : ‖v 0‖ ≤ ‖h‖ + b 0
⊢ C * ‖v 0‖ ≤ C * (‖h‖ + b 0)
[PROOFSTEP]
gcongr
[GOAL]
G : Type u_1
inst✝² : NormedAddCommGroup G
inst✝¹ : CompleteSpace G
H : Type u_2
inst✝ : NormedAddCommGroup H
f : NormedAddGroupHom G H
K : AddSubgroup H
C ε : ℝ
hC : 0 < C
hε : 0 < ε
hyp : NormedAddGroupHom.SurjectiveOnWith f K C
h : H
h_in : h ∈ AddSubgroup.topologicalClosure K
hyp_h : ¬h = 0
b : ℕ → ℝ := fun i => (1 / 2) ^ i * (ε * ‖h‖ / 2) / C
b_pos : ∀ (i : ℕ), 0 < b i
v : ℕ → H
lim_v : Tendsto (fun n => ∑ k in range (n + 1), v k) atTop (𝓝 h)
v_in : ∀ (n : ℕ), v n ∈ K
hv₀ : ‖v 0 - h‖ < b 0
hv : ∀ (n : ℕ), n > 0 → ‖v n‖ < b n
u : ℕ → G
hu : ∀ (n : ℕ), ↑f (u n) = v n
hnorm_u : ∀ (n : ℕ), ‖u n‖ ≤ C * ‖v n‖
s : ℕ → G := fun n => ∑ k in range (n + 1), u k
this✝ : CauchySeq s
g : G
hg : Tendsto s atTop (𝓝 g)
n : ℕ
this : ‖v 0‖ ≤ ‖h‖ + b 0
⊢ C * (‖h‖ + b 0) = C * b 0 + C * ‖h‖
[PROOFSTEP]
rw [add_comm, mul_add]
[GOAL]
case this
G : Type u_1
inst✝² : NormedAddCommGroup G
inst✝¹ : CompleteSpace G
H : Type u_2
inst✝ : NormedAddCommGroup H
f : NormedAddGroupHom G H
K : AddSubgroup H
C ε : ℝ
hC : 0 < C
hε : 0 < ε
hyp : NormedAddGroupHom.SurjectiveOnWith f K C
h : H
h_in : h ∈ AddSubgroup.topologicalClosure K
hyp_h : ¬h = 0
b : ℕ → ℝ := fun i => (1 / 2) ^ i * (ε * ‖h‖ / 2) / C
b_pos : ∀ (i : ℕ), 0 < b i
v : ℕ → H
lim_v : Tendsto (fun n => ∑ k in range (n + 1), v k) atTop (𝓝 h)
v_in : ∀ (n : ℕ), v n ∈ K
hv₀ : ‖v 0 - h‖ < b 0
hv : ∀ (n : ℕ), n > 0 → ‖v n‖ < b n
u : ℕ → G
hu : ∀ (n : ℕ), ↑f (u n) = v n
hnorm_u : ∀ (n : ℕ), ‖u n‖ ≤ C * ‖v n‖
s : ℕ → G := fun n => ∑ k in range (n + 1), u k
this : CauchySeq s
g : G
hg : Tendsto s atTop (𝓝 g)
n : ℕ
hnorm₀ : ‖u 0‖ ≤ C * b 0 + C * ‖h‖
⊢ ‖s n‖ ≤ (C + ε) * ‖h‖
[PROOFSTEP]
have : (∑ k in range (n + 1), C * b k) ≤ ε * ‖h‖ :=
  calc
    (∑ k in range (n + 1), C * b k) = (∑ k in range (n + 1), (1 / 2 : ℝ) ^ k) * (ε * ‖h‖ / 2) := by
      simp only [mul_div_cancel' _ hC.ne.symm, ← sum_mul]
    _ ≤ 2 * (ε * ‖h‖ / 2) := by gcongr; apply sum_geometric_two_le
    _ = ε * ‖h‖ := mul_div_cancel' _ two_ne_zero
[GOAL]
G : Type u_1
inst✝² : NormedAddCommGroup G
inst✝¹ : CompleteSpace G
H : Type u_2
inst✝ : NormedAddCommGroup H
f : NormedAddGroupHom G H
K : AddSubgroup H
C ε : ℝ
hC : 0 < C
hε : 0 < ε
hyp : NormedAddGroupHom.SurjectiveOnWith f K C
h : H
h_in : h ∈ AddSubgroup.topologicalClosure K
hyp_h : ¬h = 0
b : ℕ → ℝ := fun i => (1 / 2) ^ i * (ε * ‖h‖ / 2) / C
b_pos : ∀ (i : ℕ), 0 < b i
v : ℕ → H
lim_v : Tendsto (fun n => ∑ k in range (n + 1), v k) atTop (𝓝 h)
v_in : ∀ (n : ℕ), v n ∈ K
hv₀ : ‖v 0 - h‖ < b 0
hv : ∀ (n : ℕ), n > 0 → ‖v n‖ < b n
u : ℕ → G
hu : ∀ (n : ℕ), ↑f (u n) = v n
hnorm_u : ∀ (n : ℕ), ‖u n‖ ≤ C * ‖v n‖
s : ℕ → G := fun n => ∑ k in range (n + 1), u k
this : CauchySeq s
g : G
hg : Tendsto s atTop (𝓝 g)
n : ℕ
hnorm₀ : ‖u 0‖ ≤ C * b 0 + C * ‖h‖
⊢ ∑ k in range (n + 1), C * b k = (∑ k in range (n + 1), (1 / 2) ^ k) * (ε * ‖h‖ / 2)
[PROOFSTEP]
simp only [mul_div_cancel' _ hC.ne.symm, ← sum_mul]
[GOAL]
G : Type u_1
inst✝² : NormedAddCommGroup G
inst✝¹ : CompleteSpace G
H : Type u_2
inst✝ : NormedAddCommGroup H
f : NormedAddGroupHom G H
K : AddSubgroup H
C ε : ℝ
hC : 0 < C
hε : 0 < ε
hyp : NormedAddGroupHom.SurjectiveOnWith f K C
h : H
h_in : h ∈ AddSubgroup.topologicalClosure K
hyp_h : ¬h = 0
b : ℕ → ℝ := fun i => (1 / 2) ^ i * (ε * ‖h‖ / 2) / C
b_pos : ∀ (i : ℕ), 0 < b i
v : ℕ → H
lim_v : Tendsto (fun n => ∑ k in range (n + 1), v k) atTop (𝓝 h)
v_in : ∀ (n : ℕ), v n ∈ K
hv₀ : ‖v 0 - h‖ < b 0
hv : ∀ (n : ℕ), n > 0 → ‖v n‖ < b n
u : ℕ → G
hu : ∀ (n : ℕ), ↑f (u n) = v n
hnorm_u : ∀ (n : ℕ), ‖u n‖ ≤ C * ‖v n‖
s : ℕ → G := fun n => ∑ k in range (n + 1), u k
this : CauchySeq s
g : G
hg : Tendsto s atTop (𝓝 g)
n : ℕ
hnorm₀ : ‖u 0‖ ≤ C * b 0 + C * ‖h‖
⊢ (∑ k in range (n + 1), (1 / 2) ^ k) * (ε * ‖h‖ / 2) ≤ 2 * (ε * ‖h‖ / 2)
[PROOFSTEP]
gcongr
[GOAL]
case h
G : Type u_1
inst✝² : NormedAddCommGroup G
inst✝¹ : CompleteSpace G
H : Type u_2
inst✝ : NormedAddCommGroup H
f : NormedAddGroupHom G H
K : AddSubgroup H
C ε : ℝ
hC : 0 < C
hε : 0 < ε
hyp : NormedAddGroupHom.SurjectiveOnWith f K C
h : H
h_in : h ∈ AddSubgroup.topologicalClosure K
hyp_h : ¬h = 0
b : ℕ → ℝ := fun i => (1 / 2) ^ i * (ε * ‖h‖ / 2) / C
b_pos : ∀ (i : ℕ), 0 < b i
v : ℕ → H
lim_v : Tendsto (fun n => ∑ k in range (n + 1), v k) atTop (𝓝 h)
v_in : ∀ (n : ℕ), v n ∈ K
hv₀ : ‖v 0 - h‖ < b 0
hv : ∀ (n : ℕ), n > 0 → ‖v n‖ < b n
u : ℕ → G
hu : ∀ (n : ℕ), ↑f (u n) = v n
hnorm_u : ∀ (n : ℕ), ‖u n‖ ≤ C * ‖v n‖
s : ℕ → G := fun n => ∑ k in range (n + 1), u k
this : CauchySeq s
g : G
hg : Tendsto s atTop (𝓝 g)
n : ℕ
hnorm₀ : ‖u 0‖ ≤ C * b 0 + C * ‖h‖
⊢ ∑ k in range (n + 1), (1 / 2) ^ k ≤ 2
[PROOFSTEP]
apply sum_geometric_two_le
[GOAL]
case this
G : Type u_1
inst✝² : NormedAddCommGroup G
inst✝¹ : CompleteSpace G
H : Type u_2
inst✝ : NormedAddCommGroup H
f : NormedAddGroupHom G H
K : AddSubgroup H
C ε : ℝ
hC : 0 < C
hε : 0 < ε
hyp : NormedAddGroupHom.SurjectiveOnWith f K C
h : H
h_in : h ∈ AddSubgroup.topologicalClosure K
hyp_h : ¬h = 0
b : ℕ → ℝ := fun i => (1 / 2) ^ i * (ε * ‖h‖ / 2) / C
b_pos : ∀ (i : ℕ), 0 < b i
v : ℕ → H
lim_v : Tendsto (fun n => ∑ k in range (n + 1), v k) atTop (𝓝 h)
v_in : ∀ (n : ℕ), v n ∈ K
hv₀ : ‖v 0 - h‖ < b 0
hv : ∀ (n : ℕ), n > 0 → ‖v n‖ < b n
u : ℕ → G
hu : ∀ (n : ℕ), ↑f (u n) = v n
hnorm_u : ∀ (n : ℕ), ‖u n‖ ≤ C * ‖v n‖
s : ℕ → G := fun n => ∑ k in range (n + 1), u k
this✝ : CauchySeq s
g : G
hg : Tendsto s atTop (𝓝 g)
n : ℕ
hnorm₀ : ‖u 0‖ ≤ C * b 0 + C * ‖h‖
this : ∑ k in range (n + 1), C * b k ≤ ε * ‖h‖
⊢ ‖s n‖ ≤ (C + ε) * ‖h‖
[PROOFSTEP]
calc
  ‖s n‖ ≤ ∑ k in range (n + 1), ‖u k‖ := norm_sum_le _ _
  _ = (∑ k in range n, ‖u (k + 1)‖) + ‖u 0‖ := (sum_range_succ' _ _)
  _ ≤ (∑ k in range n, C * ‖v (k + 1)‖) + ‖u 0‖ := by gcongr; apply hnorm_u
  _ ≤ (∑ k in range n, C * b (k + 1)) + (C * b 0 + C * ‖h‖) := by gcongr with k; exact (hv _ k.succ_pos).le
  _ = (∑ k in range (n + 1), C * b k) + C * ‖h‖ := by rw [← add_assoc, sum_range_succ']
  _ ≤ (C + ε) * ‖h‖ := by
    rw [add_comm, add_mul]
    apply add_le_add_left this
[GOAL]
G : Type u_1
inst✝² : NormedAddCommGroup G
inst✝¹ : CompleteSpace G
H : Type u_2
inst✝ : NormedAddCommGroup H
f : NormedAddGroupHom G H
K : AddSubgroup H
C ε : ℝ
hC : 0 < C
hε : 0 < ε
hyp : NormedAddGroupHom.SurjectiveOnWith f K C
h : H
h_in : h ∈ AddSubgroup.topologicalClosure K
hyp_h : ¬h = 0
b : ℕ → ℝ := fun i => (1 / 2) ^ i * (ε * ‖h‖ / 2) / C
b_pos : ∀ (i : ℕ), 0 < b i
v : ℕ → H
lim_v : Tendsto (fun n => ∑ k in range (n + 1), v k) atTop (𝓝 h)
v_in : ∀ (n : ℕ), v n ∈ K
hv₀ : ‖v 0 - h‖ < b 0
hv : ∀ (n : ℕ), n > 0 → ‖v n‖ < b n
u : ℕ → G
hu : ∀ (n : ℕ), ↑f (u n) = v n
hnorm_u : ∀ (n : ℕ), ‖u n‖ ≤ C * ‖v n‖
s : ℕ → G := fun n => ∑ k in range (n + 1), u k
this✝ : CauchySeq s
g : G
hg : Tendsto s atTop (𝓝 g)
n : ℕ
hnorm₀ : ‖u 0‖ ≤ C * b 0 + C * ‖h‖
this : ∑ k in range (n + 1), C * b k ≤ ε * ‖h‖
⊢ ∑ k in range n, ‖u (k + 1)‖ + ‖u 0‖ ≤ ∑ k in range n, C * ‖v (k + 1)‖ + ‖u 0‖
[PROOFSTEP]
gcongr
[GOAL]
case bc.h
G : Type u_1
inst✝² : NormedAddCommGroup G
inst✝¹ : CompleteSpace G
H : Type u_2
inst✝ : NormedAddCommGroup H
f : NormedAddGroupHom G H
K : AddSubgroup H
C ε : ℝ
hC : 0 < C
hε : 0 < ε
hyp : NormedAddGroupHom.SurjectiveOnWith f K C
h : H
h_in : h ∈ AddSubgroup.topologicalClosure K
hyp_h : ¬h = 0
b : ℕ → ℝ := fun i => (1 / 2) ^ i * (ε * ‖h‖ / 2) / C
b_pos : ∀ (i : ℕ), 0 < b i
v : ℕ → H
lim_v : Tendsto (fun n => ∑ k in range (n + 1), v k) atTop (𝓝 h)
v_in : ∀ (n : ℕ), v n ∈ K
hv₀ : ‖v 0 - h‖ < b 0
hv : ∀ (n : ℕ), n > 0 → ‖v n‖ < b n
u : ℕ → G
hu : ∀ (n : ℕ), ↑f (u n) = v n
hnorm_u : ∀ (n : ℕ), ‖u n‖ ≤ C * ‖v n‖
s : ℕ → G := fun n => ∑ k in range (n + 1), u k
this✝ : CauchySeq s
g : G
hg : Tendsto s atTop (𝓝 g)
n : ℕ
hnorm₀ : ‖u 0‖ ≤ C * b 0 + C * ‖h‖
this : ∑ k in range (n + 1), C * b k ≤ ε * ‖h‖
i✝ : ℕ
a✝ : i✝ ∈ range n
⊢ ‖u (i✝ + 1)‖ ≤ C * ‖v (i✝ + 1)‖
[PROOFSTEP]
apply hnorm_u
[GOAL]
G : Type u_1
inst✝² : NormedAddCommGroup G
inst✝¹ : CompleteSpace G
H : Type u_2
inst✝ : NormedAddCommGroup H
f : NormedAddGroupHom G H
K : AddSubgroup H
C ε : ℝ
hC : 0 < C
hε : 0 < ε
hyp : NormedAddGroupHom.SurjectiveOnWith f K C
h : H
h_in : h ∈ AddSubgroup.topologicalClosure K
hyp_h : ¬h = 0
b : ℕ → ℝ := fun i => (1 / 2) ^ i * (ε * ‖h‖ / 2) / C
b_pos : ∀ (i : ℕ), 0 < b i
v : ℕ → H
lim_v : Tendsto (fun n => ∑ k in range (n + 1), v k) atTop (𝓝 h)
v_in : ∀ (n : ℕ), v n ∈ K
hv₀ : ‖v 0 - h‖ < b 0
hv : ∀ (n : ℕ), n > 0 → ‖v n‖ < b n
u : ℕ → G
hu : ∀ (n : ℕ), ↑f (u n) = v n
hnorm_u : ∀ (n : ℕ), ‖u n‖ ≤ C * ‖v n‖
s : ℕ → G := fun n => ∑ k in range (n + 1), u k
this✝ : CauchySeq s
g : G
hg : Tendsto s atTop (𝓝 g)
n : ℕ
hnorm₀ : ‖u 0‖ ≤ C * b 0 + C * ‖h‖
this : ∑ k in range (n + 1), C * b k ≤ ε * ‖h‖
⊢ ∑ k in range n, C * ‖v (k + 1)‖ + ‖u 0‖ ≤ ∑ k in range n, C * b (k + 1) + (C * b 0 + C * ‖h‖)
[PROOFSTEP]
gcongr with k
[GOAL]
case h₁.h.h
G : Type u_1
inst✝² : NormedAddCommGroup G
inst✝¹ : CompleteSpace G
H : Type u_2
inst✝ : NormedAddCommGroup H
f : NormedAddGroupHom G H
K : AddSubgroup H
C ε : ℝ
hC : 0 < C
hε : 0 < ε
hyp : NormedAddGroupHom.SurjectiveOnWith f K C
h : H
h_in : h ∈ AddSubgroup.topologicalClosure K
hyp_h : ¬h = 0
b : ℕ → ℝ := fun i => (1 / 2) ^ i * (ε * ‖h‖ / 2) / C
b_pos : ∀ (i : ℕ), 0 < b i
v : ℕ → H
lim_v : Tendsto (fun n => ∑ k in range (n + 1), v k) atTop (𝓝 h)
v_in : ∀ (n : ℕ), v n ∈ K
hv₀ : ‖v 0 - h‖ < b 0
hv : ∀ (n : ℕ), n > 0 → ‖v n‖ < b n
u : ℕ → G
hu : ∀ (n : ℕ), ↑f (u n) = v n
hnorm_u : ∀ (n : ℕ), ‖u n‖ ≤ C * ‖v n‖
s : ℕ → G := fun n => ∑ k in range (n + 1), u k
this✝ : CauchySeq s
g : G
hg : Tendsto s atTop (𝓝 g)
n : ℕ
hnorm₀ : ‖u 0‖ ≤ C * b 0 + C * ‖h‖
this : ∑ k in range (n + 1), C * b k ≤ ε * ‖h‖
k : ℕ
a✝ : k ∈ range n
⊢ ‖v (k + 1)‖ ≤ b (k + 1)
[PROOFSTEP]
exact (hv _ k.succ_pos).le
[GOAL]
G : Type u_1
inst✝² : NormedAddCommGroup G
inst✝¹ : CompleteSpace G
H : Type u_2
inst✝ : NormedAddCommGroup H
f : NormedAddGroupHom G H
K : AddSubgroup H
C ε : ℝ
hC : 0 < C
hε : 0 < ε
hyp : NormedAddGroupHom.SurjectiveOnWith f K C
h : H
h_in : h ∈ AddSubgroup.topologicalClosure K
hyp_h : ¬h = 0
b : ℕ → ℝ := fun i => (1 / 2) ^ i * (ε * ‖h‖ / 2) / C
b_pos : ∀ (i : ℕ), 0 < b i
v : ℕ → H
lim_v : Tendsto (fun n => ∑ k in range (n + 1), v k) atTop (𝓝 h)
v_in : ∀ (n : ℕ), v n ∈ K
hv₀ : ‖v 0 - h‖ < b 0
hv : ∀ (n : ℕ), n > 0 → ‖v n‖ < b n
u : ℕ → G
hu : ∀ (n : ℕ), ↑f (u n) = v n
hnorm_u : ∀ (n : ℕ), ‖u n‖ ≤ C * ‖v n‖
s : ℕ → G := fun n => ∑ k in range (n + 1), u k
this✝ : CauchySeq s
g : G
hg : Tendsto s atTop (𝓝 g)
n : ℕ
hnorm₀ : ‖u 0‖ ≤ C * b 0 + C * ‖h‖
this : ∑ k in range (n + 1), C * b k ≤ ε * ‖h‖
⊢ ∑ k in range n, C * b (k + 1) + (C * b 0 + C * ‖h‖) = ∑ k in range (n + 1), C * b k + C * ‖h‖
[PROOFSTEP]
rw [← add_assoc, sum_range_succ']
[GOAL]
G : Type u_1
inst✝² : NormedAddCommGroup G
inst✝¹ : CompleteSpace G
H : Type u_2
inst✝ : NormedAddCommGroup H
f : NormedAddGroupHom G H
K : AddSubgroup H
C ε : ℝ
hC : 0 < C
hε : 0 < ε
hyp : NormedAddGroupHom.SurjectiveOnWith f K C
h : H
h_in : h ∈ AddSubgroup.topologicalClosure K
hyp_h : ¬h = 0
b : ℕ → ℝ := fun i => (1 / 2) ^ i * (ε * ‖h‖ / 2) / C
b_pos : ∀ (i : ℕ), 0 < b i
v : ℕ → H
lim_v : Tendsto (fun n => ∑ k in range (n + 1), v k) atTop (𝓝 h)
v_in : ∀ (n : ℕ), v n ∈ K
hv₀ : ‖v 0 - h‖ < b 0
hv : ∀ (n : ℕ), n > 0 → ‖v n‖ < b n
u : ℕ → G
hu : ∀ (n : ℕ), ↑f (u n) = v n
hnorm_u : ∀ (n : ℕ), ‖u n‖ ≤ C * ‖v n‖
s : ℕ → G := fun n => ∑ k in range (n + 1), u k
this✝ : CauchySeq s
g : G
hg : Tendsto s atTop (𝓝 g)
n : ℕ
hnorm₀ : ‖u 0‖ ≤ C * b 0 + C * ‖h‖
this : ∑ k in range (n + 1), C * b k ≤ ε * ‖h‖
⊢ ∑ k in range (n + 1), C * b k + C * ‖h‖ ≤ (C + ε) * ‖h‖
[PROOFSTEP]
rw [add_comm, add_mul]
[GOAL]
G : Type u_1
inst✝² : NormedAddCommGroup G
inst✝¹ : CompleteSpace G
H : Type u_2
inst✝ : NormedAddCommGroup H
f : NormedAddGroupHom G H
K : AddSubgroup H
C ε : ℝ
hC : 0 < C
hε : 0 < ε
hyp : NormedAddGroupHom.SurjectiveOnWith f K C
h : H
h_in : h ∈ AddSubgroup.topologicalClosure K
hyp_h : ¬h = 0
b : ℕ → ℝ := fun i => (1 / 2) ^ i * (ε * ‖h‖ / 2) / C
b_pos : ∀ (i : ℕ), 0 < b i
v : ℕ → H
lim_v : Tendsto (fun n => ∑ k in range (n + 1), v k) atTop (𝓝 h)
v_in : ∀ (n : ℕ), v n ∈ K
hv₀ : ‖v 0 - h‖ < b 0
hv : ∀ (n : ℕ), n > 0 → ‖v n‖ < b n
u : ℕ → G
hu : ∀ (n : ℕ), ↑f (u n) = v n
hnorm_u : ∀ (n : ℕ), ‖u n‖ ≤ C * ‖v n‖
s : ℕ → G := fun n => ∑ k in range (n + 1), u k
this✝ : CauchySeq s
g : G
hg : Tendsto s atTop (𝓝 g)
n : ℕ
hnorm₀ : ‖u 0‖ ≤ C * b 0 + C * ‖h‖
this : ∑ k in range (n + 1), C * b k ≤ ε * ‖h‖
⊢ C * ‖h‖ + ∑ k in range (n + 1), C * b k ≤ C * ‖h‖ + ε * ‖h‖
[PROOFSTEP]
apply add_le_add_left this
[GOAL]
G : Type u_1
inst✝³ : NormedAddCommGroup G
inst✝² : CompleteSpace G
H : Type u_2
inst✝¹ : NormedAddCommGroup H
f : NormedAddGroupHom G H
K : Type u_3
inst✝ : SeminormedAddCommGroup K
j : NormedAddGroupHom K H
hj : ∀ (x : K), ‖↑j x‖ = ‖x‖
C ε : ℝ
hC : 0 < C
hε : 0 < ε
hyp : ∀ (k : K), ∃ g, ↑f g = ↑j k ∧ ‖g‖ ≤ C * ‖k‖
⊢ NormedAddGroupHom.SurjectiveOnWith f (AddSubgroup.topologicalClosure (NormedAddGroupHom.range j)) (C + ε)
[PROOFSTEP]
replace hyp : ∀ h ∈ j.range, ∃ g, f g = h ∧ ‖g‖ ≤ C * ‖h‖
[GOAL]
case hyp
G : Type u_1
inst✝³ : NormedAddCommGroup G
inst✝² : CompleteSpace G
H : Type u_2
inst✝¹ : NormedAddCommGroup H
f : NormedAddGroupHom G H
K : Type u_3
inst✝ : SeminormedAddCommGroup K
j : NormedAddGroupHom K H
hj : ∀ (x : K), ‖↑j x‖ = ‖x‖
C ε : ℝ
hC : 0 < C
hε : 0 < ε
hyp : ∀ (k : K), ∃ g, ↑f g = ↑j k ∧ ‖g‖ ≤ C * ‖k‖
⊢ ∀ (h : H), h ∈ NormedAddGroupHom.range j → ∃ g, ↑f g = h ∧ ‖g‖ ≤ C * ‖h‖
[PROOFSTEP]
intro h h_in
[GOAL]
case hyp
G : Type u_1
inst✝³ : NormedAddCommGroup G
inst✝² : CompleteSpace G
H : Type u_2
inst✝¹ : NormedAddCommGroup H
f : NormedAddGroupHom G H
K : Type u_3
inst✝ : SeminormedAddCommGroup K
j : NormedAddGroupHom K H
hj : ∀ (x : K), ‖↑j x‖ = ‖x‖
C ε : ℝ
hC : 0 < C
hε : 0 < ε
hyp : ∀ (k : K), ∃ g, ↑f g = ↑j k ∧ ‖g‖ ≤ C * ‖k‖
h : H
h_in : h ∈ NormedAddGroupHom.range j
⊢ ∃ g, ↑f g = h ∧ ‖g‖ ≤ C * ‖h‖
[PROOFSTEP]
rcases(j.mem_range _).mp h_in with ⟨k, rfl⟩
[GOAL]
case hyp.intro
G : Type u_1
inst✝³ : NormedAddCommGroup G
inst✝² : CompleteSpace G
H : Type u_2
inst✝¹ : NormedAddCommGroup H
f : NormedAddGroupHom G H
K : Type u_3
inst✝ : SeminormedAddCommGroup K
j : NormedAddGroupHom K H
hj : ∀ (x : K), ‖↑j x‖ = ‖x‖
C ε : ℝ
hC : 0 < C
hε : 0 < ε
hyp : ∀ (k : K), ∃ g, ↑f g = ↑j k ∧ ‖g‖ ≤ C * ‖k‖
k : K
h_in : ↑j k ∈ NormedAddGroupHom.range j
⊢ ∃ g, ↑f g = ↑j k ∧ ‖g‖ ≤ C * ‖↑j k‖
[PROOFSTEP]
rw [hj]
[GOAL]
case hyp.intro
G : Type u_1
inst✝³ : NormedAddCommGroup G
inst✝² : CompleteSpace G
H : Type u_2
inst✝¹ : NormedAddCommGroup H
f : NormedAddGroupHom G H
K : Type u_3
inst✝ : SeminormedAddCommGroup K
j : NormedAddGroupHom K H
hj : ∀ (x : K), ‖↑j x‖ = ‖x‖
C ε : ℝ
hC : 0 < C
hε : 0 < ε
hyp : ∀ (k : K), ∃ g, ↑f g = ↑j k ∧ ‖g‖ ≤ C * ‖k‖
k : K
h_in : ↑j k ∈ NormedAddGroupHom.range j
⊢ ∃ g, ↑f g = ↑j k ∧ ‖g‖ ≤ C * ‖k‖
[PROOFSTEP]
exact hyp k
[GOAL]
G : Type u_1
inst✝³ : NormedAddCommGroup G
inst✝² : CompleteSpace G
H : Type u_2
inst✝¹ : NormedAddCommGroup H
f : NormedAddGroupHom G H
K : Type u_3
inst✝ : SeminormedAddCommGroup K
j : NormedAddGroupHom K H
hj : ∀ (x : K), ‖↑j x‖ = ‖x‖
C ε : ℝ
hC : 0 < C
hε : 0 < ε
hyp : ∀ (h : H), h ∈ NormedAddGroupHom.range j → ∃ g, ↑f g = h ∧ ‖g‖ ≤ C * ‖h‖
⊢ NormedAddGroupHom.SurjectiveOnWith f (AddSubgroup.topologicalClosure (NormedAddGroupHom.range j)) (C + ε)
[PROOFSTEP]
exact controlled_closure_of_complete hC hε hyp


[GOAL]
α✝ : Sort u_1
β : Sort u_2
α : Sort u_3
h : Finite α
f : α ≃ β
⊢ Finite β
[PROOFSTEP]
cases' h with n e
[GOAL]
case intro
α✝ : Sort u_1
β : Sort u_2
α : Sort u_3
f : α ≃ β
n : ℕ
e : α ≃ Fin n
⊢ Finite β
[PROOFSTEP]
exact Finite.intro (f.symm.trans e)


[GOAL]
α : Type u
ι : Type v
inst✝¹ : MetricSpace α
inst✝ : ProperSpace α
c : ι → α
x : α
r✝ : ℝ
s : Set α
r : ι → ℝ
hs : IsClosed s
uf : ∀ (x : α), x ∈ s → Set.Finite {i | x ∈ ball (c i) (r i)}
us : s ⊆ ⋃ (i : ι), ball (c i) (r i)
⊢ ∃ r', s ⊆ ⋃ (i : ι), ball (c i) (r' i) ∧ ∀ (i : ι), r' i < r i
[PROOFSTEP]
rcases exists_subset_iUnion_closed_subset hs (fun i => @isOpen_ball _ _ (c i) (r i)) uf us with ⟨v, hsv, hvc, hcv⟩
[GOAL]
case intro.intro.intro
α : Type u
ι : Type v
inst✝¹ : MetricSpace α
inst✝ : ProperSpace α
c : ι → α
x : α
r✝ : ℝ
s : Set α
r : ι → ℝ
hs : IsClosed s
uf : ∀ (x : α), x ∈ s → Set.Finite {i | x ∈ ball (c i) (r i)}
us : s ⊆ ⋃ (i : ι), ball (c i) (r i)
v : ι → Set α
hsv : s ⊆ iUnion v
hvc : ∀ (i : ι), IsClosed (v i)
hcv : ∀ (i : ι), v i ⊆ ball (c i) (r i)
⊢ ∃ r', s ⊆ ⋃ (i : ι), ball (c i) (r' i) ∧ ∀ (i : ι), r' i < r i
[PROOFSTEP]
have := fun i => exists_lt_subset_ball (hvc i) (hcv i)
[GOAL]
case intro.intro.intro
α : Type u
ι : Type v
inst✝¹ : MetricSpace α
inst✝ : ProperSpace α
c : ι → α
x : α
r✝ : ℝ
s : Set α
r : ι → ℝ
hs : IsClosed s
uf : ∀ (x : α), x ∈ s → Set.Finite {i | x ∈ ball (c i) (r i)}
us : s ⊆ ⋃ (i : ι), ball (c i) (r i)
v : ι → Set α
hsv : s ⊆ iUnion v
hvc : ∀ (i : ι), IsClosed (v i)
hcv : ∀ (i : ι), v i ⊆ ball (c i) (r i)
this : ∀ (i : ι), ∃ r', r' < r i ∧ v i ⊆ ball (c i) r'
⊢ ∃ r', s ⊆ ⋃ (i : ι), ball (c i) (r' i) ∧ ∀ (i : ι), r' i < r i
[PROOFSTEP]
choose r' hlt hsub using this
[GOAL]
case intro.intro.intro
α : Type u
ι : Type v
inst✝¹ : MetricSpace α
inst✝ : ProperSpace α
c : ι → α
x : α
r✝ : ℝ
s : Set α
r : ι → ℝ
hs : IsClosed s
uf : ∀ (x : α), x ∈ s → Set.Finite {i | x ∈ ball (c i) (r i)}
us : s ⊆ ⋃ (i : ι), ball (c i) (r i)
v : ι → Set α
hsv : s ⊆ iUnion v
hvc : ∀ (i : ι), IsClosed (v i)
hcv : ∀ (i : ι), v i ⊆ ball (c i) (r i)
r' : ι → ℝ
hlt : ∀ (i : ι), r' i < r i
hsub : ∀ (i : ι), v i ⊆ ball (c i) (r' i)
⊢ ∃ r', s ⊆ ⋃ (i : ι), ball (c i) (r' i) ∧ ∀ (i : ι), r' i < r i
[PROOFSTEP]
exact ⟨r', hsv.trans <| iUnion_mono <| hsub, hlt⟩
[GOAL]
α : Type u
ι : Type v
inst✝¹ : MetricSpace α
inst✝ : ProperSpace α
c : ι → α
x : α
r✝ : ℝ
s : Set α
r : ι → ℝ
hr : ∀ (i : ι), 0 < r i
hs : IsClosed s
uf : ∀ (x : α), x ∈ s → Set.Finite {i | x ∈ ball (c i) (r i)}
us : s ⊆ ⋃ (i : ι), ball (c i) (r i)
⊢ ∃ r', s ⊆ ⋃ (i : ι), ball (c i) (r' i) ∧ ∀ (i : ι), r' i ∈ Ioo 0 (r i)
[PROOFSTEP]
rcases exists_subset_iUnion_closed_subset hs (fun i => @isOpen_ball _ _ (c i) (r i)) uf us with ⟨v, hsv, hvc, hcv⟩
[GOAL]
case intro.intro.intro
α : Type u
ι : Type v
inst✝¹ : MetricSpace α
inst✝ : ProperSpace α
c : ι → α
x : α
r✝ : ℝ
s : Set α
r : ι → ℝ
hr : ∀ (i : ι), 0 < r i
hs : IsClosed s
uf : ∀ (x : α), x ∈ s → Set.Finite {i | x ∈ ball (c i) (r i)}
us : s ⊆ ⋃ (i : ι), ball (c i) (r i)
v : ι → Set α
hsv : s ⊆ iUnion v
hvc : ∀ (i : ι), IsClosed (v i)
hcv : ∀ (i : ι), v i ⊆ ball (c i) (r i)
⊢ ∃ r', s ⊆ ⋃ (i : ι), ball (c i) (r' i) ∧ ∀ (i : ι), r' i ∈ Ioo 0 (r i)
[PROOFSTEP]
have := fun i => exists_pos_lt_subset_ball (hr i) (hvc i) (hcv i)
[GOAL]
case intro.intro.intro
α : Type u
ι : Type v
inst✝¹ : MetricSpace α
inst✝ : ProperSpace α
c : ι → α
x : α
r✝ : ℝ
s : Set α
r : ι → ℝ
hr : ∀ (i : ι), 0 < r i
hs : IsClosed s
uf : ∀ (x : α), x ∈ s → Set.Finite {i | x ∈ ball (c i) (r i)}
us : s ⊆ ⋃ (i : ι), ball (c i) (r i)
v : ι → Set α
hsv : s ⊆ iUnion v
hvc : ∀ (i : ι), IsClosed (v i)
hcv : ∀ (i : ι), v i ⊆ ball (c i) (r i)
this : ∀ (i : ι), ∃ r', r' ∈ Ioo 0 (r i) ∧ v i ⊆ ball (c i) r'
⊢ ∃ r', s ⊆ ⋃ (i : ι), ball (c i) (r' i) ∧ ∀ (i : ι), r' i ∈ Ioo 0 (r i)
[PROOFSTEP]
choose r' hlt hsub using this
[GOAL]
case intro.intro.intro
α : Type u
ι : Type v
inst✝¹ : MetricSpace α
inst✝ : ProperSpace α
c : ι → α
x : α
r✝ : ℝ
s : Set α
r : ι → ℝ
hr : ∀ (i : ι), 0 < r i
hs : IsClosed s
uf : ∀ (x : α), x ∈ s → Set.Finite {i | x ∈ ball (c i) (r i)}
us : s ⊆ ⋃ (i : ι), ball (c i) (r i)
v : ι → Set α
hsv : s ⊆ iUnion v
hvc : ∀ (i : ι), IsClosed (v i)
hcv : ∀ (i : ι), v i ⊆ ball (c i) (r i)
r' : ι → ℝ
hlt : ∀ (i : ι), r' i ∈ Ioo 0 (r i)
hsub : ∀ (i : ι), v i ⊆ ball (c i) (r' i)
⊢ ∃ r', s ⊆ ⋃ (i : ι), ball (c i) (r' i) ∧ ∀ (i : ι), r' i ∈ Ioo 0 (r i)
[PROOFSTEP]
exact ⟨r', hsv.trans <| iUnion_mono hsub, hlt⟩
[GOAL]
α : Type u
ι : Type v
inst✝¹ : MetricSpace α
inst✝ : ProperSpace α
c : ι → α
x : α
r : ℝ
s : Set α
hs : IsClosed s
R : α → ℝ
hR : ∀ (x : α), x ∈ s → 0 < R x
⊢ ∃ ι c r r',
    (∀ (i : ι), c i ∈ s ∧ 0 < r i ∧ r i < r' i ∧ r' i < R (c i)) ∧
      (LocallyFinite fun i => ball (c i) (r' i)) ∧ s ⊆ ⋃ (i : ι), ball (c i) (r i)
[PROOFSTEP]
have : ∀ x ∈ s, (𝓝 x).HasBasis (fun r : ℝ => 0 < r ∧ r < R x) fun r => ball x r := fun x hx =>
  nhds_basis_uniformity (uniformity_basis_dist_lt (hR x hx))
[GOAL]
α : Type u
ι : Type v
inst✝¹ : MetricSpace α
inst✝ : ProperSpace α
c : ι → α
x : α
r : ℝ
s : Set α
hs : IsClosed s
R : α → ℝ
hR : ∀ (x : α), x ∈ s → 0 < R x
this : ∀ (x : α), x ∈ s → Filter.HasBasis (𝓝 x) (fun r => 0 < r ∧ r < R x) fun r => ball x r
⊢ ∃ ι c r r',
    (∀ (i : ι), c i ∈ s ∧ 0 < r i ∧ r i < r' i ∧ r' i < R (c i)) ∧
      (LocallyFinite fun i => ball (c i) (r' i)) ∧ s ⊆ ⋃ (i : ι), ball (c i) (r i)
[PROOFSTEP]
rcases refinement_of_locallyCompact_sigmaCompact_of_nhds_basis_set hs this with ⟨ι, c, r', hr', hsub', hfin⟩
[GOAL]
case intro.intro.intro.intro.intro
α : Type u
ι✝ : Type v
inst✝¹ : MetricSpace α
inst✝ : ProperSpace α
c✝ : ι✝ → α
x : α
r : ℝ
s : Set α
hs : IsClosed s
R : α → ℝ
hR : ∀ (x : α), x ∈ s → 0 < R x
this : ∀ (x : α), x ∈ s → Filter.HasBasis (𝓝 x) (fun r => 0 < r ∧ r < R x) fun r => ball x r
ι : Type u
c : ι → α
r' : ι → ℝ
hr' : ∀ (a : ι), c a ∈ s ∧ 0 < r' a ∧ r' a < R (c a)
hsub' : s ⊆ ⋃ (a : ι), ball (c a) (r' a)
hfin : LocallyFinite fun a => ball (c a) (r' a)
⊢ ∃ ι c r r',
    (∀ (i : ι), c i ∈ s ∧ 0 < r i ∧ r i < r' i ∧ r' i < R (c i)) ∧
      (LocallyFinite fun i => ball (c i) (r' i)) ∧ s ⊆ ⋃ (i : ι), ball (c i) (r i)
[PROOFSTEP]
rcases exists_subset_iUnion_ball_radius_pos_lt (fun i => (hr' i).2.1) hs (fun x _ => hfin.point_finite x) hsub' with
  ⟨r, hsub, hlt⟩
[GOAL]
case intro.intro.intro.intro.intro.intro.intro
α : Type u
ι✝ : Type v
inst✝¹ : MetricSpace α
inst✝ : ProperSpace α
c✝ : ι✝ → α
x : α
r✝ : ℝ
s : Set α
hs : IsClosed s
R : α → ℝ
hR : ∀ (x : α), x ∈ s → 0 < R x
this : ∀ (x : α), x ∈ s → Filter.HasBasis (𝓝 x) (fun r => 0 < r ∧ r < R x) fun r => ball x r
ι : Type u
c : ι → α
r' : ι → ℝ
hr' : ∀ (a : ι), c a ∈ s ∧ 0 < r' a ∧ r' a < R (c a)
hsub' : s ⊆ ⋃ (a : ι), ball (c a) (r' a)
hfin : LocallyFinite fun a => ball (c a) (r' a)
r : ι → ℝ
hsub : s ⊆ ⋃ (i : ι), ball (c i) (r i)
hlt : ∀ (i : ι), r i ∈ Ioo 0 (r' i)
⊢ ∃ ι c r r',
    (∀ (i : ι), c i ∈ s ∧ 0 < r i ∧ r i < r' i ∧ r' i < R (c i)) ∧
      (LocallyFinite fun i => ball (c i) (r' i)) ∧ s ⊆ ⋃ (i : ι), ball (c i) (r i)
[PROOFSTEP]
exact ⟨ι, c, r, r', fun i => ⟨(hr' i).1, (hlt i).1, (hlt i).2, (hr' i).2.2⟩, hfin, hsub⟩