import Mathlib.Analysis.Complex.CauchyIntegral
import Nevanlinna.harmonicAt_examples
import Nevanlinna.harmonicAt_meanValue
import Mathlib.Analysis.Analytic.IsolatedZeros


lemma xx
  {f : ℂ → ℂ}
  {S : Set ℂ}
  {R : ℝ}
  (h₁ : DifferentiableOn ℂ f (Metric.ball z₀ R)) :
  ∃ o : ℂ → ℕ, ∃ F : ℂ → ℂ, ∀ z ∈ (Metric.ball z₀ R), (DifferentiableAt ℂ F z) ∧ (F z ≠ 0) ∧ (f z = F z * ∏ᶠ s ∈ (Metric.ball z₀ R), (z - s) ^ (o s)) := by
  sorry


theorem jensen_case_R_eq_one'
  (f : ℂ → ℂ)
  (h₁f : Differentiable ℂ f)
  (h₂f : f 0 ≠ 0)
  (S : Finset ℕ)
  (a : S → ℂ)
  (ha : ∀ s, a s ∈ Metric.ball 0 1)
  (F : ℂ → ℂ)
  (h₁F : Differentiable ℂ F)
  (h₂F : ∀ z, F z ≠ 0)
  (h₃F : f = fun z ↦ (F z) * ∏ s : S, (z - a s))
  :
  Real.log ‖f 0‖ = -∑ s, Real.log (‖a s‖⁻¹) + (2 * Real.pi)⁻¹ * ∫ (x : ℝ) in (0)..2 * Real.pi, Real.log ‖f (circleMap 0 1 x)‖ := by
  sorry
