l3lab/ntp-mathlib huggingface dataset:
/-- The `p`-adic norm of a natural `m` is one iff `p` doesn't divide `m`. -/
theorem nat_eq_one_iff (m : ℕ) : padicNorm p m = 1 ↔ ¬p ∣ m := by
  

Proof state:
p : ℕ
hp : Fact (Nat.Prime p)
m : ℕ
⊢ padicNorm p ↑m = 1 ↔ ¬p ∣ m

Next tactic:
rw [← Int.coe_nat_dvd, ← int_eq_one_iff, Int.cast_ofNat]
theorem nat_lt_one_iff (m : ℕ) : padicNorm p m < 1 ↔ p ∣ m := by
  

Proof state:
p : ℕ
hp : Fact (Nat.Prime p)
m : ℕ
⊢ padicNorm p ↑m < 1 ↔ p ∣ m

Next tactic:
rw [← Int.coe_nat_dvd, ← int_lt_one_iff, Int.cast_ofNat]
/-- If a rational is not a p-adic integer, it is not an integer. -/
theorem not_int_of_not_padic_int (p : ℕ) {a : ℚ} [hp : Fact (Nat.Prime p)]
    (H : 1 < padicNorm p a) : ¬ a.isInt := by
  

Proof state:
p✝ : ℕ
hp✝ : Fact (Nat.Prime p✝)
p : ℕ
a : ℚ
hp : Fact (Nat.Prime p)
H : 1 < padicNorm p a
⊢ ¬Rat.isInt a = true

Next tactic:
contrapose! H
/-- If a rational is not a p-adic integer, it is not an integer. -/
theorem not_int_of_not_padic_int (p : ℕ) {a : ℚ} [hp : Fact (Nat.Prime p)]
    (H : 1 < padicNorm p a) : ¬ a.isInt := by
  contrapose! H
  

Proof state:
p✝ : ℕ
hp✝ : Fact (Nat.Prime p✝)
p : ℕ
a : ℚ
hp : Fact (Nat.Prime p)
H : Rat.isInt a = true
⊢ padicNorm p a ≤ 1

Next tactic:
rw [Rat.eq_num_of_isInt H]
/-- If a rational is not a p-adic integer, it is not an integer. -/
theorem not_int_of_not_padic_int (p : ℕ) {a : ℚ} [hp : Fact (Nat.Prime p)]
    (H : 1 < padicNorm p a) : ¬ a.isInt := by
  contrapose! H
  rw [Rat.eq_num_of_isInt H]
  

Proof state:
p✝ : ℕ
hp✝ : Fact (Nat.Prime p✝)
p : ℕ
a : ℚ
hp : Fact (Nat.Prime p)
H : Rat.isInt a = true
⊢ padicNorm p ↑a.num ≤ 1

Next tactic:
apply padicNorm.of_int
theorem sum_lt {α : Type*} {F : α → ℚ} {t : ℚ} {s : Finset α} :
    s.Nonempty → (∀ i ∈ s, padicNorm p (F i) < t) → padicNorm p (∑ i in s, F i) < t := by
  

Proof state:
p : ℕ
hp : Fact (Nat.Prime p)
α : Type u_1
F : α → ℚ
t : ℚ
s : Finset α
⊢ Finset.Nonempty s → (∀ i ∈ s, padicNorm p (F i) < t) → padicNorm p (∑ i in s, F i) < t

Next tactic:
classical
    refine' s.induction_on (by rintro ⟨-, ⟨⟩⟩) _
    rintro a S haS IH - ht
    by_cases hs : S.Nonempty
    · rw [Finset.sum_insert haS]
      exact
        lt_of_le_of_lt padicNorm.nonarchimedean
          (max_lt (ht a (Finset.mem_insert_self a S))
            (IH hs fun b hb ↦ ht b (Finset.mem_insert_of_mem hb)))
    · simp_all
theorem sum_lt {α : Type*} {F : α → ℚ} {t : ℚ} {s : Finset α} :
    s.Nonempty → (∀ i ∈ s, padicNorm p (F i) < t) → padicNorm p (∑ i in s, F i) < t := by
  classical
    

Proof state:
p : ℕ
hp : Fact (Nat.Prime p)
α : Type u_1
F : α → ℚ
t : ℚ
s : Finset α
⊢ Finset.Nonempty s → (∀ i ∈ s, padicNorm p (F i) < t) → padicNorm p (∑ i in s, F i) < t

Next tactic:
refine' s.induction_on (by rintro ⟨-, ⟨⟩⟩) _
theorem sum_lt {α : Type*} {F : α → ℚ} {t : ℚ} {s : Finset α} :
    s.Nonempty → (∀ i ∈ s, padicNorm p (F i) < t) → padicNorm p (∑ i in s, F i) < t := by
  classical
    refine' s.induction_on (by 

Proof state:
p : ℕ
hp : Fact (Nat.Prime p)
α : Type u_1
F : α → ℚ
t : ℚ
s : Finset α
⊢ Finset.Nonempty ∅ → (∀ i ∈ ∅, padicNorm p (F i) < t) → padicNorm p (∑ i in ∅, F i) < t

Next tactic:
rintro ⟨-, ⟨⟩⟩
theorem sum_lt {α : Type*} {F : α → ℚ} {t : ℚ} {s : Finset α} :
    s.Nonempty → (∀ i ∈ s, padicNorm p (F i) < t) → padicNorm p (∑ i in s, F i) < t := by
  classical
    refine' s.induction_on (by rintro ⟨-, ⟨⟩⟩) _
    

Proof state:
p : ℕ
hp : Fact (Nat.Prime p)
α : Type u_1
F : α → ℚ
t : ℚ
s : Finset α
⊢ ∀ ⦃a : α⦄ {s : Finset α},
    a ∉ s →
      (Finset.Nonempty s → (∀ i ∈ s, padicNorm p (F i) < t) → padicNorm p (∑ i in s, F i) < t) →
        Finset.Nonempty (insert a s) →
          (∀ i ∈ insert a s, padicNorm p (F i) < t) → padicNorm p (∑ i in insert a s, F i) < t

Next tactic:
rintro a S haS IH - ht
theorem sum_lt {α : Type*} {F : α → ℚ} {t : ℚ} {s : Finset α} :
    s.Nonempty → (∀ i ∈ s, padicNorm p (F i) < t) → padicNorm p (∑ i in s, F i) < t := by
  classical
    refine' s.induction_on (by rintro ⟨-, ⟨⟩⟩) _
    rintro a S haS IH - ht
    

Proof state:
p : ℕ
hp : Fact (Nat.Prime p)
α : Type u_1
F : α → ℚ
t : ℚ
s : Finset α
a : α
S : Finset α
haS : a ∉ S
IH : Finset.Nonempty S → (∀ i ∈ S, padicNorm p (F i) < t) → padicNorm p (∑ i in S, F i) < t
ht : ∀ i ∈ insert a S, padicNorm p (F i) < t
⊢ padicNorm p (∑ i in insert a S, F i) < t

Next tactic:
by_cases hs : S.Nonempty
theorem sum_lt {α : Type*} {F : α → ℚ} {t : ℚ} {s : Finset α} :
    s.Nonempty → (∀ i ∈ s, padicNorm p (F i) < t) → padicNorm p (∑ i in s, F i) < t := by
  classical
    refine' s.induction_on (by rintro ⟨-, ⟨⟩⟩) _
    rintro a S haS IH - ht
    by_cases hs : S.Nonempty
    · 

Proof state:
case pos
p : ℕ
hp : Fact (Nat.Prime p)
α : Type u_1
F : α → ℚ
t : ℚ
s : Finset α
a : α
S : Finset α
haS : a ∉ S
IH : Finset.Nonempty S → (∀ i ∈ S, padicNorm p (F i) < t) → padicNorm p (∑ i in S, F i) < t
ht : ∀ i ∈ insert a S, padicNorm p (F i) < t
hs : Finset.Nonempty S
⊢ padicNorm p (∑ i in insert a S, F i) < t

Next tactic:
rw [Finset.sum_insert haS]
theorem sum_lt {α : Type*} {F : α → ℚ} {t : ℚ} {s : Finset α} :
    s.Nonempty → (∀ i ∈ s, padicNorm p (F i) < t) → padicNorm p (∑ i in s, F i) < t := by
  classical
    refine' s.induction_on (by rintro ⟨-, ⟨⟩⟩) _
    rintro a S haS IH - ht
    by_cases hs : S.Nonempty
    · rw [Finset.sum_insert haS]
      

Proof state:
case pos
p : ℕ
hp : Fact (Nat.Prime p)
α : Type u_1
F : α → ℚ
t : ℚ
s : Finset α
a : α
S : Finset α
haS : a ∉ S
IH : Finset.Nonempty S → (∀ i ∈ S, padicNorm p (F i) < t) → padicNorm p (∑ i in S, F i) < t
ht : ∀ i ∈ insert a S, padicNorm p (F i) < t
hs : Finset.Nonempty S
⊢ padicNorm p (F a + ∑ x in S, F x) < t

Next tactic:
exact
        lt_of_le_of_lt padicNorm.nonarchimedean
          (max_lt (ht a (Finset.mem_insert_self a S))
            (IH hs fun b hb ↦ ht b (Finset.mem_insert_of_mem hb)))
theorem sum_lt {α : Type*} {F : α → ℚ} {t : ℚ} {s : Finset α} :
    s.Nonempty → (∀ i ∈ s, padicNorm p (F i) < t) → padicNorm p (∑ i in s, F i) < t := by
  classical
    refine' s.induction_on (by rintro ⟨-, ⟨⟩⟩) _
    rintro a S haS IH - ht
    by_cases hs : S.Nonempty
    · rw [Finset.sum_insert haS]
      exact
        lt_of_le_of_lt padicNorm.nonarchimedean
          (max_lt (ht a (Finset.mem_insert_self a S))
            (IH hs fun b hb ↦ ht b (Finset.mem_insert_of_mem hb)))
    · 

Proof state:
case neg
p : ℕ
hp : Fact (Nat.Prime p)
α : Type u_1
F : α → ℚ
t : ℚ
s : Finset α
a : α
S : Finset α
haS : a ∉ S
IH : Finset.Nonempty S → (∀ i ∈ S, padicNorm p (F i) < t) → padicNorm p (∑ i in S, F i) < t
ht : ∀ i ∈ insert a S, padicNorm p (F i) < t
hs : ¬Finset.Nonempty S
⊢ padicNorm p (∑ i in insert a S, F i) < t

Next tactic:
simp_all
theorem sum_le {α : Type*} {F : α → ℚ} {t : ℚ} {s : Finset α} :
    s.Nonempty → (∀ i ∈ s, padicNorm p (F i) ≤ t) → padicNorm p (∑ i in s, F i) ≤ t := by
  

Proof state:
p : ℕ
hp : Fact (Nat.Prime p)
α : Type u_1
F : α → ℚ
t : ℚ
s : Finset α
⊢ Finset.Nonempty s → (∀ i ∈ s, padicNorm p (F i) ≤ t) → padicNorm p (∑ i in s, F i) ≤ t

Next tactic:
classical
    refine' s.induction_on (by rintro ⟨-, ⟨⟩⟩) _
    rintro a S haS IH - ht
    by_cases hs : S.Nonempty
    · rw [Finset.sum_insert haS]
      exact
        padicNorm.nonarchimedean.trans
          (max_le (ht a (Finset.mem_insert_self a S))
            (IH hs fun b hb ↦ ht b (Finset.mem_insert_of_mem hb)))
    · simp_all
theorem sum_le {α : Type*} {F : α → ℚ} {t : ℚ} {s : Finset α} :
    s.Nonempty → (∀ i ∈ s, padicNorm p (F i) ≤ t) → padicNorm p (∑ i in s, F i) ≤ t := by
  classical
    

Proof state:
p : ℕ
hp : Fact (Nat.Prime p)
α : Type u_1
F : α → ℚ
t : ℚ
s : Finset α
⊢ Finset.Nonempty s → (∀ i ∈ s, padicNorm p (F i) ≤ t) → padicNorm p (∑ i in s, F i) ≤ t

Next tactic:
refine' s.induction_on (by rintro ⟨-, ⟨⟩⟩) _
theorem sum_le {α : Type*} {F : α → ℚ} {t : ℚ} {s : Finset α} :
    s.Nonempty → (∀ i ∈ s, padicNorm p (F i) ≤ t) → padicNorm p (∑ i in s, F i) ≤ t := by
  classical
    refine' s.induction_on (by 

Proof state:
p : ℕ
hp : Fact (Nat.Prime p)
α : Type u_1
F : α → ℚ
t : ℚ
s : Finset α
⊢ Finset.Nonempty ∅ → (∀ i ∈ ∅, padicNorm p (F i) ≤ t) → padicNorm p (∑ i in ∅, F i) ≤ t

Next tactic:
rintro ⟨-, ⟨⟩⟩
theorem sum_le {α : Type*} {F : α → ℚ} {t : ℚ} {s : Finset α} :
    s.Nonempty → (∀ i ∈ s, padicNorm p (F i) ≤ t) → padicNorm p (∑ i in s, F i) ≤ t := by
  classical
    refine' s.induction_on (by rintro ⟨-, ⟨⟩⟩) _
    

Proof state:
p : ℕ
hp : Fact (Nat.Prime p)
α : Type u_1
F : α → ℚ
t : ℚ
s : Finset α
⊢ ∀ ⦃a : α⦄ {s : Finset α},
    a ∉ s →
      (Finset.Nonempty s → (∀ i ∈ s, padicNorm p (F i) ≤ t) → padicNorm p (∑ i in s, F i) ≤ t) →
        Finset.Nonempty (insert a s) →
          (∀ i ∈ insert a s, padicNorm p (F i) ≤ t) → padicNorm p (∑ i in insert a s, F i) ≤ t

Next tactic:
rintro a S haS IH - ht
theorem sum_le {α : Type*} {F : α → ℚ} {t : ℚ} {s : Finset α} :
    s.Nonempty → (∀ i ∈ s, padicNorm p (F i) ≤ t) → padicNorm p (∑ i in s, F i) ≤ t := by
  classical
    refine' s.induction_on (by rintro ⟨-, ⟨⟩⟩) _
    rintro a S haS IH - ht
    

Proof state:
p : ℕ
hp : Fact (Nat.Prime p)
α : Type u_1
F : α → ℚ
t : ℚ
s : Finset α
a : α
S : Finset α
haS : a ∉ S
IH : Finset.Nonempty S → (∀ i ∈ S, padicNorm p (F i) ≤ t) → padicNorm p (∑ i in S, F i) ≤ t
ht : ∀ i ∈ insert a S, padicNorm p (F i) ≤ t
⊢ padicNorm p (∑ i in insert a S, F i) ≤ t

Next tactic:
by_cases hs : S.Nonempty
theorem sum_le {α : Type*} {F : α → ℚ} {t : ℚ} {s : Finset α} :
    s.Nonempty → (∀ i ∈ s, padicNorm p (F i) ≤ t) → padicNorm p (∑ i in s, F i) ≤ t := by
  classical
    refine' s.induction_on (by rintro ⟨-, ⟨⟩⟩) _
    rintro a S haS IH - ht
    by_cases hs : S.Nonempty
    · 

Proof state:
case pos
p : ℕ
hp : Fact (Nat.Prime p)
α : Type u_1
F : α → ℚ
t : ℚ
s : Finset α
a : α
S : Finset α
haS : a ∉ S
IH : Finset.Nonempty S → (∀ i ∈ S, padicNorm p (F i) ≤ t) → padicNorm p (∑ i in S, F i) ≤ t
ht : ∀ i ∈ insert a S, padicNorm p (F i) ≤ t
hs : Finset.Nonempty S
⊢ padicNorm p (∑ i in insert a S, F i) ≤ t

Next tactic:
rw [Finset.sum_insert haS]
theorem sum_le {α : Type*} {F : α → ℚ} {t : ℚ} {s : Finset α} :
    s.Nonempty → (∀ i ∈ s, padicNorm p (F i) ≤ t) → padicNorm p (∑ i in s, F i) ≤ t := by
  classical
    refine' s.induction_on (by rintro ⟨-, ⟨⟩⟩) _
    rintro a S haS IH - ht
    by_cases hs : S.Nonempty
    · rw [Finset.sum_insert haS]
      

Proof state:
case pos
p : ℕ
hp : Fact (Nat.Prime p)
α : Type u_1
F : α → ℚ
t : ℚ
s : Finset α
a : α
S : Finset α
haS : a ∉ S
IH : Finset.Nonempty S → (∀ i ∈ S, padicNorm p (F i) ≤ t) → padicNorm p (∑ i in S, F i) ≤ t
ht : ∀ i ∈ insert a S, padicNorm p (F i) ≤ t
hs : Finset.Nonempty S
⊢ padicNorm p (F a + ∑ x in S, F x) ≤ t

Next tactic:
exact
        padicNorm.nonarchimedean.trans
          (max_le (ht a (Finset.mem_insert_self a S))
            (IH hs fun b hb ↦ ht b (Finset.mem_insert_of_mem hb)))
theorem sum_le {α : Type*} {F : α → ℚ} {t : ℚ} {s : Finset α} :
    s.Nonempty → (∀ i ∈ s, padicNorm p (F i) ≤ t) → padicNorm p (∑ i in s, F i) ≤ t := by
  classical
    refine' s.induction_on (by rintro ⟨-, ⟨⟩⟩) _
    rintro a S haS IH - ht
    by_cases hs : S.Nonempty
    · rw [Finset.sum_insert haS]
      exact
        padicNorm.nonarchimedean.trans
          (max_le (ht a (Finset.mem_insert_self a S))
            (IH hs fun b hb ↦ ht b (Finset.mem_insert_of_mem hb)))
    · 

Proof state:
case neg
p : ℕ
hp : Fact (Nat.Prime p)
α : Type u_1
F : α → ℚ
t : ℚ
s : Finset α
a : α
S : Finset α
haS : a ∉ S
IH : Finset.Nonempty S → (∀ i ∈ S, padicNorm p (F i) ≤ t) → padicNorm p (∑ i in S, F i) ≤ t
ht : ∀ i ∈ insert a S, padicNorm p (F i) ≤ t
hs : ¬Finset.Nonempty S
⊢ padicNorm p (∑ i in insert a S, F i) ≤ t

Next tactic:
simp_all
theorem sum_lt' {α : Type*} {F : α → ℚ} {t : ℚ} {s : Finset α}
    (hF : ∀ i ∈ s, padicNorm p (F i) < t) (ht : 0 < t) : padicNorm p (∑ i in s, F i) < t := by
  

Proof state:
p : ℕ
hp : Fact (Nat.Prime p)
α : Type u_1
F : α → ℚ
t : ℚ
s : Finset α
hF : ∀ i ∈ s, padicNorm p (F i) < t
ht : 0 < t
⊢ padicNorm p (∑ i in s, F i) < t

Next tactic:
obtain rfl | hs := Finset.eq_empty_or_nonempty s
theorem sum_lt' {α : Type*} {F : α → ℚ} {t : ℚ} {s : Finset α}
    (hF : ∀ i ∈ s, padicNorm p (F i) < t) (ht : 0 < t) : padicNorm p (∑ i in s, F i) < t := by
  obtain rfl | hs := Finset.eq_empty_or_nonempty s
  · 

Proof state:
case inl
p : ℕ
hp : Fact (Nat.Prime p)
α : Type u_1
F : α → ℚ
t : ℚ
ht : 0 < t
hF : ∀ i ∈ ∅, padicNorm p (F i) < t
⊢ padicNorm p (∑ i in ∅, F i) < t

Next tactic:
simp [ht]
theorem sum_lt' {α : Type*} {F : α → ℚ} {t : ℚ} {s : Finset α}
    (hF : ∀ i ∈ s, padicNorm p (F i) < t) (ht : 0 < t) : padicNorm p (∑ i in s, F i) < t := by
  obtain rfl | hs := Finset.eq_empty_or_nonempty s
  · simp [ht]
  · 

Proof state:
case inr
p : ℕ
hp : Fact (Nat.Prime p)
α : Type u_1
F : α → ℚ
t : ℚ
s : Finset α
hF : ∀ i ∈ s, padicNorm p (F i) < t
ht : 0 < t
hs : Finset.Nonempty s
⊢ padicNorm p (∑ i in s, F i) < t

Next tactic:
exact sum_lt hs hF
theorem sum_le' {α : Type*} {F : α → ℚ} {t : ℚ} {s : Finset α}
    (hF : ∀ i ∈ s, padicNorm p (F i) ≤ t) (ht : 0 ≤ t) : padicNorm p (∑ i in s, F i) ≤ t := by
  

Proof state:
p : ℕ
hp : Fact (Nat.Prime p)
α : Type u_1
F : α → ℚ
t : ℚ
s : Finset α
hF : ∀ i ∈ s, padicNorm p (F i) ≤ t
ht : 0 ≤ t
⊢ padicNorm p (∑ i in s, F i) ≤ t

Next tactic:
obtain rfl | hs := Finset.eq_empty_or_nonempty s
theorem sum_le' {α : Type*} {F : α → ℚ} {t : ℚ} {s : Finset α}
    (hF : ∀ i ∈ s, padicNorm p (F i) ≤ t) (ht : 0 ≤ t) : padicNorm p (∑ i in s, F i) ≤ t := by
  obtain rfl | hs := Finset.eq_empty_or_nonempty s
  · 

Proof state:
case inl
p : ℕ
hp : Fact (Nat.Prime p)
α : Type u_1
F : α → ℚ
t : ℚ
ht : 0 ≤ t
hF : ∀ i ∈ ∅, padicNorm p (F i) ≤ t
⊢ padicNorm p (∑ i in ∅, F i) ≤ t

Next tactic:
simp [ht]
theorem sum_le' {α : Type*} {F : α → ℚ} {t : ℚ} {s : Finset α}
    (hF : ∀ i ∈ s, padicNorm p (F i) ≤ t) (ht : 0 ≤ t) : padicNorm p (∑ i in s, F i) ≤ t := by
  obtain rfl | hs := Finset.eq_empty_or_nonempty s
  · simp [ht]
  · 

Proof state:
case inr
p : ℕ
hp : Fact (Nat.Prime p)
α : Type u_1
F : α → ℚ
t : ℚ
s : Finset α
hF : ∀ i ∈ s, padicNorm p (F i) ≤ t
ht : 0 ≤ t
hs : Finset.Nonempty s
⊢ padicNorm p (∑ i in s, F i) ≤ t

Next tactic:
exact sum_le hs hF
/-- `circleMap` is `2π`-periodic. -/
theorem periodic_circleMap (c : ℂ) (R : ℝ) : Periodic (circleMap c R) (2 * π) := fun θ => by
  

Proof state:
E : Type u_1
inst✝ : NormedAddCommGroup E
c : ℂ
R θ : ℝ
⊢ circleMap c R (θ + 2 * π) = circleMap c R θ

Next tactic:
simp [circleMap, add_mul, exp_periodic _]
@[simp]
theorem circleMap_sub_center (c : ℂ) (R : ℝ) (θ : ℝ) : circleMap c R θ - c = circleMap 0 R θ := by
  

Proof state:
E : Type u_1
inst✝ : NormedAddCommGroup E
c : ℂ
R θ : ℝ
⊢ circleMap c R θ - c = circleMap 0 R θ

Next tactic:
simp [circleMap]
@[simp]
theorem abs_circleMap_zero (R : ℝ) (θ : ℝ) : abs (circleMap 0 R θ) = |R| := by 

Proof state:
E : Type u_1
inst✝ : NormedAddCommGroup E
R θ : ℝ
⊢ Complex.abs (circleMap 0 R θ) = |R|

Next tactic:
simp [circleMap]
theorem circleMap_mem_sphere' (c : ℂ) (R : ℝ) (θ : ℝ) : circleMap c R θ ∈ sphere c |R| := by 

Proof state:
E : Type u_1
inst✝ : NormedAddCommGroup E
c : ℂ
R θ : ℝ
⊢ circleMap c R θ ∈ sphere c |R|

Next tactic:
simp
theorem circleMap_mem_sphere (c : ℂ) {R : ℝ} (hR : 0 ≤ R) (θ : ℝ) : circleMap c R θ ∈ sphere c R :=
  by 

Proof state:
E : Type u_1
inst✝ : NormedAddCommGroup E
c : ℂ
R : ℝ
hR : 0 ≤ R
θ : ℝ
⊢ circleMap c R θ ∈ sphere c R

Next tactic:
simpa only [_root_.abs_of_nonneg hR] using circleMap_mem_sphere' c R θ
theorem circleMap_not_mem_ball (c : ℂ) (R : ℝ) (θ : ℝ) : circleMap c R θ ∉ ball c R := by
  

Proof state:
E : Type u_1
inst✝ : NormedAddCommGroup E
c : ℂ
R θ : ℝ
⊢ circleMap c R θ ∉ ball c R

Next tactic:
simp [dist_eq, le_abs_self]
/-- The range of `circleMap c R` is the circle with center `c` and radius `|R|`. -/
@[simp]
theorem range_circleMap (c : ℂ) (R : ℝ) : range (circleMap c R) = sphere c |R| :=
  calc
    range (circleMap c R) = c +ᵥ R • range fun θ : ℝ => exp (θ * I) := by
      

Proof state:
E : Type u_1
inst✝ : NormedAddCommGroup E
c : ℂ
R : ℝ
⊢ range (circleMap c R) = c +ᵥ R • range fun θ => cexp (↑θ * I)

Next tactic:
simp (config := { unfoldPartialApp := true }) only [← image_vadd, ← image_smul, ← range_comp,
        vadd_eq_add, circleMap, Function.comp_def, real_smul]
/-- The range of `circleMap c R` is the circle with center `c` and radius `|R|`. -/
@[simp]
theorem range_circleMap (c : ℂ) (R : ℝ) : range (circleMap c R) = sphere c |R| :=
  calc
    range (circleMap c R) = c +ᵥ R • range fun θ : ℝ => exp (θ * I) := by
      simp (config := { unfoldPartialApp := true }) only [← image_vadd, ← image_smul, ← range_comp,
        vadd_eq_add, circleMap, Function.comp_def, real_smul]
    _ = sphere c |R| := by
      

Proof state:
E : Type u_1
inst✝ : NormedAddCommGroup E
c : ℂ
R : ℝ
⊢ (c +ᵥ R • range fun θ => cexp (↑θ * I)) = sphere c |R|

Next tactic:
rw [Complex.range_exp_mul_I, smul_sphere R 0 zero_le_one]
/-- The range of `circleMap c R` is the circle with center `c` and radius `|R|`. -/
@[simp]
theorem range_circleMap (c : ℂ) (R : ℝ) : range (circleMap c R) = sphere c |R| :=
  calc
    range (circleMap c R) = c +ᵥ R • range fun θ : ℝ => exp (θ * I) := by
      simp (config := { unfoldPartialApp := true }) only [← image_vadd, ← image_smul, ← range_comp,
        vadd_eq_add, circleMap, Function.comp_def, real_smul]
    _ = sphere c |R| := by
      rw [Complex.range_exp_mul_I, smul_sphere R 0 zero_le_one]
      

Proof state:
E : Type u_1
inst✝ : NormedAddCommGroup E
c : ℂ
R : ℝ
⊢ c +ᵥ sphere (R • 0) (‖R‖ * 1) = sphere c |R|

Next tactic:
simp
/-- The image of `(0, 2π]` under `circleMap c R` is the circle with center `c` and radius `|R|`. -/
@[simp]
theorem image_circleMap_Ioc (c : ℂ) (R : ℝ) : circleMap c R '' Ioc 0 (2 * π) = sphere c |R| := by
  

Proof state:
E : Type u_1
inst✝ : NormedAddCommGroup E
c : ℂ
R : ℝ
⊢ circleMap c R '' Ioc 0 (2 * π) = sphere c |R|

Next tactic:
rw [← range_circleMap, ← (periodic_circleMap c R).image_Ioc Real.two_pi_pos 0, zero_add]
@[simp]
theorem circleMap_eq_center_iff {c : ℂ} {R : ℝ} {θ : ℝ} : circleMap c R θ = c ↔ R = 0 := by
  

Proof state:
E : Type u_1
inst✝ : NormedAddCommGroup E
c : ℂ
R θ : ℝ
⊢ circleMap c R θ = c ↔ R = 0

Next tactic:
simp [circleMap, exp_ne_zero]
theorem hasDerivAt_circleMap (c : ℂ) (R : ℝ) (θ : ℝ) :
    HasDerivAt (circleMap c R) (circleMap 0 R θ * I) θ := by
  

Proof state:
E : Type u_1
inst✝ : NormedAddCommGroup E
c : ℂ
R θ : ℝ
⊢ HasDerivAt (circleMap c R) (circleMap 0 R θ * I) θ

Next tactic:
simpa only [mul_assoc, one_mul, ofRealClm_apply, circleMap, ofReal_one, zero_add]
    using (((ofRealClm.hasDerivAt (x := θ)).mul_const I).cexp.const_mul (R : ℂ)).const_add c
theorem deriv_circleMap_eq_zero_iff {c : ℂ} {R : ℝ} {θ : ℝ} : deriv (circleMap c R) θ = 0 ↔ R = 0 :=
  by 

Proof state:
E : Type u_1
inst✝ : NormedAddCommGroup E
c : ℂ
R θ : ℝ
⊢ deriv (circleMap c R) θ = 0 ↔ R = 0

Next tactic:
simp [I_ne_zero]
theorem lipschitzWith_circleMap (c : ℂ) (R : ℝ) : LipschitzWith (Real.nnabs R) (circleMap c R) :=
  lipschitzWith_of_nnnorm_deriv_le (differentiable_circleMap _ _) fun θ =>
    NNReal.coe_le_coe.1 <| by 

Proof state:
E : Type u_1
inst✝ : NormedAddCommGroup E
c : ℂ
R θ : ℝ
⊢ ↑‖deriv (circleMap c R) θ‖₊ ≤ ↑(Real.nnabs R)

Next tactic:
simp
theorem continuous_circleMap_inv {R : ℝ} {z w : ℂ} (hw : w ∈ ball z R) :
    Continuous fun θ => (circleMap z R θ - w)⁻¹ := by
  

Proof state:
E : Type u_1
inst✝ : NormedAddCommGroup E
R : ℝ
z w : ℂ
hw : w ∈ ball z R
⊢ Continuous fun θ => (circleMap z R θ - w)⁻¹

Next tactic:
have : ∀ θ, circleMap z R θ - w ≠ 0 := by
    simp_rw [sub_ne_zero]
    exact fun θ => circleMap_ne_mem_ball hw θ
theorem continuous_circleMap_inv {R : ℝ} {z w : ℂ} (hw : w ∈ ball z R) :
    Continuous fun θ => (circleMap z R θ - w)⁻¹ := by
  have : ∀ θ, circleMap z R θ - w ≠ 0 := by
    

Proof state:
E : Type u_1
inst✝ : NormedAddCommGroup E
R : ℝ
z w : ℂ
hw : w ∈ ball z R
⊢ ∀ (θ : ℝ), circleMap z R θ - w ≠ 0

Next tactic:
simp_rw [sub_ne_zero]
theorem continuous_circleMap_inv {R : ℝ} {z w : ℂ} (hw : w ∈ ball z R) :
    Continuous fun θ => (circleMap z R θ - w)⁻¹ := by
  have : ∀ θ, circleMap z R θ - w ≠ 0 := by
    simp_rw [sub_ne_zero]
    

Proof state:
E : Type u_1
inst✝ : NormedAddCommGroup E
R : ℝ
z w : ℂ
hw : w ∈ ball z R
⊢ ∀ (θ : ℝ), circleMap z R θ ≠ w

Next tactic:
exact fun θ => circleMap_ne_mem_ball hw θ
theorem continuous_circleMap_inv {R : ℝ} {z w : ℂ} (hw : w ∈ ball z R) :
    Continuous fun θ => (circleMap z R θ - w)⁻¹ := by
  have : ∀ θ, circleMap z R θ - w ≠ 0 := by
    simp_rw [sub_ne_zero]
    exact fun θ => circleMap_ne_mem_ball hw θ
  -- Porting note: was `continuity`
  

Proof state:
E : Type u_1
inst✝ : NormedAddCommGroup E
R : ℝ
z w : ℂ
hw : w ∈ ball z R
this : ∀ (θ : ℝ), circleMap z R θ - w ≠ 0
⊢ Continuous fun θ => (circleMap z R θ - w)⁻¹

Next tactic:
exact Continuous.inv₀ (by continuity) this
theorem continuous_circleMap_inv {R : ℝ} {z w : ℂ} (hw : w ∈ ball z R) :
    Continuous fun θ => (circleMap z R θ - w)⁻¹ := by
  have : ∀ θ, circleMap z R θ - w ≠ 0 := by
    simp_rw [sub_ne_zero]
    exact fun θ => circleMap_ne_mem_ball hw θ
  -- Porting note: was `continuity`
  exact Continuous.inv₀ (by 

Proof state:
E : Type u_1
inst✝ : NormedAddCommGroup E
R : ℝ
z w : ℂ
hw : w ∈ ball z R
this : ∀ (θ : ℝ), circleMap z R θ - w ≠ 0
⊢ Continuous fun θ => circleMap z R θ - w

Next tactic:
continuity
/-- The function we actually integrate over `[0, 2π]` in the definition of `circleIntegral` is
integrable. -/
theorem out [NormedSpace ℂ E] (hf : CircleIntegrable f c R) :
    IntervalIntegrable (fun θ : ℝ => deriv (circleMap c R) θ • f (circleMap c R θ)) volume 0
      (2 * π) := by
  

Proof state:
E : Type u_1
inst✝¹ : NormedAddCommGroup E
f g : ℂ → E
c : ℂ
R : ℝ
inst✝ : NormedSpace ℂ E
hf : CircleIntegrable f c R
⊢ IntervalIntegrable (fun θ => deriv (circleMap c R) θ • f (circleMap c R θ)) volume 0 (2 * π)

Next tactic:
simp only [CircleIntegrable, deriv_circleMap, intervalIntegrable_iff] at *
/-- The function we actually integrate over `[0, 2π]` in the definition of `circleIntegral` is
integrable. -/
theorem out [NormedSpace ℂ E] (hf : CircleIntegrable f c R) :
    IntervalIntegrable (fun θ : ℝ => deriv (circleMap c R) θ • f (circleMap c R θ)) volume 0
      (2 * π) := by
  simp only [CircleIntegrable, deriv_circleMap, intervalIntegrable_iff] at *
  

Proof state:
E : Type u_1
inst✝¹ : NormedAddCommGroup E
f g : ℂ → E
c : ℂ
R : ℝ
inst✝ : NormedSpace ℂ E
hf : IntegrableOn (fun θ => f (circleMap c R θ)) (Ι 0 (2 * π))
⊢ IntegrableOn (fun θ => (circleMap 0 R θ * I) • f (circleMap c R θ)) (Ι 0 (2 * π))

Next tactic:
refine' (hf.norm.const_mul |R|).mono' _ _
/-- The function we actually integrate over `[0, 2π]` in the definition of `circleIntegral` is
integrable. -/
theorem out [NormedSpace ℂ E] (hf : CircleIntegrable f c R) :
    IntervalIntegrable (fun θ : ℝ => deriv (circleMap c R) θ • f (circleMap c R θ)) volume 0
      (2 * π) := by
  simp only [CircleIntegrable, deriv_circleMap, intervalIntegrable_iff] at *
  refine' (hf.norm.const_mul |R|).mono' _ _
  · 

Proof state:
case refine'_1
E : Type u_1
inst✝¹ : NormedAddCommGroup E
f g : ℂ → E
c : ℂ
R : ℝ
inst✝ : NormedSpace ℂ E
hf : IntegrableOn (fun θ => f (circleMap c R θ)) (Ι 0 (2 * π))
⊢ AEStronglyMeasurable (fun θ => (circleMap 0 R θ * I) • f (circleMap c R θ)) (Measure.restrict volume (Ι 0 (2 * π)))

Next tactic:
exact ((continuous_circleMap _ _).aestronglyMeasurable.mul_const I).smul hf.aestronglyMeasurable
/-- The function we actually integrate over `[0, 2π]` in the definition of `circleIntegral` is
integrable. -/
theorem out [NormedSpace ℂ E] (hf : CircleIntegrable f c R) :
    IntervalIntegrable (fun θ : ℝ => deriv (circleMap c R) θ • f (circleMap c R θ)) volume 0
      (2 * π) := by
  simp only [CircleIntegrable, deriv_circleMap, intervalIntegrable_iff] at *
  refine' (hf.norm.const_mul |R|).mono' _ _
  · exact ((continuous_circleMap _ _).aestronglyMeasurable.mul_const I).smul hf.aestronglyMeasurable
  · 

Proof state:
case refine'_2
E : Type u_1
inst✝¹ : NormedAddCommGroup E
f g : ℂ → E
c : ℂ
R : ℝ
inst✝ : NormedSpace ℂ E
hf : IntegrableOn (fun θ => f (circleMap c R θ)) (Ι 0 (2 * π))
⊢ ∀ᵐ (a : ℝ) ∂Measure.restrict volume (Ι 0 (2 * π)),
    ‖(circleMap 0 R a * I) • f (circleMap c R a)‖ ≤ |R| * ‖f (circleMap c R a)‖

Next tactic:
simp [norm_smul]