l3lab/ntp-mathlib huggingface dataset:
theorem exists_eq_pow_p_mul (a : 𝕎 k) (ha : a ≠ 0) :
    ∃ (m : ℕ) (b : 𝕎 k), b.coeff 0 ≠ 0 ∧ a = (p : 𝕎 k) ^ m * b := by
  obtain ⟨m, c, hc, hcm⟩ := WittVector.verschiebung_nonzero ha
  obtain ⟨b, rfl⟩ := (frobenius_bijective p k).surjective.iterate m c
  rw [WittVector.iterate_frobenius_coeff] at hc
  have := congr_fun (WittVector.verschiebung_frobenius_comm.comp_iterate m) b
  simp only [Function.comp_apply] at this
  rw [← this] at hcm
  refine' ⟨m, b, _, _⟩
  · contrapose! hc
    have : 0 < p ^ m := pow_pos (Nat.Prime.pos Fact.out) _
    

Proof state:
case intro.intro.intro.intro.refine'_1
p : ℕ
hp : Fact (Nat.Prime p)
k : Type u_1
inst✝² : CommRing k
inst✝¹ : CharP k p
inst✝ : PerfectRing k p
a : 𝕎 k
ha : a ≠ 0
m : ℕ
b : 𝕎 k
hcm : a = (⇑verschiebung ∘ ⇑frobenius)^[m] b
this✝ : (⇑verschiebung ∘ ⇑frobenius)^[m] b = (⇑verschiebung)^[m] ((⇑frobenius)^[m] b)
hc : coeff b 0 = 0
this : 0 < p ^ m
⊢ coeff b 0 ^ p ^ m = 0

Next tactic:
simp [hc, zero_pow this]
theorem exists_eq_pow_p_mul (a : 𝕎 k) (ha : a ≠ 0) :
    ∃ (m : ℕ) (b : 𝕎 k), b.coeff 0 ≠ 0 ∧ a = (p : 𝕎 k) ^ m * b := by
  obtain ⟨m, c, hc, hcm⟩ := WittVector.verschiebung_nonzero ha
  obtain ⟨b, rfl⟩ := (frobenius_bijective p k).surjective.iterate m c
  rw [WittVector.iterate_frobenius_coeff] at hc
  have := congr_fun (WittVector.verschiebung_frobenius_comm.comp_iterate m) b
  simp only [Function.comp_apply] at this
  rw [← this] at hcm
  refine' ⟨m, b, _, _⟩
  · contrapose! hc
    have : 0 < p ^ m := pow_pos (Nat.Prime.pos Fact.out) _
    simp [hc, zero_pow this]
  · 

Proof state:
case intro.intro.intro.intro.refine'_2
p : ℕ
hp : Fact (Nat.Prime p)
k : Type u_1
inst✝² : CommRing k
inst✝¹ : CharP k p
inst✝ : PerfectRing k p
a : 𝕎 k
ha : a ≠ 0
m : ℕ
b : 𝕎 k
hc : coeff b 0 ^ p ^ m ≠ 0
hcm : a = (⇑verschiebung ∘ ⇑frobenius)^[m] b
this : (⇑verschiebung ∘ ⇑frobenius)^[m] b = (⇑verschiebung)^[m] ((⇑frobenius)^[m] b)
⊢ a = ↑p ^ m * b

Next tactic:
simp_rw [← mul_left_iterate (p : 𝕎 k) m]
theorem exists_eq_pow_p_mul (a : 𝕎 k) (ha : a ≠ 0) :
    ∃ (m : ℕ) (b : 𝕎 k), b.coeff 0 ≠ 0 ∧ a = (p : 𝕎 k) ^ m * b := by
  obtain ⟨m, c, hc, hcm⟩ := WittVector.verschiebung_nonzero ha
  obtain ⟨b, rfl⟩ := (frobenius_bijective p k).surjective.iterate m c
  rw [WittVector.iterate_frobenius_coeff] at hc
  have := congr_fun (WittVector.verschiebung_frobenius_comm.comp_iterate m) b
  simp only [Function.comp_apply] at this
  rw [← this] at hcm
  refine' ⟨m, b, _, _⟩
  · contrapose! hc
    have : 0 < p ^ m := pow_pos (Nat.Prime.pos Fact.out) _
    simp [hc, zero_pow this]
  · simp_rw [← mul_left_iterate (p : 𝕎 k) m]
    

Proof state:
case intro.intro.intro.intro.refine'_2
p : ℕ
hp : Fact (Nat.Prime p)
k : Type u_1
inst✝² : CommRing k
inst✝¹ : CharP k p
inst✝ : PerfectRing k p
a : 𝕎 k
ha : a ≠ 0
m : ℕ
b : 𝕎 k
hc : coeff b 0 ^ p ^ m ≠ 0
hcm : a = (⇑verschiebung ∘ ⇑frobenius)^[m] b
this : (⇑verschiebung ∘ ⇑frobenius)^[m] b = (⇑verschiebung)^[m] ((⇑frobenius)^[m] b)
⊢ a = (fun x => ↑p * x)^[m] b

Next tactic:
convert hcm using 2
theorem exists_eq_pow_p_mul (a : 𝕎 k) (ha : a ≠ 0) :
    ∃ (m : ℕ) (b : 𝕎 k), b.coeff 0 ≠ 0 ∧ a = (p : 𝕎 k) ^ m * b := by
  obtain ⟨m, c, hc, hcm⟩ := WittVector.verschiebung_nonzero ha
  obtain ⟨b, rfl⟩ := (frobenius_bijective p k).surjective.iterate m c
  rw [WittVector.iterate_frobenius_coeff] at hc
  have := congr_fun (WittVector.verschiebung_frobenius_comm.comp_iterate m) b
  simp only [Function.comp_apply] at this
  rw [← this] at hcm
  refine' ⟨m, b, _, _⟩
  · contrapose! hc
    have : 0 < p ^ m := pow_pos (Nat.Prime.pos Fact.out) _
    simp [hc, zero_pow this]
  · simp_rw [← mul_left_iterate (p : 𝕎 k) m]
    convert hcm using 2
    

Proof state:
case h.e'_3.h.e'_2
p : ℕ
hp : Fact (Nat.Prime p)
k : Type u_1
inst✝² : CommRing k
inst✝¹ : CharP k p
inst✝ : PerfectRing k p
a : 𝕎 k
ha : a ≠ 0
m : ℕ
b : 𝕎 k
hc : coeff b 0 ^ p ^ m ≠ 0
hcm : a = (⇑verschiebung ∘ ⇑frobenius)^[m] b
this : (⇑verschiebung ∘ ⇑frobenius)^[m] b = (⇑verschiebung)^[m] ((⇑frobenius)^[m] b)
⊢ (fun x => ↑p * x) = ⇑verschiebung ∘ ⇑frobenius

Next tactic:
ext1 x
theorem exists_eq_pow_p_mul (a : 𝕎 k) (ha : a ≠ 0) :
    ∃ (m : ℕ) (b : 𝕎 k), b.coeff 0 ≠ 0 ∧ a = (p : 𝕎 k) ^ m * b := by
  obtain ⟨m, c, hc, hcm⟩ := WittVector.verschiebung_nonzero ha
  obtain ⟨b, rfl⟩ := (frobenius_bijective p k).surjective.iterate m c
  rw [WittVector.iterate_frobenius_coeff] at hc
  have := congr_fun (WittVector.verschiebung_frobenius_comm.comp_iterate m) b
  simp only [Function.comp_apply] at this
  rw [← this] at hcm
  refine' ⟨m, b, _, _⟩
  · contrapose! hc
    have : 0 < p ^ m := pow_pos (Nat.Prime.pos Fact.out) _
    simp [hc, zero_pow this]
  · simp_rw [← mul_left_iterate (p : 𝕎 k) m]
    convert hcm using 2
    ext1 x
    

Proof state:
case h.e'_3.h.e'_2.h
p : ℕ
hp : Fact (Nat.Prime p)
k : Type u_1
inst✝² : CommRing k
inst✝¹ : CharP k p
inst✝ : PerfectRing k p
a : 𝕎 k
ha : a ≠ 0
m : ℕ
b : 𝕎 k
hc : coeff b 0 ^ p ^ m ≠ 0
hcm : a = (⇑verschiebung ∘ ⇑frobenius)^[m] b
this : (⇑verschiebung ∘ ⇑frobenius)^[m] b = (⇑verschiebung)^[m] ((⇑frobenius)^[m] b)
x : 𝕎 k
⊢ ↑p * x = (⇑verschiebung ∘ ⇑frobenius) x

Next tactic:
rw [mul_comm, ← WittVector.verschiebung_frobenius x]
theorem exists_eq_pow_p_mul (a : 𝕎 k) (ha : a ≠ 0) :
    ∃ (m : ℕ) (b : 𝕎 k), b.coeff 0 ≠ 0 ∧ a = (p : 𝕎 k) ^ m * b := by
  obtain ⟨m, c, hc, hcm⟩ := WittVector.verschiebung_nonzero ha
  obtain ⟨b, rfl⟩ := (frobenius_bijective p k).surjective.iterate m c
  rw [WittVector.iterate_frobenius_coeff] at hc
  have := congr_fun (WittVector.verschiebung_frobenius_comm.comp_iterate m) b
  simp only [Function.comp_apply] at this
  rw [← this] at hcm
  refine' ⟨m, b, _, _⟩
  · contrapose! hc
    have : 0 < p ^ m := pow_pos (Nat.Prime.pos Fact.out) _
    simp [hc, zero_pow this]
  · simp_rw [← mul_left_iterate (p : 𝕎 k) m]
    convert hcm using 2
    ext1 x
    rw [mul_comm, ← WittVector.verschiebung_frobenius x]; 

Proof state:
case h.e'_3.h.e'_2.h
p : ℕ
hp : Fact (Nat.Prime p)
k : Type u_1
inst✝² : CommRing k
inst✝¹ : CharP k p
inst✝ : PerfectRing k p
a : 𝕎 k
ha : a ≠ 0
m : ℕ
b : 𝕎 k
hc : coeff b 0 ^ p ^ m ≠ 0
hcm : a = (⇑verschiebung ∘ ⇑frobenius)^[m] b
this : (⇑verschiebung ∘ ⇑frobenius)^[m] b = (⇑verschiebung)^[m] ((⇑frobenius)^[m] b)
x : 𝕎 k
⊢ verschiebung (frobenius x) = (⇑verschiebung ∘ ⇑frobenius) x

Next tactic:
rfl
theorem exists_eq_pow_p_mul' (a : 𝕎 k) (ha : a ≠ 0) :
    ∃ (m : ℕ) (b : Units (𝕎 k)), a = (p : 𝕎 k) ^ m * b := by
  

Proof state:
p : ℕ
hp : Fact (Nat.Prime p)
k : Type u_1
inst✝² : Field k
inst✝¹ : CharP k p
inst✝ : PerfectRing k p
a : 𝕎 k
ha : a ≠ 0
⊢ ∃ m b, a = ↑p ^ m * ↑b

Next tactic:
obtain ⟨m, b, h₁, h₂⟩ := exists_eq_pow_p_mul a ha
theorem exists_eq_pow_p_mul' (a : 𝕎 k) (ha : a ≠ 0) :
    ∃ (m : ℕ) (b : Units (𝕎 k)), a = (p : 𝕎 k) ^ m * b := by
  obtain ⟨m, b, h₁, h₂⟩ := exists_eq_pow_p_mul a ha
  

Proof state:
case intro.intro.intro
p : ℕ
hp : Fact (Nat.Prime p)
k : Type u_1
inst✝² : Field k
inst✝¹ : CharP k p
inst✝ : PerfectRing k p
a : 𝕎 k
ha : a ≠ 0
m : ℕ
b : 𝕎 k
h₁ : coeff b 0 ≠ 0
h₂ : a = ↑p ^ m * b
⊢ ∃ m b, a = ↑p ^ m * ↑b

Next tactic:
let b₀ := Units.mk0 (b.coeff 0) h₁
theorem exists_eq_pow_p_mul' (a : 𝕎 k) (ha : a ≠ 0) :
    ∃ (m : ℕ) (b : Units (𝕎 k)), a = (p : 𝕎 k) ^ m * b := by
  obtain ⟨m, b, h₁, h₂⟩ := exists_eq_pow_p_mul a ha
  let b₀ := Units.mk0 (b.coeff 0) h₁
  

Proof state:
case intro.intro.intro
p : ℕ
hp : Fact (Nat.Prime p)
k : Type u_1
inst✝² : Field k
inst✝¹ : CharP k p
inst✝ : PerfectRing k p
a : 𝕎 k
ha : a ≠ 0
m : ℕ
b : 𝕎 k
h₁ : coeff b 0 ≠ 0
h₂ : a = ↑p ^ m * b
b₀ : kˣ := Units.mk0 (coeff b 0) h₁
⊢ ∃ m b, a = ↑p ^ m * ↑b

Next tactic:
have hb₀ : b.coeff 0 = b₀ := rfl
theorem exists_eq_pow_p_mul' (a : 𝕎 k) (ha : a ≠ 0) :
    ∃ (m : ℕ) (b : Units (𝕎 k)), a = (p : 𝕎 k) ^ m * b := by
  obtain ⟨m, b, h₁, h₂⟩ := exists_eq_pow_p_mul a ha
  let b₀ := Units.mk0 (b.coeff 0) h₁
  have hb₀ : b.coeff 0 = b₀ := rfl
  

Proof state:
case intro.intro.intro
p : ℕ
hp : Fact (Nat.Prime p)
k : Type u_1
inst✝² : Field k
inst✝¹ : CharP k p
inst✝ : PerfectRing k p
a : 𝕎 k
ha : a ≠ 0
m : ℕ
b : 𝕎 k
h₁ : coeff b 0 ≠ 0
h₂ : a = ↑p ^ m * b
b₀ : kˣ := Units.mk0 (coeff b 0) h₁
hb₀ : coeff b 0 = ↑b₀
⊢ ∃ m b, a = ↑p ^ m * ↑b

Next tactic:
exact ⟨m, mkUnit hb₀, h₂⟩
/-- The ring of Witt Vectors of a perfect field of positive characteristic is a DVR.
-/
theorem discreteValuationRing : DiscreteValuationRing (𝕎 k) :=
  DiscreteValuationRing.ofHasUnitMulPowIrreducibleFactorization (by
    

Proof state:
p : ℕ
hp : Fact (Nat.Prime p)
k : Type u_1
inst✝² : Field k
inst✝¹ : CharP k p
inst✝ : PerfectRing k p
⊢ DiscreteValuationRing.HasUnitMulPowIrreducibleFactorization (𝕎 k)

Next tactic:
refine' ⟨p, irreducible p, fun {x} hx => _⟩
/-- The ring of Witt Vectors of a perfect field of positive characteristic is a DVR.
-/
theorem discreteValuationRing : DiscreteValuationRing (𝕎 k) :=
  DiscreteValuationRing.ofHasUnitMulPowIrreducibleFactorization (by
    refine' ⟨p, irreducible p, fun {x} hx => _⟩
    

Proof state:
p : ℕ
hp : Fact (Nat.Prime p)
k : Type u_1
inst✝² : Field k
inst✝¹ : CharP k p
inst✝ : PerfectRing k p
x : 𝕎 k
hx : x ≠ 0
⊢ ∃ n, Associated (↑p ^ n) x

Next tactic:
obtain ⟨n, b, hb⟩ := exists_eq_pow_p_mul' x hx
/-- The ring of Witt Vectors of a perfect field of positive characteristic is a DVR.
-/
theorem discreteValuationRing : DiscreteValuationRing (𝕎 k) :=
  DiscreteValuationRing.ofHasUnitMulPowIrreducibleFactorization (by
    refine' ⟨p, irreducible p, fun {x} hx => _⟩
    obtain ⟨n, b, hb⟩ := exists_eq_pow_p_mul' x hx
    

Proof state:
case intro.intro
p : ℕ
hp : Fact (Nat.Prime p)
k : Type u_1
inst✝² : Field k
inst✝¹ : CharP k p
inst✝ : PerfectRing k p
x : 𝕎 k
hx : x ≠ 0
n : ℕ
b : (𝕎 k)ˣ
hb : x = ↑p ^ n * ↑b
⊢ ∃ n, Associated (↑p ^ n) x

Next tactic:
exact ⟨n, b, hb.symm⟩
@[simp]
theorem coe_smul (r : ℝ≥0) : (r : ℝ) • j = r • j := by
  -- Porting note: replaced `show`
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : MeasurableSpace α
j : JordanDecomposition α
r : ℝ≥0
⊢ ↑r • j = r • j

Next tactic:
rw [real_smul_def, if_pos (NNReal.coe_nonneg r), Real.toNNReal_coe]
theorem real_smul_posPart_nonneg (r : ℝ) (hr : 0 ≤ r) :
    (r • j).posPart = r.toNNReal • j.posPart := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : MeasurableSpace α
j : JordanDecomposition α
r : ℝ
hr : 0 ≤ r
⊢ (r • j).posPart = Real.toNNReal r • j.posPart

Next tactic:
rw [real_smul_def, ← smul_posPart, if_pos hr]
theorem real_smul_negPart_nonneg (r : ℝ) (hr : 0 ≤ r) :
    (r • j).negPart = r.toNNReal • j.negPart := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : MeasurableSpace α
j : JordanDecomposition α
r : ℝ
hr : 0 ≤ r
⊢ (r • j).negPart = Real.toNNReal r • j.negPart

Next tactic:
rw [real_smul_def, ← smul_negPart, if_pos hr]
theorem real_smul_posPart_neg (r : ℝ) (hr : r < 0) :
    (r • j).posPart = (-r).toNNReal • j.negPart := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : MeasurableSpace α
j : JordanDecomposition α
r : ℝ
hr : r < 0
⊢ (r • j).posPart = Real.toNNReal (-r) • j.negPart

Next tactic:
rw [real_smul_def, ← smul_negPart, if_neg (not_le.2 hr), neg_posPart]
theorem real_smul_negPart_neg (r : ℝ) (hr : r < 0) :
    (r • j).negPart = (-r).toNNReal • j.posPart := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : MeasurableSpace α
j : JordanDecomposition α
r : ℝ
hr : r < 0
⊢ (r • j).negPart = Real.toNNReal (-r) • j.posPart

Next tactic:
rw [real_smul_def, ← smul_posPart, if_neg (not_le.2 hr), neg_negPart]
theorem toSignedMeasure_zero : (0 : JordanDecomposition α).toSignedMeasure = 0 := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : MeasurableSpace α
j : JordanDecomposition α
⊢ toSignedMeasure 0 = 0

Next tactic:
ext1 i hi
theorem toSignedMeasure_zero : (0 : JordanDecomposition α).toSignedMeasure = 0 := by
  ext1 i hi
  -- Porting note: replaced `erw` by adding further lemmas
  

Proof state:
case h
α : Type u_1
β : Type u_2
inst✝ : MeasurableSpace α
j : JordanDecomposition α
i : Set α
hi : MeasurableSet i
⊢ ↑(toSignedMeasure 0) i = ↑0 i

Next tactic:
rw [toSignedMeasure, toSignedMeasure_sub_apply hi, zero_posPart, zero_negPart, sub_self,
    VectorMeasure.coe_zero, Pi.zero_apply]
theorem toSignedMeasure_neg : (-j).toSignedMeasure = -j.toSignedMeasure := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : MeasurableSpace α
j : JordanDecomposition α
⊢ toSignedMeasure (-j) = -toSignedMeasure j

Next tactic:
ext1 i hi
theorem toSignedMeasure_neg : (-j).toSignedMeasure = -j.toSignedMeasure := by
  ext1 i hi
  -- Porting note: removed `rfl` after the `rw` by adding further steps.
  

Proof state:
case h
α : Type u_1
β : Type u_2
inst✝ : MeasurableSpace α
j : JordanDecomposition α
i : Set α
hi : MeasurableSet i
⊢ ↑(toSignedMeasure (-j)) i = ↑(-toSignedMeasure j) i

Next tactic:
rw [neg_apply, toSignedMeasure, toSignedMeasure, toSignedMeasure_sub_apply hi,
    toSignedMeasure_sub_apply hi, neg_sub, neg_posPart, neg_negPart]
theorem toSignedMeasure_smul (r : ℝ≥0) : (r • j).toSignedMeasure = r • j.toSignedMeasure := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : MeasurableSpace α
j : JordanDecomposition α
r : ℝ≥0
⊢ toSignedMeasure (r • j) = r • toSignedMeasure j

Next tactic:
ext1 i hi
theorem toSignedMeasure_smul (r : ℝ≥0) : (r • j).toSignedMeasure = r • j.toSignedMeasure := by
  ext1 i hi
  -- Porting note: removed `rfl` after the `rw` by adding further steps.
  

Proof state:
case h
α : Type u_1
β : Type u_2
inst✝ : MeasurableSpace α
j : JordanDecomposition α
r : ℝ≥0
i : Set α
hi : MeasurableSet i
⊢ ↑(toSignedMeasure (r • j)) i = ↑(r • toSignedMeasure j) i

Next tactic:
rw [VectorMeasure.smul_apply, toSignedMeasure, toSignedMeasure,
    toSignedMeasure_sub_apply hi, toSignedMeasure_sub_apply hi, smul_sub, smul_posPart,
    smul_negPart, ← ENNReal.toReal_smul, ← ENNReal.toReal_smul, smul_toOuterMeasure,
    OuterMeasure.coe_smul, Pi.smul_apply, smul_toOuterMeasure, OuterMeasure.coe_smul, Pi.smul_apply]
/-- A Jordan decomposition provides a Hahn decomposition. -/
theorem exists_compl_positive_negative :
    ∃ S : Set α,
      MeasurableSet S ∧
        j.toSignedMeasure ≤[S] 0 ∧
          0 ≤[Sᶜ] j.toSignedMeasure ∧ j.posPart S = 0 ∧ j.negPart Sᶜ = 0 := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : MeasurableSpace α
j : JordanDecomposition α
⊢ ∃ S,
    MeasurableSet S ∧
      VectorMeasure.restrict (toSignedMeasure j) S ≤ VectorMeasure.restrict 0 S ∧
        VectorMeasure.restrict 0 Sᶜ ≤ VectorMeasure.restrict (toSignedMeasure j) Sᶜ ∧
          ↑↑j.posPart S = 0 ∧ ↑↑j.negPart Sᶜ = 0

Next tactic:
obtain ⟨S, hS₁, hS₂, hS₃⟩ := j.mutuallySingular
/-- A Jordan decomposition provides a Hahn decomposition. -/
theorem exists_compl_positive_negative :
    ∃ S : Set α,
      MeasurableSet S ∧
        j.toSignedMeasure ≤[S] 0 ∧
          0 ≤[Sᶜ] j.toSignedMeasure ∧ j.posPart S = 0 ∧ j.negPart Sᶜ = 0 := by
  obtain ⟨S, hS₁, hS₂, hS₃⟩ := j.mutuallySingular
  

Proof state:
case intro.intro.intro
α : Type u_1
β : Type u_2
inst✝ : MeasurableSpace α
j : JordanDecomposition α
S : Set α
hS₁ : MeasurableSet S
hS₂ : ↑↑j.posPart S = 0
hS₃ : ↑↑j.negPart Sᶜ = 0
⊢ ∃ S,
    MeasurableSet S ∧
      VectorMeasure.restrict (toSignedMeasure j) S ≤ VectorMeasure.restrict 0 S ∧
        VectorMeasure.restrict 0 Sᶜ ≤ VectorMeasure.restrict (toSignedMeasure j) Sᶜ ∧
          ↑↑j.posPart S = 0 ∧ ↑↑j.negPart Sᶜ = 0

Next tactic:
refine' ⟨S, hS₁, _, _, hS₂, hS₃⟩
/-- A Jordan decomposition provides a Hahn decomposition. -/
theorem exists_compl_positive_negative :
    ∃ S : Set α,
      MeasurableSet S ∧
        j.toSignedMeasure ≤[S] 0 ∧
          0 ≤[Sᶜ] j.toSignedMeasure ∧ j.posPart S = 0 ∧ j.negPart Sᶜ = 0 := by
  obtain ⟨S, hS₁, hS₂, hS₃⟩ := j.mutuallySingular
  refine' ⟨S, hS₁, _, _, hS₂, hS₃⟩
  · 

Proof state:
case intro.intro.intro.refine'_1
α : Type u_1
β : Type u_2
inst✝ : MeasurableSpace α
j : JordanDecomposition α
S : Set α
hS₁ : MeasurableSet S
hS₂ : ↑↑j.posPart S = 0
hS₃ : ↑↑j.negPart Sᶜ = 0
⊢ VectorMeasure.restrict (toSignedMeasure j) S ≤ VectorMeasure.restrict 0 S

Next tactic:
refine' restrict_le_restrict_of_subset_le _ _ fun A hA hA₁ => _
/-- A Jordan decomposition provides a Hahn decomposition. -/
theorem exists_compl_positive_negative :
    ∃ S : Set α,
      MeasurableSet S ∧
        j.toSignedMeasure ≤[S] 0 ∧
          0 ≤[Sᶜ] j.toSignedMeasure ∧ j.posPart S = 0 ∧ j.negPart Sᶜ = 0 := by
  obtain ⟨S, hS₁, hS₂, hS₃⟩ := j.mutuallySingular
  refine' ⟨S, hS₁, _, _, hS₂, hS₃⟩
  · refine' restrict_le_restrict_of_subset_le _ _ fun A hA hA₁ => _
    

Proof state:
case intro.intro.intro.refine'_1
α : Type u_1
β : Type u_2
inst✝ : MeasurableSpace α
j : JordanDecomposition α
S : Set α
hS₁ : MeasurableSet S
hS₂ : ↑↑j.posPart S = 0
hS₃ : ↑↑j.negPart Sᶜ = 0
A : Set α
hA : MeasurableSet A
hA₁ : A ⊆ S
⊢ ↑(toSignedMeasure j) A ≤ ↑0 A

Next tactic:
rw [toSignedMeasure, toSignedMeasure_sub_apply hA,
      show j.posPart A = 0 from nonpos_iff_eq_zero.1 (hS₂ ▸ measure_mono hA₁), ENNReal.zero_toReal,
      zero_sub, neg_le, zero_apply, neg_zero]
/-- A Jordan decomposition provides a Hahn decomposition. -/
theorem exists_compl_positive_negative :
    ∃ S : Set α,
      MeasurableSet S ∧
        j.toSignedMeasure ≤[S] 0 ∧
          0 ≤[Sᶜ] j.toSignedMeasure ∧ j.posPart S = 0 ∧ j.negPart Sᶜ = 0 := by
  obtain ⟨S, hS₁, hS₂, hS₃⟩ := j.mutuallySingular
  refine' ⟨S, hS₁, _, _, hS₂, hS₃⟩
  · refine' restrict_le_restrict_of_subset_le _ _ fun A hA hA₁ => _
    rw [toSignedMeasure, toSignedMeasure_sub_apply hA,
      show j.posPart A = 0 from nonpos_iff_eq_zero.1 (hS₂ ▸ measure_mono hA₁), ENNReal.zero_toReal,
      zero_sub, neg_le, zero_apply, neg_zero]
    

Proof state:
case intro.intro.intro.refine'_1
α : Type u_1
β : Type u_2
inst✝ : MeasurableSpace α
j : JordanDecomposition α
S : Set α
hS₁ : MeasurableSet S
hS₂ : ↑↑j.posPart S = 0
hS₃ : ↑↑j.negPart Sᶜ = 0
A : Set α
hA : MeasurableSet A
hA₁ : A ⊆ S
⊢ 0 ≤ ENNReal.toReal (↑↑j.negPart A)

Next tactic:
exact ENNReal.toReal_nonneg
/-- A Jordan decomposition provides a Hahn decomposition. -/
theorem exists_compl_positive_negative :
    ∃ S : Set α,
      MeasurableSet S ∧
        j.toSignedMeasure ≤[S] 0 ∧
          0 ≤[Sᶜ] j.toSignedMeasure ∧ j.posPart S = 0 ∧ j.negPart Sᶜ = 0 := by
  obtain ⟨S, hS₁, hS₂, hS₃⟩ := j.mutuallySingular
  refine' ⟨S, hS₁, _, _, hS₂, hS₃⟩
  · refine' restrict_le_restrict_of_subset_le _ _ fun A hA hA₁ => _
    rw [toSignedMeasure, toSignedMeasure_sub_apply hA,
      show j.posPart A = 0 from nonpos_iff_eq_zero.1 (hS₂ ▸ measure_mono hA₁), ENNReal.zero_toReal,
      zero_sub, neg_le, zero_apply, neg_zero]
    exact ENNReal.toReal_nonneg
  · 

Proof state:
case intro.intro.intro.refine'_2
α : Type u_1
β : Type u_2
inst✝ : MeasurableSpace α
j : JordanDecomposition α
S : Set α
hS₁ : MeasurableSet S
hS₂ : ↑↑j.posPart S = 0
hS₃ : ↑↑j.negPart Sᶜ = 0
⊢ VectorMeasure.restrict 0 Sᶜ ≤ VectorMeasure.restrict (toSignedMeasure j) Sᶜ

Next tactic:
refine' restrict_le_restrict_of_subset_le _ _ fun A hA hA₁ => _
/-- A Jordan decomposition provides a Hahn decomposition. -/
theorem exists_compl_positive_negative :
    ∃ S : Set α,
      MeasurableSet S ∧
        j.toSignedMeasure ≤[S] 0 ∧
          0 ≤[Sᶜ] j.toSignedMeasure ∧ j.posPart S = 0 ∧ j.negPart Sᶜ = 0 := by
  obtain ⟨S, hS₁, hS₂, hS₃⟩ := j.mutuallySingular
  refine' ⟨S, hS₁, _, _, hS₂, hS₃⟩
  · refine' restrict_le_restrict_of_subset_le _ _ fun A hA hA₁ => _
    rw [toSignedMeasure, toSignedMeasure_sub_apply hA,
      show j.posPart A = 0 from nonpos_iff_eq_zero.1 (hS₂ ▸ measure_mono hA₁), ENNReal.zero_toReal,
      zero_sub, neg_le, zero_apply, neg_zero]
    exact ENNReal.toReal_nonneg
  · refine' restrict_le_restrict_of_subset_le _ _ fun A hA hA₁ => _
    

Proof state:
case intro.intro.intro.refine'_2
α : Type u_1
β : Type u_2
inst✝ : MeasurableSpace α
j : JordanDecomposition α
S : Set α
hS₁ : MeasurableSet S
hS₂ : ↑↑j.posPart S = 0
hS₃ : ↑↑j.negPart Sᶜ = 0
A : Set α
hA : MeasurableSet A
hA₁ : A ⊆ Sᶜ
⊢ ↑0 A ≤ ↑(toSignedMeasure j) A

Next tactic:
rw [toSignedMeasure, toSignedMeasure_sub_apply hA,
      show j.negPart A = 0 from nonpos_iff_eq_zero.1 (hS₃ ▸ measure_mono hA₁), ENNReal.zero_toReal,
      sub_zero]
/-- A Jordan decomposition provides a Hahn decomposition. -/
theorem exists_compl_positive_negative :
    ∃ S : Set α,
      MeasurableSet S ∧
        j.toSignedMeasure ≤[S] 0 ∧
          0 ≤[Sᶜ] j.toSignedMeasure ∧ j.posPart S = 0 ∧ j.negPart Sᶜ = 0 := by
  obtain ⟨S, hS₁, hS₂, hS₃⟩ := j.mutuallySingular
  refine' ⟨S, hS₁, _, _, hS₂, hS₃⟩
  · refine' restrict_le_restrict_of_subset_le _ _ fun A hA hA₁ => _
    rw [toSignedMeasure, toSignedMeasure_sub_apply hA,
      show j.posPart A = 0 from nonpos_iff_eq_zero.1 (hS₂ ▸ measure_mono hA₁), ENNReal.zero_toReal,
      zero_sub, neg_le, zero_apply, neg_zero]
    exact ENNReal.toReal_nonneg
  · refine' restrict_le_restrict_of_subset_le _ _ fun A hA hA₁ => _
    rw [toSignedMeasure, toSignedMeasure_sub_apply hA,
      show j.negPart A = 0 from nonpos_iff_eq_zero.1 (hS₃ ▸ measure_mono hA₁), ENNReal.zero_toReal,
      sub_zero]
    

Proof state:
case intro.intro.intro.refine'_2
α : Type u_1
β : Type u_2
inst✝ : MeasurableSpace α
j : JordanDecomposition α
S : Set α
hS₁ : MeasurableSet S
hS₂ : ↑↑j.posPart S = 0
hS₃ : ↑↑j.negPart Sᶜ = 0
A : Set α
hA : MeasurableSet A
hA₁ : A ⊆ Sᶜ
⊢ ↑0 A ≤ ENNReal.toReal (↑↑j.posPart A)

Next tactic:
exact ENNReal.toReal_nonneg
theorem toJordanDecomposition_spec (s : SignedMeasure α) :
    ∃ (i : Set α) (hi₁ : MeasurableSet i) (hi₂ : 0 ≤[i] s) (hi₃ : s ≤[iᶜ] 0),
      s.toJordanDecomposition.posPart = s.toMeasureOfZeroLE i hi₁ hi₂ ∧
        s.toJordanDecomposition.negPart = s.toMeasureOfLEZero iᶜ hi₁.compl hi₃ := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝² : MeasurableSpace α
s✝ : SignedMeasure α
μ ν : Measure α
inst✝¹ : IsFiniteMeasure μ
inst✝ : IsFiniteMeasure ν
s : SignedMeasure α
⊢ ∃ i,
    ∃ (hi₁ : MeasurableSet i) (hi₂ : VectorMeasure.restrict 0 i ≤ VectorMeasure.restrict s i) (hi₃ :
      VectorMeasure.restrict s iᶜ ≤ VectorMeasure.restrict 0 iᶜ),
      (toJordanDecomposition s).posPart = toMeasureOfZeroLE s i hi₁ hi₂ ∧
        (toJordanDecomposition s).negPart = toMeasureOfLEZero s iᶜ (_ : MeasurableSet iᶜ) hi₃

Next tactic:
set i := choose s.exists_compl_positive_negative
theorem toJordanDecomposition_spec (s : SignedMeasure α) :
    ∃ (i : Set α) (hi₁ : MeasurableSet i) (hi₂ : 0 ≤[i] s) (hi₃ : s ≤[iᶜ] 0),
      s.toJordanDecomposition.posPart = s.toMeasureOfZeroLE i hi₁ hi₂ ∧
        s.toJordanDecomposition.negPart = s.toMeasureOfLEZero iᶜ hi₁.compl hi₃ := by
  set i := choose s.exists_compl_positive_negative
  

Proof state:
α : Type u_1
β : Type u_2
inst✝² : MeasurableSpace α
s✝ : SignedMeasure α
μ ν : Measure α
inst✝¹ : IsFiniteMeasure μ
inst✝ : IsFiniteMeasure ν
s : SignedMeasure α
i : Set α :=
  choose
    (_ :
      ∃ i,
        MeasurableSet i ∧
          VectorMeasure.restrict 0 i ≤ VectorMeasure.restrict s i ∧
            VectorMeasure.restrict s iᶜ ≤ VectorMeasure.restrict 0 iᶜ)
⊢ ∃ i,
    ∃ (hi₁ : MeasurableSet i) (hi₂ : VectorMeasure.restrict 0 i ≤ VectorMeasure.restrict s i) (hi₃ :
      VectorMeasure.restrict s iᶜ ≤ VectorMeasure.restrict 0 iᶜ),
      (toJordanDecomposition s).posPart = toMeasureOfZeroLE s i hi₁ hi₂ ∧
        (toJordanDecomposition s).negPart = toMeasureOfLEZero s iᶜ (_ : MeasurableSet iᶜ) hi₃

Next tactic:
obtain ⟨hi₁, hi₂, hi₃⟩ := choose_spec s.exists_compl_positive_negative