l3lab/ntp-mathlib huggingface dataset:
/-- The Jordan decomposition of a signed measure is unique. -/
theorem toSignedMeasure_injective : Injective <| @JordanDecomposition.toSignedMeasure α _ := by
  /- The main idea is that two Jordan decompositions of a signed measure provide two
    Hahn decompositions for that measure. Then, from `of_symmDiff_compl_positive_negative`,
    the symmetric difference of the two Hahn decompositions has measure zero, thus, allowing us to
    show the equality of the underlying measures of the Jordan decompositions. -/
  intro j₁ j₂ hj
  -- obtain the two Hahn decompositions from the Jordan decompositions
  obtain ⟨S, hS₁, hS₂, hS₃, hS₄, hS₅⟩ := j₁.exists_compl_positive_negative
  obtain ⟨T, hT₁, hT₂, hT₃, hT₄, hT₅⟩ := j₂.exists_compl_positive_negative
  rw [← hj] at hT₂ hT₃
  -- the symmetric differences of the two Hahn decompositions have measure zero
  obtain ⟨hST₁, -⟩ :=
    of_symmDiff_compl_positive_negative hS₁.compl hT₁.compl ⟨hS₃, (compl_compl S).symm ▸ hS₂⟩
      ⟨hT₃, (compl_compl T).symm ▸ hT₂⟩
  -- it suffices to show the Jordan decompositions have the same positive parts
  refine' eq_of_posPart_eq_posPart _ hj
  

Proof state:
case intro.intro.intro.intro.intro.intro.intro.intro.intro.intro.intro
α : Type u_1
β : Type u_2
inst✝ : MeasurableSpace α
j₁ j₂ : JordanDecomposition α
hj : toSignedMeasure j₁ = toSignedMeasure j₂
S : Set α
hS₁ : MeasurableSet S
hS₂ : VectorMeasure.restrict (toSignedMeasure j₁) S ≤ VectorMeasure.restrict 0 S
hS₃ : VectorMeasure.restrict 0 Sᶜ ≤ VectorMeasure.restrict (toSignedMeasure j₁) Sᶜ
hS₄ : ↑↑j₁.posPart S = 0
hS₅ : ↑↑j₁.negPart Sᶜ = 0
T : Set α
hT₁ : MeasurableSet T
hT₂ : VectorMeasure.restrict (toSignedMeasure j₁) T ≤ VectorMeasure.restrict 0 T
hT₃ : VectorMeasure.restrict 0 Tᶜ ≤ VectorMeasure.restrict (toSignedMeasure j₁) Tᶜ
hT₄ : ↑↑j₂.posPart T = 0
hT₅ : ↑↑j₂.negPart Tᶜ = 0
hST₁ : ↑(toSignedMeasure j₁) (Sᶜ ∆ Tᶜ) = 0
⊢ j₁.posPart = j₂.posPart

Next tactic:
ext1 i hi
/-- The Jordan decomposition of a signed measure is unique. -/
theorem toSignedMeasure_injective : Injective <| @JordanDecomposition.toSignedMeasure α _ := by
  /- The main idea is that two Jordan decompositions of a signed measure provide two
    Hahn decompositions for that measure. Then, from `of_symmDiff_compl_positive_negative`,
    the symmetric difference of the two Hahn decompositions has measure zero, thus, allowing us to
    show the equality of the underlying measures of the Jordan decompositions. -/
  intro j₁ j₂ hj
  -- obtain the two Hahn decompositions from the Jordan decompositions
  obtain ⟨S, hS₁, hS₂, hS₃, hS₄, hS₅⟩ := j₁.exists_compl_positive_negative
  obtain ⟨T, hT₁, hT₂, hT₃, hT₄, hT₅⟩ := j₂.exists_compl_positive_negative
  rw [← hj] at hT₂ hT₃
  -- the symmetric differences of the two Hahn decompositions have measure zero
  obtain ⟨hST₁, -⟩ :=
    of_symmDiff_compl_positive_negative hS₁.compl hT₁.compl ⟨hS₃, (compl_compl S).symm ▸ hS₂⟩
      ⟨hT₃, (compl_compl T).symm ▸ hT₂⟩
  -- it suffices to show the Jordan decompositions have the same positive parts
  refine' eq_of_posPart_eq_posPart _ hj
  ext1 i hi
  -- we see that the positive parts of the two Jordan decompositions are equal to their
  -- associated signed measures restricted on their associated Hahn decompositions
  

Proof state:
case intro.intro.intro.intro.intro.intro.intro.intro.intro.intro.intro.h
α : Type u_1
β : Type u_2
inst✝ : MeasurableSpace α
j₁ j₂ : JordanDecomposition α
hj : toSignedMeasure j₁ = toSignedMeasure j₂
S : Set α
hS₁ : MeasurableSet S
hS₂ : VectorMeasure.restrict (toSignedMeasure j₁) S ≤ VectorMeasure.restrict 0 S
hS₃ : VectorMeasure.restrict 0 Sᶜ ≤ VectorMeasure.restrict (toSignedMeasure j₁) Sᶜ
hS₄ : ↑↑j₁.posPart S = 0
hS₅ : ↑↑j₁.negPart Sᶜ = 0
T : Set α
hT₁ : MeasurableSet T
hT₂ : VectorMeasure.restrict (toSignedMeasure j₁) T ≤ VectorMeasure.restrict 0 T
hT₃ : VectorMeasure.restrict 0 Tᶜ ≤ VectorMeasure.restrict (toSignedMeasure j₁) Tᶜ
hT₄ : ↑↑j₂.posPart T = 0
hT₅ : ↑↑j₂.negPart Tᶜ = 0
hST₁ : ↑(toSignedMeasure j₁) (Sᶜ ∆ Tᶜ) = 0
i : Set α
hi : MeasurableSet i
⊢ ↑↑j₁.posPart i = ↑↑j₂.posPart i

Next tactic:
have hμ₁ : (j₁.posPart i).toReal = j₁.toSignedMeasure (i ∩ Sᶜ) := by
    rw [toSignedMeasure, toSignedMeasure_sub_apply (hi.inter hS₁.compl),
      show j₁.negPart (i ∩ Sᶜ) = 0 from
        nonpos_iff_eq_zero.1 (hS₅ ▸ measure_mono (Set.inter_subset_right _ _)),
      ENNReal.zero_toReal, sub_zero]
    conv_lhs => rw [← Set.inter_union_compl i S]
    rw [measure_union,
      show j₁.posPart (i ∩ S) = 0 from
        nonpos_iff_eq_zero.1 (hS₄ ▸ measure_mono (Set.inter_subset_right _ _)),
      zero_add]
    · refine'
        Set.disjoint_of_subset_left (Set.inter_subset_right _ _)
          (Set.disjoint_of_subset_right (Set.inter_subset_right _ _) disjoint_compl_right)
    · exact hi.inter hS₁.compl
/-- The Jordan decomposition of a signed measure is unique. -/
theorem toSignedMeasure_injective : Injective <| @JordanDecomposition.toSignedMeasure α _ := by
  /- The main idea is that two Jordan decompositions of a signed measure provide two
    Hahn decompositions for that measure. Then, from `of_symmDiff_compl_positive_negative`,
    the symmetric difference of the two Hahn decompositions has measure zero, thus, allowing us to
    show the equality of the underlying measures of the Jordan decompositions. -/
  intro j₁ j₂ hj
  -- obtain the two Hahn decompositions from the Jordan decompositions
  obtain ⟨S, hS₁, hS₂, hS₃, hS₄, hS₅⟩ := j₁.exists_compl_positive_negative
  obtain ⟨T, hT₁, hT₂, hT₃, hT₄, hT₅⟩ := j₂.exists_compl_positive_negative
  rw [← hj] at hT₂ hT₃
  -- the symmetric differences of the two Hahn decompositions have measure zero
  obtain ⟨hST₁, -⟩ :=
    of_symmDiff_compl_positive_negative hS₁.compl hT₁.compl ⟨hS₃, (compl_compl S).symm ▸ hS₂⟩
      ⟨hT₃, (compl_compl T).symm ▸ hT₂⟩
  -- it suffices to show the Jordan decompositions have the same positive parts
  refine' eq_of_posPart_eq_posPart _ hj
  ext1 i hi
  -- we see that the positive parts of the two Jordan decompositions are equal to their
  -- associated signed measures restricted on their associated Hahn decompositions
  have hμ₁ : (j₁.posPart i).toReal = j₁.toSignedMeasure (i ∩ Sᶜ) := by
    

Proof state:
α : Type u_1
β : Type u_2
inst✝ : MeasurableSpace α
j₁ j₂ : JordanDecomposition α
hj : toSignedMeasure j₁ = toSignedMeasure j₂
S : Set α
hS₁ : MeasurableSet S
hS₂ : VectorMeasure.restrict (toSignedMeasure j₁) S ≤ VectorMeasure.restrict 0 S
hS₃ : VectorMeasure.restrict 0 Sᶜ ≤ VectorMeasure.restrict (toSignedMeasure j₁) Sᶜ
hS₄ : ↑↑j₁.posPart S = 0
hS₅ : ↑↑j₁.negPart Sᶜ = 0
T : Set α
hT₁ : MeasurableSet T
hT₂ : VectorMeasure.restrict (toSignedMeasure j₁) T ≤ VectorMeasure.restrict 0 T
hT₃ : VectorMeasure.restrict 0 Tᶜ ≤ VectorMeasure.restrict (toSignedMeasure j₁) Tᶜ
hT₄ : ↑↑j₂.posPart T = 0
hT₅ : ↑↑j₂.negPart Tᶜ = 0
hST₁ : ↑(toSignedMeasure j₁) (Sᶜ ∆ Tᶜ) = 0
i : Set α
hi : MeasurableSet i
⊢ ENNReal.toReal (↑↑j₁.posPart i) = ↑(toSignedMeasure j₁) (i ∩ Sᶜ)

Next tactic:
rw [toSignedMeasure, toSignedMeasure_sub_apply (hi.inter hS₁.compl),
      show j₁.negPart (i ∩ Sᶜ) = 0 from
        nonpos_iff_eq_zero.1 (hS₅ ▸ measure_mono (Set.inter_subset_right _ _)),
      ENNReal.zero_toReal, sub_zero]
/-- The Jordan decomposition of a signed measure is unique. -/
theorem toSignedMeasure_injective : Injective <| @JordanDecomposition.toSignedMeasure α _ := by
  /- The main idea is that two Jordan decompositions of a signed measure provide two
    Hahn decompositions for that measure. Then, from `of_symmDiff_compl_positive_negative`,
    the symmetric difference of the two Hahn decompositions has measure zero, thus, allowing us to
    show the equality of the underlying measures of the Jordan decompositions. -/
  intro j₁ j₂ hj
  -- obtain the two Hahn decompositions from the Jordan decompositions
  obtain ⟨S, hS₁, hS₂, hS₃, hS₄, hS₅⟩ := j₁.exists_compl_positive_negative
  obtain ⟨T, hT₁, hT₂, hT₃, hT₄, hT₅⟩ := j₂.exists_compl_positive_negative
  rw [← hj] at hT₂ hT₃
  -- the symmetric differences of the two Hahn decompositions have measure zero
  obtain ⟨hST₁, -⟩ :=
    of_symmDiff_compl_positive_negative hS₁.compl hT₁.compl ⟨hS₃, (compl_compl S).symm ▸ hS₂⟩
      ⟨hT₃, (compl_compl T).symm ▸ hT₂⟩
  -- it suffices to show the Jordan decompositions have the same positive parts
  refine' eq_of_posPart_eq_posPart _ hj
  ext1 i hi
  -- we see that the positive parts of the two Jordan decompositions are equal to their
  -- associated signed measures restricted on their associated Hahn decompositions
  have hμ₁ : (j₁.posPart i).toReal = j₁.toSignedMeasure (i ∩ Sᶜ) := by
    rw [toSignedMeasure, toSignedMeasure_sub_apply (hi.inter hS₁.compl),
      show j₁.negPart (i ∩ Sᶜ) = 0 from
        nonpos_iff_eq_zero.1 (hS₅ ▸ measure_mono (Set.inter_subset_right _ _)),
      ENNReal.zero_toReal, sub_zero]
    

Proof state:
α : Type u_1
β : Type u_2
inst✝ : MeasurableSpace α
j₁ j₂ : JordanDecomposition α
hj : toSignedMeasure j₁ = toSignedMeasure j₂
S : Set α
hS₁ : MeasurableSet S
hS₂ : VectorMeasure.restrict (toSignedMeasure j₁) S ≤ VectorMeasure.restrict 0 S
hS₃ : VectorMeasure.restrict 0 Sᶜ ≤ VectorMeasure.restrict (toSignedMeasure j₁) Sᶜ
hS₄ : ↑↑j₁.posPart S = 0
hS₅ : ↑↑j₁.negPart Sᶜ = 0
T : Set α
hT₁ : MeasurableSet T
hT₂ : VectorMeasure.restrict (toSignedMeasure j₁) T ≤ VectorMeasure.restrict 0 T
hT₃ : VectorMeasure.restrict 0 Tᶜ ≤ VectorMeasure.restrict (toSignedMeasure j₁) Tᶜ
hT₄ : ↑↑j₂.posPart T = 0
hT₅ : ↑↑j₂.negPart Tᶜ = 0
hST₁ : ↑(toSignedMeasure j₁) (Sᶜ ∆ Tᶜ) = 0
i : Set α
hi : MeasurableSet i
⊢ ENNReal.toReal (↑↑j₁.posPart i) = ENNReal.toReal (↑↑j₁.posPart (i ∩ Sᶜ))

Next tactic:
conv_lhs => rw [← Set.inter_union_compl i S]
/-- The Jordan decomposition of a signed measure is unique. -/
theorem toSignedMeasure_injective : Injective <| @JordanDecomposition.toSignedMeasure α _ := by
  /- The main idea is that two Jordan decompositions of a signed measure provide two
    Hahn decompositions for that measure. Then, from `of_symmDiff_compl_positive_negative`,
    the symmetric difference of the two Hahn decompositions has measure zero, thus, allowing us to
    show the equality of the underlying measures of the Jordan decompositions. -/
  intro j₁ j₂ hj
  -- obtain the two Hahn decompositions from the Jordan decompositions
  obtain ⟨S, hS₁, hS₂, hS₃, hS₄, hS₅⟩ := j₁.exists_compl_positive_negative
  obtain ⟨T, hT₁, hT₂, hT₃, hT₄, hT₅⟩ := j₂.exists_compl_positive_negative
  rw [← hj] at hT₂ hT₃
  -- the symmetric differences of the two Hahn decompositions have measure zero
  obtain ⟨hST₁, -⟩ :=
    of_symmDiff_compl_positive_negative hS₁.compl hT₁.compl ⟨hS₃, (compl_compl S).symm ▸ hS₂⟩
      ⟨hT₃, (compl_compl T).symm ▸ hT₂⟩
  -- it suffices to show the Jordan decompositions have the same positive parts
  refine' eq_of_posPart_eq_posPart _ hj
  ext1 i hi
  -- we see that the positive parts of the two Jordan decompositions are equal to their
  -- associated signed measures restricted on their associated Hahn decompositions
  have hμ₁ : (j₁.posPart i).toReal = j₁.toSignedMeasure (i ∩ Sᶜ) := by
    rw [toSignedMeasure, toSignedMeasure_sub_apply (hi.inter hS₁.compl),
      show j₁.negPart (i ∩ Sᶜ) = 0 from
        nonpos_iff_eq_zero.1 (hS₅ ▸ measure_mono (Set.inter_subset_right _ _)),
      ENNReal.zero_toReal, sub_zero]
    conv_lhs => 

Proof state:
α : Type u_1
β : Type u_2
inst✝ : MeasurableSpace α
j₁ j₂ : JordanDecomposition α
hj : toSignedMeasure j₁ = toSignedMeasure j₂
S : Set α
hS₁ : MeasurableSet S
hS₂ : VectorMeasure.restrict (toSignedMeasure j₁) S ≤ VectorMeasure.restrict 0 S
hS₃ : VectorMeasure.restrict 0 Sᶜ ≤ VectorMeasure.restrict (toSignedMeasure j₁) Sᶜ
hS₄ : ↑↑j₁.posPart S = 0
hS₅ : ↑↑j₁.negPart Sᶜ = 0
T : Set α
hT₁ : MeasurableSet T
hT₂ : VectorMeasure.restrict (toSignedMeasure j₁) T ≤ VectorMeasure.restrict 0 T
hT₃ : VectorMeasure.restrict 0 Tᶜ ≤ VectorMeasure.restrict (toSignedMeasure j₁) Tᶜ
hT₄ : ↑↑j₂.posPart T = 0
hT₅ : ↑↑j₂.negPart Tᶜ = 0
hST₁ : ↑(toSignedMeasure j₁) (Sᶜ ∆ Tᶜ) = 0
i : Set α
hi : MeasurableSet i
| ENNReal.toReal (↑↑j₁.posPart i)

Next tactic:
rw [← Set.inter_union_compl i S]
/-- The Jordan decomposition of a signed measure is unique. -/
theorem toSignedMeasure_injective : Injective <| @JordanDecomposition.toSignedMeasure α _ := by
  /- The main idea is that two Jordan decompositions of a signed measure provide two
    Hahn decompositions for that measure. Then, from `of_symmDiff_compl_positive_negative`,
    the symmetric difference of the two Hahn decompositions has measure zero, thus, allowing us to
    show the equality of the underlying measures of the Jordan decompositions. -/
  intro j₁ j₂ hj
  -- obtain the two Hahn decompositions from the Jordan decompositions
  obtain ⟨S, hS₁, hS₂, hS₃, hS₄, hS₅⟩ := j₁.exists_compl_positive_negative
  obtain ⟨T, hT₁, hT₂, hT₃, hT₄, hT₅⟩ := j₂.exists_compl_positive_negative
  rw [← hj] at hT₂ hT₃
  -- the symmetric differences of the two Hahn decompositions have measure zero
  obtain ⟨hST₁, -⟩ :=
    of_symmDiff_compl_positive_negative hS₁.compl hT₁.compl ⟨hS₃, (compl_compl S).symm ▸ hS₂⟩
      ⟨hT₃, (compl_compl T).symm ▸ hT₂⟩
  -- it suffices to show the Jordan decompositions have the same positive parts
  refine' eq_of_posPart_eq_posPart _ hj
  ext1 i hi
  -- we see that the positive parts of the two Jordan decompositions are equal to their
  -- associated signed measures restricted on their associated Hahn decompositions
  have hμ₁ : (j₁.posPart i).toReal = j₁.toSignedMeasure (i ∩ Sᶜ) := by
    rw [toSignedMeasure, toSignedMeasure_sub_apply (hi.inter hS₁.compl),
      show j₁.negPart (i ∩ Sᶜ) = 0 from
        nonpos_iff_eq_zero.1 (hS₅ ▸ measure_mono (Set.inter_subset_right _ _)),
      ENNReal.zero_toReal, sub_zero]
    conv_lhs => rw [← Set.inter_union_compl i S]
    

Proof state:
α : Type u_1
β : Type u_2
inst✝ : MeasurableSpace α
j₁ j₂ : JordanDecomposition α
hj : toSignedMeasure j₁ = toSignedMeasure j₂
S : Set α
hS₁ : MeasurableSet S
hS₂ : VectorMeasure.restrict (toSignedMeasure j₁) S ≤ VectorMeasure.restrict 0 S
hS₃ : VectorMeasure.restrict 0 Sᶜ ≤ VectorMeasure.restrict (toSignedMeasure j₁) Sᶜ
hS₄ : ↑↑j₁.posPart S = 0
hS₅ : ↑↑j₁.negPart Sᶜ = 0
T : Set α
hT₁ : MeasurableSet T
hT₂ : VectorMeasure.restrict (toSignedMeasure j₁) T ≤ VectorMeasure.restrict 0 T
hT₃ : VectorMeasure.restrict 0 Tᶜ ≤ VectorMeasure.restrict (toSignedMeasure j₁) Tᶜ
hT₄ : ↑↑j₂.posPart T = 0
hT₅ : ↑↑j₂.negPart Tᶜ = 0
hST₁ : ↑(toSignedMeasure j₁) (Sᶜ ∆ Tᶜ) = 0
i : Set α
hi : MeasurableSet i
⊢ ENNReal.toReal (↑↑j₁.posPart (i ∩ S ∪ i ∩ Sᶜ)) = ENNReal.toReal (↑↑j₁.posPart (i ∩ Sᶜ))

Next tactic:
rw [measure_union,
      show j₁.posPart (i ∩ S) = 0 from
        nonpos_iff_eq_zero.1 (hS₄ ▸ measure_mono (Set.inter_subset_right _ _)),
      zero_add]
/-- The Jordan decomposition of a signed measure is unique. -/
theorem toSignedMeasure_injective : Injective <| @JordanDecomposition.toSignedMeasure α _ := by
  /- The main idea is that two Jordan decompositions of a signed measure provide two
    Hahn decompositions for that measure. Then, from `of_symmDiff_compl_positive_negative`,
    the symmetric difference of the two Hahn decompositions has measure zero, thus, allowing us to
    show the equality of the underlying measures of the Jordan decompositions. -/
  intro j₁ j₂ hj
  -- obtain the two Hahn decompositions from the Jordan decompositions
  obtain ⟨S, hS₁, hS₂, hS₃, hS₄, hS₅⟩ := j₁.exists_compl_positive_negative
  obtain ⟨T, hT₁, hT₂, hT₃, hT₄, hT₅⟩ := j₂.exists_compl_positive_negative
  rw [← hj] at hT₂ hT₃
  -- the symmetric differences of the two Hahn decompositions have measure zero
  obtain ⟨hST₁, -⟩ :=
    of_symmDiff_compl_positive_negative hS₁.compl hT₁.compl ⟨hS₃, (compl_compl S).symm ▸ hS₂⟩
      ⟨hT₃, (compl_compl T).symm ▸ hT₂⟩
  -- it suffices to show the Jordan decompositions have the same positive parts
  refine' eq_of_posPart_eq_posPart _ hj
  ext1 i hi
  -- we see that the positive parts of the two Jordan decompositions are equal to their
  -- associated signed measures restricted on their associated Hahn decompositions
  have hμ₁ : (j₁.posPart i).toReal = j₁.toSignedMeasure (i ∩ Sᶜ) := by
    rw [toSignedMeasure, toSignedMeasure_sub_apply (hi.inter hS₁.compl),
      show j₁.negPart (i ∩ Sᶜ) = 0 from
        nonpos_iff_eq_zero.1 (hS₅ ▸ measure_mono (Set.inter_subset_right _ _)),
      ENNReal.zero_toReal, sub_zero]
    conv_lhs => rw [← Set.inter_union_compl i S]
    rw [measure_union,
      show j₁.posPart (i ∩ S) = 0 from
        nonpos_iff_eq_zero.1 (hS₄ ▸ measure_mono (Set.inter_subset_right _ _)),
      zero_add]
    · 

Proof state:
case hd
α : Type u_1
β : Type u_2
inst✝ : MeasurableSpace α
j₁ j₂ : JordanDecomposition α
hj : toSignedMeasure j₁ = toSignedMeasure j₂
S : Set α
hS₁ : MeasurableSet S
hS₂ : VectorMeasure.restrict (toSignedMeasure j₁) S ≤ VectorMeasure.restrict 0 S
hS₃ : VectorMeasure.restrict 0 Sᶜ ≤ VectorMeasure.restrict (toSignedMeasure j₁) Sᶜ
hS₄ : ↑↑j₁.posPart S = 0
hS₅ : ↑↑j₁.negPart Sᶜ = 0
T : Set α
hT₁ : MeasurableSet T
hT₂ : VectorMeasure.restrict (toSignedMeasure j₁) T ≤ VectorMeasure.restrict 0 T
hT₃ : VectorMeasure.restrict 0 Tᶜ ≤ VectorMeasure.restrict (toSignedMeasure j₁) Tᶜ
hT₄ : ↑↑j₂.posPart T = 0
hT₅ : ↑↑j₂.negPart Tᶜ = 0
hST₁ : ↑(toSignedMeasure j₁) (Sᶜ ∆ Tᶜ) = 0
i : Set α
hi : MeasurableSet i
⊢ Disjoint (i ∩ S) (i ∩ Sᶜ)

Next tactic:
refine'
        Set.disjoint_of_subset_left (Set.inter_subset_right _ _)
          (Set.disjoint_of_subset_right (Set.inter_subset_right _ _) disjoint_compl_right)
/-- The Jordan decomposition of a signed measure is unique. -/
theorem toSignedMeasure_injective : Injective <| @JordanDecomposition.toSignedMeasure α _ := by
  /- The main idea is that two Jordan decompositions of a signed measure provide two
    Hahn decompositions for that measure. Then, from `of_symmDiff_compl_positive_negative`,
    the symmetric difference of the two Hahn decompositions has measure zero, thus, allowing us to
    show the equality of the underlying measures of the Jordan decompositions. -/
  intro j₁ j₂ hj
  -- obtain the two Hahn decompositions from the Jordan decompositions
  obtain ⟨S, hS₁, hS₂, hS₃, hS₄, hS₅⟩ := j₁.exists_compl_positive_negative
  obtain ⟨T, hT₁, hT₂, hT₃, hT₄, hT₅⟩ := j₂.exists_compl_positive_negative
  rw [← hj] at hT₂ hT₃
  -- the symmetric differences of the two Hahn decompositions have measure zero
  obtain ⟨hST₁, -⟩ :=
    of_symmDiff_compl_positive_negative hS₁.compl hT₁.compl ⟨hS₃, (compl_compl S).symm ▸ hS₂⟩
      ⟨hT₃, (compl_compl T).symm ▸ hT₂⟩
  -- it suffices to show the Jordan decompositions have the same positive parts
  refine' eq_of_posPart_eq_posPart _ hj
  ext1 i hi
  -- we see that the positive parts of the two Jordan decompositions are equal to their
  -- associated signed measures restricted on their associated Hahn decompositions
  have hμ₁ : (j₁.posPart i).toReal = j₁.toSignedMeasure (i ∩ Sᶜ) := by
    rw [toSignedMeasure, toSignedMeasure_sub_apply (hi.inter hS₁.compl),
      show j₁.negPart (i ∩ Sᶜ) = 0 from
        nonpos_iff_eq_zero.1 (hS₅ ▸ measure_mono (Set.inter_subset_right _ _)),
      ENNReal.zero_toReal, sub_zero]
    conv_lhs => rw [← Set.inter_union_compl i S]
    rw [measure_union,
      show j₁.posPart (i ∩ S) = 0 from
        nonpos_iff_eq_zero.1 (hS₄ ▸ measure_mono (Set.inter_subset_right _ _)),
      zero_add]
    · refine'
        Set.disjoint_of_subset_left (Set.inter_subset_right _ _)
          (Set.disjoint_of_subset_right (Set.inter_subset_right _ _) disjoint_compl_right)
    · 

Proof state:
case h
α : Type u_1
β : Type u_2
inst✝ : MeasurableSpace α
j₁ j₂ : JordanDecomposition α
hj : toSignedMeasure j₁ = toSignedMeasure j₂
S : Set α
hS₁ : MeasurableSet S
hS₂ : VectorMeasure.restrict (toSignedMeasure j₁) S ≤ VectorMeasure.restrict 0 S
hS₃ : VectorMeasure.restrict 0 Sᶜ ≤ VectorMeasure.restrict (toSignedMeasure j₁) Sᶜ
hS₄ : ↑↑j₁.posPart S = 0
hS₅ : ↑↑j₁.negPart Sᶜ = 0
T : Set α
hT₁ : MeasurableSet T
hT₂ : VectorMeasure.restrict (toSignedMeasure j₁) T ≤ VectorMeasure.restrict 0 T
hT₃ : VectorMeasure.restrict 0 Tᶜ ≤ VectorMeasure.restrict (toSignedMeasure j₁) Tᶜ
hT₄ : ↑↑j₂.posPart T = 0
hT₅ : ↑↑j₂.negPart Tᶜ = 0
hST₁ : ↑(toSignedMeasure j₁) (Sᶜ ∆ Tᶜ) = 0
i : Set α
hi : MeasurableSet i
⊢ MeasurableSet (i ∩ Sᶜ)

Next tactic:
exact hi.inter hS₁.compl
/-- The Jordan decomposition of a signed measure is unique. -/
theorem toSignedMeasure_injective : Injective <| @JordanDecomposition.toSignedMeasure α _ := by
  /- The main idea is that two Jordan decompositions of a signed measure provide two
    Hahn decompositions for that measure. Then, from `of_symmDiff_compl_positive_negative`,
    the symmetric difference of the two Hahn decompositions has measure zero, thus, allowing us to
    show the equality of the underlying measures of the Jordan decompositions. -/
  intro j₁ j₂ hj
  -- obtain the two Hahn decompositions from the Jordan decompositions
  obtain ⟨S, hS₁, hS₂, hS₃, hS₄, hS₅⟩ := j₁.exists_compl_positive_negative
  obtain ⟨T, hT₁, hT₂, hT₃, hT₄, hT₅⟩ := j₂.exists_compl_positive_negative
  rw [← hj] at hT₂ hT₃
  -- the symmetric differences of the two Hahn decompositions have measure zero
  obtain ⟨hST₁, -⟩ :=
    of_symmDiff_compl_positive_negative hS₁.compl hT₁.compl ⟨hS₃, (compl_compl S).symm ▸ hS₂⟩
      ⟨hT₃, (compl_compl T).symm ▸ hT₂⟩
  -- it suffices to show the Jordan decompositions have the same positive parts
  refine' eq_of_posPart_eq_posPart _ hj
  ext1 i hi
  -- we see that the positive parts of the two Jordan decompositions are equal to their
  -- associated signed measures restricted on their associated Hahn decompositions
  have hμ₁ : (j₁.posPart i).toReal = j₁.toSignedMeasure (i ∩ Sᶜ) := by
    rw [toSignedMeasure, toSignedMeasure_sub_apply (hi.inter hS₁.compl),
      show j₁.negPart (i ∩ Sᶜ) = 0 from
        nonpos_iff_eq_zero.1 (hS₅ ▸ measure_mono (Set.inter_subset_right _ _)),
      ENNReal.zero_toReal, sub_zero]
    conv_lhs => rw [← Set.inter_union_compl i S]
    rw [measure_union,
      show j₁.posPart (i ∩ S) = 0 from
        nonpos_iff_eq_zero.1 (hS₄ ▸ measure_mono (Set.inter_subset_right _ _)),
      zero_add]
    · refine'
        Set.disjoint_of_subset_left (Set.inter_subset_right _ _)
          (Set.disjoint_of_subset_right (Set.inter_subset_right _ _) disjoint_compl_right)
    · exact hi.inter hS₁.compl
  have hμ₂ : (j₂.posPart i).toReal = j₂.toSignedMeasure (i ∩ Tᶜ) := by
    

Proof state:
α : Type u_1
β : Type u_2
inst✝ : MeasurableSpace α
j₁ j₂ : JordanDecomposition α
hj : toSignedMeasure j₁ = toSignedMeasure j₂
S : Set α
hS₁ : MeasurableSet S
hS₂ : VectorMeasure.restrict (toSignedMeasure j₁) S ≤ VectorMeasure.restrict 0 S
hS₃ : VectorMeasure.restrict 0 Sᶜ ≤ VectorMeasure.restrict (toSignedMeasure j₁) Sᶜ
hS₄ : ↑↑j₁.posPart S = 0
hS₅ : ↑↑j₁.negPart Sᶜ = 0
T : Set α
hT₁ : MeasurableSet T
hT₂ : VectorMeasure.restrict (toSignedMeasure j₁) T ≤ VectorMeasure.restrict 0 T
hT₃ : VectorMeasure.restrict 0 Tᶜ ≤ VectorMeasure.restrict (toSignedMeasure j₁) Tᶜ
hT₄ : ↑↑j₂.posPart T = 0
hT₅ : ↑↑j₂.negPart Tᶜ = 0
hST₁ : ↑(toSignedMeasure j₁) (Sᶜ ∆ Tᶜ) = 0
i : Set α
hi : MeasurableSet i
hμ₁ : ENNReal.toReal (↑↑j₁.posPart i) = ↑(toSignedMeasure j₁) (i ∩ Sᶜ)
⊢ ENNReal.toReal (↑↑j₂.posPart i) = ↑(toSignedMeasure j₂) (i ∩ Tᶜ)

Next tactic:
rw [toSignedMeasure, toSignedMeasure_sub_apply (hi.inter hT₁.compl),
      show j₂.negPart (i ∩ Tᶜ) = 0 from
        nonpos_iff_eq_zero.1 (hT₅ ▸ measure_mono (Set.inter_subset_right _ _)),
      ENNReal.zero_toReal, sub_zero]
@[simp]
theorem toJordanDecomposition_toSignedMeasure (j : JordanDecomposition α) :
    j.toSignedMeasure.toJordanDecomposition = j :=
  (@toSignedMeasure_injective _ _ j j.toSignedMeasure.toJordanDecomposition (by 

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

Next tactic:
simp
theorem toJordanDecomposition_zero : (0 : SignedMeasure α).toJordanDecomposition = 0 := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : MeasurableSpace α
⊢ toJordanDecomposition 0 = 0

Next tactic:
apply toSignedMeasure_injective
theorem toJordanDecomposition_zero : (0 : SignedMeasure α).toJordanDecomposition = 0 := by
  apply toSignedMeasure_injective
  

Proof state:
case a
α : Type u_1
β : Type u_2
inst✝ : MeasurableSpace α
⊢ toSignedMeasure (toJordanDecomposition 0) = toSignedMeasure 0

Next tactic:
simp [toSignedMeasure_zero]