Theorem: Besicovitch.exist_disjoint_covering_families
File: Mathlib/MeasureTheory/Covering/Besicovitch.lean

tactic: cases isEmpty_or_nonempty β
state_before: α : Type u_1
inst✝ : MetricSpace α
β : Type u
N : ℕ
τ : ℝ
hτ : 1 < τ
hN : IsEmpty (SatelliteConfig α N τ)
q : BallPackage β α
⊢ ∃ s,
    (∀ (i : Fin N), PairwiseDisjoint (s i) fun j => closedBall (BallPackage.c q j) (BallPackage.r q j)) ∧
      range q.c ⊆ ⋃ (i : Fin N) (j : β) (_ : j ∈ s i), ball (BallPackage.c q j) (BallPackage.r q j)

tactic: let p : TauPackage β α :=
  { q with
    τ
    one_lt_tau := hτ }
state_before: case inr
α : Type u_1
inst✝ : MetricSpace α
β : Type u
N : ℕ
τ : ℝ
hτ : 1 < τ
hN : IsEmpty (SatelliteConfig α N τ)
q : BallPackage β α
h✝ : Nonempty β
⊢ ∃ s,
    (∀ (i : Fin N), PairwiseDisjoint (s i) fun j => closedBall (BallPackage.c q j) (BallPackage.r q j)) ∧
      range q.c ⊆ ⋃ (i : Fin N) (j : β) (_ : j ∈ s i), ball (BallPackage.c q j) (BallPackage.r q j)

tactic: let s := fun i : Fin N =>
  ⋃ (k : Ordinal.{u}) (_ : k < p.lastStep) (_ : p.color k = i), ({p.index k} : Set β)
state_before: case inr
α : Type u_1
inst✝ : MetricSpace α
β : Type u
N : ℕ
τ : ℝ
hτ : 1 < τ
hN : IsEmpty (SatelliteConfig α N τ)
q : BallPackage β α
h✝ : Nonempty β
p : TauPackage β α :=
  {
    toBallPackage :=
      { c := q.c, r := q.r, rpos := (_ : ∀ (b : β), 0 < BallPackage.r q b), r_bound := q.r_bound,
        r_le := (_ : ∀ (b : β), BallPackage.r q b ≤ q.r_bound) },
    τ := τ, one_lt_tau := hτ }
⊢ ∃ s,
    (∀ (i : Fin N), PairwiseDisjoint (s i) fun j => closedBall (BallPackage.c q j) (BallPackage.r q j)) ∧
      range q.c ⊆ ⋃ (i : Fin N) (j : β) (_ : j ∈ s i), ball (BallPackage.c q j) (BallPackage.r q j)

tactic: refine' ⟨s, fun i => _, _⟩
state_before: case inr
α : Type u_1
inst✝ : MetricSpace α
β : Type u
N : ℕ
τ : ℝ
hτ : 1 < τ
hN : IsEmpty (SatelliteConfig α N τ)
q : BallPackage β α
h✝ : Nonempty β
p : TauPackage β α :=
  {
    toBallPackage :=
      { c := q.c, r := q.r, rpos := (_ : ∀ (b : β), 0 < BallPackage.r q b), r_bound := q.r_bound,
        r_le := (_ : ∀ (b : β), BallPackage.r q b ≤ q.r_bound) },
    τ := τ, one_lt_tau := hτ }
s : Fin N → Set β := fun i => ⋃ (k : Ordinal) (_ : k < lastStep p) (_ : color p k = ↑i), {index p k}
⊢ ∃ s,
    (∀ (i : Fin N), PairwiseDisjoint (s i) fun j => closedBall (BallPackage.c q j) (BallPackage.r q j)) ∧
      range q.c ⊆ ⋃ (i : Fin N) (j : β) (_ : j ∈ s i), ball (BallPackage.c q j) (BallPackage.r q j)

tactic: refine' ⟨fun _ => ∅, fun _ => pairwiseDisjoint_empty, _⟩
state_before: case inl
α : Type u_1
inst✝ : MetricSpace α
β : Type u
N : ℕ
τ : ℝ
hτ : 1 < τ
hN : IsEmpty (SatelliteConfig α N τ)
q : BallPackage β α
h✝ : IsEmpty β
⊢ ∃ s,
    (∀ (i : Fin N), PairwiseDisjoint (s i) fun j => closedBall (BallPackage.c q j) (BallPackage.r q j)) ∧
      range q.c ⊆ ⋃ (i : Fin N) (j : β) (_ : j ∈ s i), ball (BallPackage.c q j) (BallPackage.r q j)

tactic: rw [← image_univ, eq_empty_of_isEmpty (univ : Set β)]
state_before: case inl
α : Type u_1
inst✝ : MetricSpace α
β : Type u
N : ℕ
τ : ℝ
hτ : 1 < τ
hN : IsEmpty (SatelliteConfig α N τ)
q : BallPackage β α
h✝ : IsEmpty β
⊢ range q.c ⊆ ⋃ (i : Fin N) (j : β) (_ : j ∈ (fun x => ∅) i), ball (BallPackage.c q j) (BallPackage.r q j)

tactic: simp
state_before: case inl
α : Type u_1
inst✝ : MetricSpace α
β : Type u
N : ℕ
τ : ℝ
hτ : 1 < τ
hN : IsEmpty (SatelliteConfig α N τ)
q : BallPackage β α
h✝ : IsEmpty β
⊢ q.c '' ∅ ⊆ ⋃ (i : Fin N) (j : β) (_ : j ∈ (fun x => ∅) i), ball (BallPackage.c q j) (BallPackage.r q j)

tactic: intro x hx y hy x_ne_y
state_before: case inr.refine'_1
α : Type u_1
inst✝ : MetricSpace α
β : Type u
N : ℕ
τ : ℝ
hτ : 1 < τ
hN : IsEmpty (SatelliteConfig α N τ)
q : BallPackage β α
h✝ : Nonempty β
p : TauPackage β α :=
  {
    toBallPackage :=
      { c := q.c, r := q.r, rpos := (_ : ∀ (b : β), 0 < BallPackage.r q b), r_bound := q.r_bound,
        r_le := (_ : ∀ (b : β), BallPackage.r q b ≤ q.r_bound) },
    τ := τ, one_lt_tau := hτ }
s : Fin N → Set β := fun i => ⋃ (k : Ordinal) (_ : k < lastStep p) (_ : color p k = ↑i), {index p k}
i : Fin N
⊢ PairwiseDisjoint (s i) fun j => closedBall (BallPackage.c q j) (BallPackage.r q j)

tactic: obtain ⟨jx, jx_lt, jxi, rfl⟩ :
  ∃ jx : Ordinal, jx < p.lastStep ∧ p.color jx = i ∧ x = p.index jx := by
  simpa only [exists_prop, mem_iUnion, mem_singleton_iff] using hx
state_before: case inr.refine'_1
α : Type u_1
inst✝ : MetricSpace α
β : Type u
N : ℕ
τ : ℝ
hτ : 1 < τ
hN : IsEmpty (SatelliteConfig α N τ)
q : BallPackage β α
h✝ : Nonempty β
p : TauPackage β α :=
  {
    toBallPackage :=
      { c := q.c, r := q.r, rpos := (_ : ∀ (b : β), 0 < BallPackage.r q b), r_bound := q.r_bound,
        r_le := (_ : ∀ (b : β), BallPackage.r q b ≤ q.r_bound) },
    τ := τ, one_lt_tau := hτ }
s : Fin N → Set β := fun i => ⋃ (k : Ordinal) (_ : k < lastStep p) (_ : color p k = ↑i), {index p k}
i : Fin N
x : β
hx : x ∈ s i
y : β
hy : y ∈ s i
x_ne_y : x ≠ y
⊢ (Disjoint on fun j => closedBall (BallPackage.c q j) (BallPackage.r q j)) x y

tactic: obtain ⟨jy, jy_lt, jyi, rfl⟩ :
  ∃ jy : Ordinal, jy < p.lastStep ∧ p.color jy = i ∧ y = p.index jy := by
  simpa only [exists_prop, mem_iUnion, mem_singleton_iff] using hy
state_before: case inr.refine'_1.intro.intro.intro
α : Type u_1
inst✝ : MetricSpace α
β : Type u
N : ℕ
τ : ℝ
hτ : 1 < τ
hN : IsEmpty (SatelliteConfig α N τ)
q : BallPackage β α
h✝ : Nonempty β
p : TauPackage β α :=
  {
    toBallPackage :=
      { c := q.c, r := q.r, rpos := (_ : ∀ (b : β), 0 < BallPackage.r q b), r_bound := q.r_bound,
        r_le := (_ : ∀ (b : β), BallPackage.r q b ≤ q.r_bound) },
    τ := τ, one_lt_tau := hτ }
s : Fin N → Set β := fun i => ⋃ (k : Ordinal) (_ : k < lastStep p) (_ : color p k = ↑i), {index p k}
i : Fin N
y : β
hy : y ∈ s i
jx : Ordinal
jx_lt : jx < lastStep p
jxi : color p jx = ↑i
hx : index p jx ∈ s i
x_ne_y : index p jx ≠ y
⊢ (Disjoint on fun j => closedBall (BallPackage.c q j) (BallPackage.r q j)) (index p jx) y

tactic: wlog jxy : jx ≤ jy generalizing jx jy
state_before: case inr.refine'_1.intro.intro.intro.intro.intro.intro
α : Type u_1
inst✝ : MetricSpace α
β : Type u
N : ℕ
τ : ℝ
hτ : 1 < τ
hN : IsEmpty (SatelliteConfig α N τ)
q : BallPackage β α
h✝ : Nonempty β
p : TauPackage β α :=
  {
    toBallPackage :=
      { c := q.c, r := q.r, rpos := (_ : ∀ (b : β), 0 < BallPackage.r q b), r_bound := q.r_bound,
        r_le := (_ : ∀ (b : β), BallPackage.r q b ≤ q.r_bound) },
    τ := τ, one_lt_tau := hτ }
s : Fin N → Set β := fun i => ⋃ (k : Ordinal) (_ : k < lastStep p) (_ : color p k = ↑i), {index p k}
i : Fin N
jx : Ordinal
jx_lt : jx < lastStep p
jxi : color p jx = ↑i
hx : index p jx ∈ s i
jy : Ordinal
jy_lt : jy < lastStep p
jyi : color p jy = ↑i
hy : index p jy ∈ s i
x_ne_y : index p jx ≠ index p jy
⊢ (Disjoint on fun j => closedBall (BallPackage.c q j) (BallPackage.r q j)) (index p jx) (index p jy)

tactic: replace jxy : jx < jy
state_before: α : Type u_1
inst✝ : MetricSpace α
β : Type u
N : ℕ
τ : ℝ
hτ : 1 < τ
hN : IsEmpty (SatelliteConfig α N τ)
q : BallPackage β α
h✝ : Nonempty β
p : TauPackage β α :=
  {
    toBallPackage :=
      { c := q.c, r := q.r, rpos := (_ : ∀ (b : β), 0 < BallPackage.r q b), r_bound := q.r_bound,
        r_le := (_ : ∀ (b : β), BallPackage.r q b ≤ q.r_bound) },
    τ := τ, one_lt_tau := hτ }
s : Fin N → Set β := fun i => ⋃ (k : Ordinal) (_ : k < lastStep p) (_ : color p k = ↑i), {index p k}
i : Fin N
jx : Ordinal
jx_lt : jx < lastStep p
jxi : color p jx = ↑i
hx : index p jx ∈ s i
jy : Ordinal
jy_lt : jy < lastStep p
jyi : color p jy = ↑i
hy : index p jy ∈ s i
x_ne_y : index p jx ≠ index p jy
jxy : jx ≤ jy
⊢ (Disjoint on fun j => closedBall (BallPackage.c q j) (BallPackage.r q j)) (index p jx) (index p jy)

tactic: let A : Set ℕ :=
  ⋃ (j : { j // j < jy })
    (_ : (closedBall (p.c (p.index j)) (p.r (p.index j)) ∩
      closedBall (p.c (p.index jy)) (p.r (p.index jy))).Nonempty),
    {p.color j}
state_before: α : Type u_1
inst✝ : MetricSpace α
β : Type u
N : ℕ
τ : ℝ
hτ : 1 < τ
hN : IsEmpty (SatelliteConfig α N τ)
q : BallPackage β α
h✝ : Nonempty β
p : TauPackage β α :=
  {
    toBallPackage :=
      { c := q.c, r := q.r, rpos := (_ : ∀ (b : β), 0 < BallPackage.r q b), r_bound := q.r_bound,
        r_le := (_ : ∀ (b : β), BallPackage.r q b ≤ q.r_bound) },
    τ := τ, one_lt_tau := hτ }
s : Fin N → Set β := fun i => ⋃ (k : Ordinal) (_ : k < lastStep p) (_ : color p k = ↑i), {index p k}
i : Fin N
jx : Ordinal
jx_lt : jx < lastStep p
jxi : color p jx = ↑i
hx : index p jx ∈ s i
jy : Ordinal
jy_lt : jy < lastStep p
jyi : color p jy = ↑i
hy : index p jy ∈ s i
x_ne_y : index p jx ≠ index p jy
jxy : jx < jy
⊢ (Disjoint on fun j => closedBall (BallPackage.c q j) (BallPackage.r q j)) (index p jx) (index p jy)

tactic: have color_j : p.color jy = sInf (univ \ A) := by rw [TauPackage.color]
state_before: α : Type u_1
inst✝ : MetricSpace α
β : Type u
N : ℕ
τ : ℝ
hτ : 1 < τ
hN : IsEmpty (SatelliteConfig α N τ)
q : BallPackage β α
h✝ : Nonempty β
p : TauPackage β α :=
  {
    toBallPackage :=
      { c := q.c, r := q.r, rpos := (_ : ∀ (b : β), 0 < BallPackage.r q b), r_bound := q.r_bound,
        r_le := (_ : ∀ (b : β), BallPackage.r q b ≤ q.r_bound) },
    τ := τ, one_lt_tau := hτ }
s : Fin N → Set β := fun i => ⋃ (k : Ordinal) (_ : k < lastStep p) (_ : color p k = ↑i), {index p k}
i : Fin N
jx : Ordinal
jx_lt : jx < lastStep p
jxi : color p jx = ↑i
hx : index p jx ∈ s i
jy : Ordinal
jy_lt : jy < lastStep p
jyi : color p jy = ↑i
hy : index p jy ∈ s i
x_ne_y : index p jx ≠ index p jy
jxy : jx < jy
A : Set ℕ :=
  ⋃ (j : { j // j < jy }) (_ :
    Set.Nonempty
      (closedBall (BallPackage.c p.toBallPackage (index p ↑j)) (BallPackage.r p.toBallPackage (index p ↑j)) ∩
        closedBall (BallPackage.c p.toBallPackage (index p jy)) (BallPackage.r p.toBallPackage (index p jy)))),
    {color p ↑j}
⊢ (Disjoint on fun j => closedBall (BallPackage.c q j) (BallPackage.r q j)) (index p jx) (index p jy)

tactic: have h : p.color jy ∈ univ \ A := by
  rw [color_j]
  apply csInf_mem
  refine' ⟨N, _⟩
  simp only [not_exists, true_and_iff, exists_prop, mem_iUnion, mem_singleton_iff, not_and,
    mem_univ, mem_diff, Subtype.exists, Subtype.coe_mk]
  intro k hk _
  exact (p.color_lt (hk.trans jy_lt) hN).ne'
state_before: α : Type u_1
inst✝ : MetricSpace α
β : Type u
N : ℕ
τ : ℝ
hτ : 1 < τ
hN : IsEmpty (SatelliteConfig α N τ)
q : BallPackage β α
h✝ : Nonempty β
p : TauPackage β α :=
  {
    toBallPackage :=
      { c := q.c, r := q.r, rpos := (_ : ∀ (b : β), 0 < BallPackage.r q b), r_bound := q.r_bound,
        r_le := (_ : ∀ (b : β), BallPackage.r q b ≤ q.r_bound) },
    τ := τ, one_lt_tau := hτ }
s : Fin N → Set β := fun i => ⋃ (k : Ordinal) (_ : k < lastStep p) (_ : color p k = ↑i), {index p k}
i : Fin N
jx : Ordinal
jx_lt : jx < lastStep p
jxi : color p jx = ↑i
hx : index p jx ∈ s i
jy : Ordinal
jy_lt : jy < lastStep p
jyi : color p jy = ↑i
hy : index p jy ∈ s i
x_ne_y : index p jx ≠ index p jy
jxy : jx < jy
A : Set ℕ :=
  ⋃ (j : { j // j < jy }) (_ :
    Set.Nonempty
      (closedBall (BallPackage.c p.toBallPackage (index p ↑j)) (BallPackage.r p.toBallPackage (index p ↑j)) ∩
        closedBall (BallPackage.c p.toBallPackage (index p jy)) (BallPackage.r p.toBallPackage (index p jy)))),
    {color p ↑j}
color_j : color p jy = sInf (univ \ A)
⊢ (Disjoint on fun j => closedBall (BallPackage.c q j) (BallPackage.r q j)) (index p jx) (index p jy)

tactic: simp only [not_exists, true_and_iff, exists_prop, mem_iUnion, mem_singleton_iff, not_and,
  mem_univ, mem_diff, Subtype.exists, Subtype.coe_mk] at h
state_before: α : Type u_1
inst✝ : MetricSpace α
β : Type u
N : ℕ
τ : ℝ
hτ : 1 < τ
hN : IsEmpty (SatelliteConfig α N τ)
q : BallPackage β α
h✝ : Nonempty β
p : TauPackage β α :=
  {
    toBallPackage :=
      { c := q.c, r := q.r, rpos := (_ : ∀ (b : β), 0 < BallPackage.r q b), r_bound := q.r_bound,
        r_le := (_ : ∀ (b : β), BallPackage.r q b ≤ q.r_bound) },
    τ := τ, one_lt_tau := hτ }
s : Fin N → Set β := fun i => ⋃ (k : Ordinal) (_ : k < lastStep p) (_ : color p k = ↑i), {index p k}
i : Fin N
jx : Ordinal
jx_lt : jx < lastStep p
jxi : color p jx = ↑i
hx : index p jx ∈ s i
jy : Ordinal
jy_lt : jy < lastStep p
jyi : color p jy = ↑i
hy : index p jy ∈ s i
x_ne_y : index p jx ≠ index p jy
jxy : jx < jy
A : Set ℕ :=
  ⋃ (j : { j // j < jy }) (_ :
    Set.Nonempty
      (closedBall (BallPackage.c p.toBallPackage (index p ↑j)) (BallPackage.r p.toBallPackage (index p ↑j)) ∩
        closedBall (BallPackage.c p.toBallPackage (index p jy)) (BallPackage.r p.toBallPackage (index p jy)))),
    {color p ↑j}
color_j : color p jy = sInf (univ \ A)
h : color p jy ∈ univ \ A
⊢ (Disjoint on fun j => closedBall (BallPackage.c q j) (BallPackage.r q j)) (index p jx) (index p jy)

tactic: specialize h jx jxy
state_before: α : Type u_1
inst✝ : MetricSpace α
β : Type u
N : ℕ
τ : ℝ
hτ : 1 < τ
hN : IsEmpty (SatelliteConfig α N τ)
q : BallPackage β α
h✝ : Nonempty β
p : TauPackage β α :=
  {
    toBallPackage :=
      { c := q.c, r := q.r, rpos := (_ : ∀ (b : β), 0 < BallPackage.r q b), r_bound := q.r_bound,
        r_le := (_ : ∀ (b : β), BallPackage.r q b ≤ q.r_bound) },
    τ := τ, one_lt_tau := hτ }
s : Fin N → Set β := fun i => ⋃ (k : Ordinal) (_ : k < lastStep p) (_ : color p k = ↑i), {index p k}
i : Fin N
jx : Ordinal
jx_lt : jx < lastStep p
jxi : color p jx = ↑i
hx : index p jx ∈ s i
jy : Ordinal
jy_lt : jy < lastStep p
jyi : color p jy = ↑i
hy : index p jy ∈ s i
x_ne_y : index p jx ≠ index p jy
jxy : jx < jy
A : Set ℕ :=
  ⋃ (j : { j // j < jy }) (_ :
    Set.Nonempty
      (closedBall (BallPackage.c p.toBallPackage (index p ↑j)) (BallPackage.r p.toBallPackage (index p ↑j)) ∩
        closedBall (BallPackage.c p.toBallPackage (index p jy)) (BallPackage.r p.toBallPackage (index p jy)))),
    {color p ↑j}
color_j : color p jy = sInf (univ \ A)
h :
  ∀ (x : Ordinal),
    x < jy →
      Set.Nonempty
          (closedBall
              (BallPackage.c q
                (index
                  {
                    toBallPackage :=
                      { c := q.c, r := q.r, rpos := (_ : ∀ (b : β), 0 < BallPackage.r q b), r_bound := q.r_bound,
                        r_le := (_ : ∀ (b : β), BallPackage.r q b ≤ q.r_bound) },
                    τ := τ, one_lt_tau := hτ }
                  x))
              (BallPackage.r q
                (index
                  {
                    toBallPackage :=
                      { c := q.c, r := q.r, rpos := (_ : ∀ (b : β), 0 < BallPackage.r q b), r_bound := q.r_bound,
                        r_le := (_ : ∀ (b : β), BallPackage.r q b ≤ q.r_bound) },
                    τ := τ, one_lt_tau := hτ }
                  x)) ∩
            closedBall
              (BallPackage.c q
                (index
                  {
                    toBallPackage :=
                      { c := q.c, r := q.r, rpos := (_ : ∀ (b : β), 0 < BallPackage.r q b), r_bound := q.r_bound,
                        r_le := (_ : ∀ (b : β), BallPackage.r q b ≤ q.r_bound) },
                    τ := τ, one_lt_tau := hτ }
                  jy))
              (BallPackage.r q
                (index
                  {
                    toBallPackage :=
                      { c := q.c, r := q.r, rpos := (_ : ∀ (b : β), 0 < BallPackage.r q b), r_bound := q.r_bound,
                        r_le := (_ : ∀ (b : β), BallPackage.r q b ≤ q.r_bound) },
                    τ := τ, one_lt_tau := hτ }
                  jy))) →
        ¬color
              {
                toBallPackage :=
                  { c := q.c, r := q.r, rpos := (_ : ∀ (b : β), 0 < BallPackage.r q b), r_bound := q.r_bound,
                    r_le := (_ : ∀ (b : β), BallPackage.r q b ≤ q.r_bound) },
                τ := τ, one_lt_tau := hτ }
              jy =
            color
              {
                toBallPackage :=
                  { c := q.c, r := q.r, rpos := (_ : ∀ (b : β), 0 < BallPackage.r q b), r_bound := q.r_bound,
                    r_le := (_ : ∀ (b : β), BallPackage.r q b ≤ q.r_bound) },
                τ := τ, one_lt_tau := hτ }
              x
⊢ (Disjoint on fun j => closedBall (BallPackage.c q j) (BallPackage.r q j)) (index p jx) (index p jy)

tactic: contrapose! h
state_before: α : Type u_1
inst✝ : MetricSpace α
β : Type u
N : ℕ
τ : ℝ
hτ : 1 < τ
hN : IsEmpty (SatelliteConfig α N τ)
q : BallPackage β α
h✝ : Nonempty β
p : TauPackage β α :=
  {
    toBallPackage :=
      { c := q.c, r := q.r, rpos := (_ : ∀ (b : β), 0 < BallPackage.r q b), r_bound := q.r_bound,
        r_le := (_ : ∀ (b : β), BallPackage.r q b ≤ q.r_bound) },
    τ := τ, one_lt_tau := hτ }
s : Fin N → Set β := fun i => ⋃ (k : Ordinal) (_ : k < lastStep p) (_ : color p k = ↑i), {index p k}
i : Fin N
jx : Ordinal
jx_lt : jx < lastStep p
jxi : color p jx = ↑i
hx : index p jx ∈ s i
jy : Ordinal
jy_lt : jy < lastStep p
jyi : color p jy = ↑i
hy : index p jy ∈ s i
x_ne_y : index p jx ≠ index p jy
jxy : jx < jy
A : Set ℕ :=
  ⋃ (j : { j // j < jy }) (_ :
    Set.Nonempty
      (closedBall (BallPackage.c p.toBallPackage (index p ↑j)) (BallPackage.r p.toBallPackage (index p ↑j)) ∩
        closedBall (BallPackage.c p.toBallPackage (index p jy)) (BallPackage.r p.toBallPackage (index p jy)))),
    {color p ↑j}
color_j : color p jy = sInf (univ \ A)
h :
  Set.Nonempty
      (closedBall
          (BallPackage.c q
            (index
              {
                toBallPackage :=
                  { c := q.c, r := q.r, rpos := (_ : ∀ (b : β), 0 < BallPackage.r q b), r_bound := q.r_bound,
                    r_le := (_ : ∀ (b : β), BallPackage.r q b ≤ q.r_bound) },
                τ := τ, one_lt_tau := hτ }
              jx))
          (BallPackage.r q
            (index
              {
                toBallPackage :=
                  { c := q.c, r := q.r, rpos := (_ : ∀ (b : β), 0 < BallPackage.r q b), r_bound := q.r_bound,
                    r_le := (_ : ∀ (b : β), BallPackage.r q b ≤ q.r_bound) },
                τ := τ, one_lt_tau := hτ }
              jx)) ∩
        closedBall
          (BallPackage.c q
            (index
              {
                toBallPackage :=
                  { c := q.c, r := q.r, rpos := (_ : ∀ (b : β), 0 < BallPackage.r q b), r_bound := q.r_bound,
                    r_le := (_ : ∀ (b : β), BallPackage.r q b ≤ q.r_bound) },
                τ := τ, one_lt_tau := hτ }
              jy))
          (BallPackage.r q
            (index
              {
                toBallPackage :=
                  { c := q.c, r := q.r, rpos := (_ : ∀ (b : β), 0 < BallPackage.r q b), r_bound := q.r_bound,
                    r_le := (_ : ∀ (b : β), BallPackage.r q b ≤ q.r_bound) },
                τ := τ, one_lt_tau := hτ }
              jy))) →
    ¬color
          {
            toBallPackage :=
              { c := q.c, r := q.r, rpos := (_ : ∀ (b : β), 0 < BallPackage.r q b), r_bound := q.r_bound,
                r_le := (_ : ∀ (b : β), BallPackage.r q b ≤ q.r_bound) },
            τ := τ, one_lt_tau := hτ }
          jy =
        color
          {
            toBallPackage :=
              { c := q.c, r := q.r, rpos := (_ : ∀ (b : β), 0 < BallPackage.r q b), r_bound := q.r_bound,
                r_le := (_ : ∀ (b : β), BallPackage.r q b ≤ q.r_bound) },
            τ := τ, one_lt_tau := hτ }
          jx
⊢ (Disjoint on fun j => closedBall (BallPackage.c q j) (BallPackage.r q j)) (index p jx) (index p jy)

tactic: simpa only [jxi, jyi, and_true_iff, eq_self_iff_true, ← not_disjoint_iff_nonempty_inter] using h
state_before: α : Type u_1
inst✝ : MetricSpace α
β : Type u
N : ℕ
τ : ℝ
hτ : 1 < τ
hN : IsEmpty (SatelliteConfig α N τ)
q : BallPackage β α
h✝ : Nonempty β
p : TauPackage β α :=
  {
    toBallPackage :=
      { c := q.c, r := q.r, rpos := (_ : ∀ (b : β), 0 < BallPackage.r q b), r_bound := q.r_bound,
        r_le := (_ : ∀ (b : β), BallPackage.r q b ≤ q.r_bound) },
    τ := τ, one_lt_tau := hτ }
s : Fin N → Set β := fun i => ⋃ (k : Ordinal) (_ : k < lastStep p) (_ : color p k = ↑i), {index p k}
i : Fin N
jx : Ordinal
jx_lt : jx < lastStep p
jxi : color p jx = ↑i
hx : index p jx ∈ s i
jy : Ordinal
jy_lt : jy < lastStep p
jyi : color p jy = ↑i
hy : index p jy ∈ s i
x_ne_y : index p jx ≠ index p jy
jxy : jx < jy
A : Set ℕ :=
  ⋃ (j : { j // j < jy }) (_ :
    Set.Nonempty
      (closedBall (BallPackage.c p.toBallPackage (index p ↑j)) (BallPackage.r p.toBallPackage (index p ↑j)) ∩
        closedBall (BallPackage.c p.toBallPackage (index p jy)) (BallPackage.r p.toBallPackage (index p jy)))),
    {color p ↑j}
color_j : color p jy = sInf (univ \ A)
h :
  ¬(Disjoint on fun j => closedBall (BallPackage.c q j) (BallPackage.r q j))
      (index
        {
          toBallPackage :=
            { c := q.c, r := q.r, rpos := (_ : ∀ (b : β), 0 < BallPackage.r q b), r_bound := q.r_bound,
              r_le := (_ : ∀ (b : β), BallPackage.r q b ≤ q.r_bound) },
          τ := τ, one_lt_tau := hτ }
        jx)
      (index
        {
          toBallPackage :=
            { c := q.c, r := q.r, rpos := (_ : ∀ (b : β), 0 < BallPackage.r q b), r_bound := q.r_bound,
              r_le := (_ : ∀ (b : β), BallPackage.r q b ≤ q.r_bound) },
          τ := τ, one_lt_tau := hτ }
        jy)
⊢ Set.Nonempty
      (closedBall
          (BallPackage.c q
            (index
              {
                toBallPackage :=
                  { c := q.c, r := q.r, rpos := (_ : ∀ (b : β), 0 < BallPackage.r q b), r_bound := q.r_bound,
                    r_le := (_ : ∀ (b : β), BallPackage.r q b ≤ q.r_bound) },
                τ := τ, one_lt_tau := hτ }
              jx))
          (BallPackage.r q
            (index
              {
                toBallPackage :=
                  { c := q.c, r := q.r, rpos := (_ : ∀ (b : β), 0 < BallPackage.r q b), r_bound := q.r_bound,
                    r_le := (_ : ∀ (b : β), BallPackage.r q b ≤ q.r_bound) },
                τ := τ, one_lt_tau := hτ }
              jx)) ∩
        closedBall
          (BallPackage.c q
            (index
              {
                toBallPackage :=
                  { c := q.c, r := q.r, rpos := (_ : ∀ (b : β), 0 < BallPackage.r q b), r_bound := q.r_bound,
                    r_le := (_ : ∀ (b : β), BallPackage.r q b ≤ q.r_bound) },
                τ := τ, one_lt_tau := hτ }
              jy))
          (BallPackage.r q
            (index
              {
                toBallPackage :=
                  { c := q.c, r := q.r, rpos := (_ : ∀ (b : β), 0 < BallPackage.r q b), r_bound := q.r_bound,
                    r_le := (_ : ∀ (b : β), BallPackage.r q b ≤ q.r_bound) },
                τ := τ, one_lt_tau := hτ }
              jy))) ∧
    color
        {
          toBallPackage :=
            { c := q.c, r := q.r, rpos := (_ : ∀ (b : β), 0 < BallPackage.r q b), r_bound := q.r_bound,
              r_le := (_ : ∀ (b : β), BallPackage.r q b ≤ q.r_bound) },
          τ := τ, one_lt_tau := hτ }
        jy =
      color
        {
          toBallPackage :=
            { c := q.c, r := q.r, rpos := (_ : ∀ (b : β), 0 < BallPackage.r q b), r_bound := q.r_bound,
              r_le := (_ : ∀ (b : β), BallPackage.r q b ≤ q.r_bound) },
          τ := τ, one_lt_tau := hτ }
        jx

tactic: simpa only [exists_prop, mem_iUnion, mem_singleton_iff] using hx
state_before: α : Type u_1
inst✝ : MetricSpace α
β : Type u
N : ℕ
τ : ℝ
hτ : 1 < τ
hN : IsEmpty (SatelliteConfig α N τ)
q : BallPackage β α
h✝ : Nonempty β
p : TauPackage β α :=
  {
    toBallPackage :=
      { c := q.c, r := q.r, rpos := (_ : ∀ (b : β), 0 < BallPackage.r q b), r_bound := q.r_bound,
        r_le := (_ : ∀ (b : β), BallPackage.r q b ≤ q.r_bound) },
    τ := τ, one_lt_tau := hτ }
s : Fin N → Set β := fun i => ⋃ (k : Ordinal) (_ : k < lastStep p) (_ : color p k = ↑i), {index p k}
i : Fin N
x : β
hx : x ∈ s i
y : β
hy : y ∈ s i
x_ne_y : x ≠ y
⊢ ∃ jx, jx < lastStep p ∧ color p jx = ↑i ∧ x = index p jx

tactic: simpa only [exists_prop, mem_iUnion, mem_singleton_iff] using hy
state_before: α : Type u_1
inst✝ : MetricSpace α
β : Type u
N : ℕ
τ : ℝ
hτ : 1 < τ
hN : IsEmpty (SatelliteConfig α N τ)
q : BallPackage β α
h✝ : Nonempty β
p : TauPackage β α :=
  {
    toBallPackage :=
      { c := q.c, r := q.r, rpos := (_ : ∀ (b : β), 0 < BallPackage.r q b), r_bound := q.r_bound,
        r_le := (_ : ∀ (b : β), BallPackage.r q b ≤ q.r_bound) },
    τ := τ, one_lt_tau := hτ }
s : Fin N → Set β := fun i => ⋃ (k : Ordinal) (_ : k < lastStep p) (_ : color p k = ↑i), {index p k}
i : Fin N
y : β
hy : y ∈ s i
jx : Ordinal
jx_lt : jx < lastStep p
jxi : color p jx = ↑i
hx : index p jx ∈ s i
x_ne_y : index p jx ≠ y
⊢ ∃ jy, jy < lastStep p ∧ color p jy = ↑i ∧ y = index p jy

tactic: exact (this jy jy_lt jyi hy jx jx_lt jxi hx x_ne_y.symm (le_of_not_le jxy)).symm
state_before: case inr.refine'_1.intro.intro.intro.intro.intro.intro.inr
α : Type u_1
inst✝ : MetricSpace α
β : Type u
N : ℕ
τ : ℝ
hτ : 1 < τ
hN : IsEmpty (SatelliteConfig α N τ)
q : BallPackage β α
h✝ : Nonempty β
p : TauPackage β α :=
  {
    toBallPackage :=
      { c := q.c, r := q.r, rpos := (_ : ∀ (b : β), 0 < BallPackage.r q b), r_bound := q.r_bound,
        r_le := (_ : ∀ (b : β), BallPackage.r q b ≤ q.r_bound) },
    τ := τ, one_lt_tau := hτ }
s : Fin N → Set β := fun i => ⋃ (k : Ordinal) (_ : k < lastStep p) (_ : color p k = ↑i), {index p k}
i : Fin N
jx : Ordinal
jx_lt : jx < lastStep p
jxi : color p jx = ↑i
hx : index p jx ∈ s i
jy : Ordinal
jy_lt : jy < lastStep p
jyi : color p jy = ↑i
hy : index p jy ∈ s i
x_ne_y : index p jx ≠ index p jy
this :
  ∀ (jx : Ordinal),
    jx < lastStep p →
      color p jx = ↑i →
        index p jx ∈ s i →
          ∀ (jy : Ordinal),
            jy < lastStep p →
              color p jy = ↑i →
                index p jy ∈ s i →
                  index p jx ≠ index p jy →
                    jx ≤ jy →
                      (Disjoint on fun j => closedBall (BallPackage.c q j) (BallPackage.r q j)) (index p jx)
                        (index p jy)
jxy : ¬jx ≤ jy
⊢ (Disjoint on fun j => closedBall (BallPackage.c q j) (BallPackage.r q j)) (index p jx) (index p jy)

tactic: rcases lt_or_eq_of_le jxy with (H | rfl)
state_before: case jxy
α : Type u_1
inst✝ : MetricSpace α
β : Type u
N : ℕ
τ : ℝ
hτ : 1 < τ
hN : IsEmpty (SatelliteConfig α N τ)
q : BallPackage β α
h✝ : Nonempty β
p : TauPackage β α :=
  {
    toBallPackage :=
      { c := q.c, r := q.r, rpos := (_ : ∀ (b : β), 0 < BallPackage.r q b), r_bound := q.r_bound,
        r_le := (_ : ∀ (b : β), BallPackage.r q b ≤ q.r_bound) },
    τ := τ, one_lt_tau := hτ }
s : Fin N → Set β := fun i => ⋃ (k : Ordinal) (_ : k < lastStep p) (_ : color p k = ↑i), {index p k}
i : Fin N
jx : Ordinal
jx_lt : jx < lastStep p
jxi : color p jx = ↑i
hx : index p jx ∈ s i
jy : Ordinal
jy_lt : jy < lastStep p
jyi : color p jy = ↑i
hy : index p jy ∈ s i
x_ne_y : index p jx ≠ index p jy
jxy : jx ≤ jy
⊢ jx < jy

tactic: rw [TauPackage.color]
state_before: α : Type u_1
inst✝ : MetricSpace α
β : Type u
N : ℕ
τ : ℝ
hτ : 1 < τ
hN : IsEmpty (SatelliteConfig α N τ)
q : BallPackage β α
h✝ : Nonempty β
p : TauPackage β α :=
  {
    toBallPackage :=
      { c := q.c, r := q.r, rpos := (_ : ∀ (b : β), 0 < BallPackage.r q b), r_bound := q.r_bound,
        r_le := (_ : ∀ (b : β), BallPackage.r q b ≤ q.r_bound) },
    τ := τ, one_lt_tau := hτ }
s : Fin N → Set β := fun i => ⋃ (k : Ordinal) (_ : k < lastStep p) (_ : color p k = ↑i), {index p k}
i : Fin N
jx : Ordinal
jx_lt : jx < lastStep p
jxi : color p jx = ↑i
hx : index p jx ∈ s i
jy : Ordinal
jy_lt : jy < lastStep p
jyi : color p jy = ↑i
hy : index p jy ∈ s i
x_ne_y : index p jx ≠ index p jy
jxy : jx < jy
A : Set ℕ :=
  ⋃ (j : { j // j < jy }) (_ :
    Set.Nonempty
      (closedBall (BallPackage.c p.toBallPackage (index p ↑j)) (BallPackage.r p.toBallPackage (index p ↑j)) ∩
        closedBall (BallPackage.c p.toBallPackage (index p jy)) (BallPackage.r p.toBallPackage (index p jy)))),
    {color p ↑j}
⊢ color p jy = sInf (univ \ A)

tactic: rw [color_j]
state_before: α : Type u_1
inst✝ : MetricSpace α
β : Type u
N : ℕ
τ : ℝ
hτ : 1 < τ
hN : IsEmpty (SatelliteConfig α N τ)
q : BallPackage β α
h✝ : Nonempty β
p : TauPackage β α :=
  {
    toBallPackage :=
      { c := q.c, r := q.r, rpos := (_ : ∀ (b : β), 0 < BallPackage.r q b), r_bound := q.r_bound,
        r_le := (_ : ∀ (b : β), BallPackage.r q b ≤ q.r_bound) },
    τ := τ, one_lt_tau := hτ }
s : Fin N → Set β := fun i => ⋃ (k : Ordinal) (_ : k < lastStep p) (_ : color p k = ↑i), {index p k}
i : Fin N
jx : Ordinal
jx_lt : jx < lastStep p
jxi : color p jx = ↑i
hx : index p jx ∈ s i
jy : Ordinal
jy_lt : jy < lastStep p
jyi : color p jy = ↑i
hy : index p jy ∈ s i
x_ne_y : index p jx ≠ index p jy
jxy : jx < jy
A : Set ℕ :=
  ⋃ (j : { j // j < jy }) (_ :
    Set.Nonempty
      (closedBall (BallPackage.c p.toBallPackage (index p ↑j)) (BallPackage.r p.toBallPackage (index p ↑j)) ∩
        closedBall (BallPackage.c p.toBallPackage (index p jy)) (BallPackage.r p.toBallPackage (index p jy)))),
    {color p ↑j}
color_j : color p jy = sInf (univ \ A)
⊢ color p jy ∈ univ \ A

tactic: apply csInf_mem
state_before: α : Type u_1
inst✝ : MetricSpace α
β : Type u
N : ℕ
τ : ℝ
hτ : 1 < τ
hN : IsEmpty (SatelliteConfig α N τ)
q : BallPackage β α
h✝ : Nonempty β
p : TauPackage β α :=
  {
    toBallPackage :=
      { c := q.c, r := q.r, rpos := (_ : ∀ (b : β), 0 < BallPackage.r q b), r_bound := q.r_bound,
        r_le := (_ : ∀ (b : β), BallPackage.r q b ≤ q.r_bound) },
    τ := τ, one_lt_tau := hτ }
s : Fin N → Set β := fun i => ⋃ (k : Ordinal) (_ : k < lastStep p) (_ : color p k = ↑i), {index p k}
i : Fin N
jx : Ordinal
jx_lt : jx < lastStep p
jxi : color p jx = ↑i
hx : index p jx ∈ s i
jy : Ordinal
jy_lt : jy < lastStep p
jyi : color p jy = ↑i
hy : index p jy ∈ s i
x_ne_y : index p jx ≠ index p jy
jxy : jx < jy
A : Set ℕ :=
  ⋃ (j : { j // j < jy }) (_ :
    Set.Nonempty
      (closedBall (BallPackage.c p.toBallPackage (index p ↑j)) (BallPackage.r p.toBallPackage (index p ↑j)) ∩
        closedBall (BallPackage.c p.toBallPackage (index p jy)) (BallPackage.r p.toBallPackage (index p jy)))),
    {color p ↑j}
color_j : color p jy = sInf (univ \ A)
⊢ sInf (univ \ A) ∈ univ \ A

tactic: refine' ⟨N, _⟩
state_before: case hs
α : Type u_1
inst✝ : MetricSpace α
β : Type u
N : ℕ
τ : ℝ
hτ : 1 < τ
hN : IsEmpty (SatelliteConfig α N τ)
q : BallPackage β α
h✝ : Nonempty β
p : TauPackage β α :=
  {
    toBallPackage :=
      { c := q.c, r := q.r, rpos := (_ : ∀ (b : β), 0 < BallPackage.r q b), r_bound := q.r_bound,
        r_le := (_ : ∀ (b : β), BallPackage.r q b ≤ q.r_bound) },
    τ := τ, one_lt_tau := hτ }
s : Fin N → Set β := fun i => ⋃ (k : Ordinal) (_ : k < lastStep p) (_ : color p k = ↑i), {index p k}
i : Fin N
jx : Ordinal
jx_lt : jx < lastStep p
jxi : color p jx = ↑i
hx : index p jx ∈ s i
jy : Ordinal
jy_lt : jy < lastStep p
jyi : color p jy = ↑i
hy : index p jy ∈ s i
x_ne_y : index p jx ≠ index p jy
jxy : jx < jy
A : Set ℕ :=
  ⋃ (j : { j // j < jy }) (_ :
    Set.Nonempty
      (closedBall (BallPackage.c p.toBallPackage (index p ↑j)) (BallPackage.r p.toBallPackage (index p ↑j)) ∩
        closedBall (BallPackage.c p.toBallPackage (index p jy)) (BallPackage.r p.toBallPackage (index p jy)))),
    {color p ↑j}
color_j : color p jy = sInf (univ \ A)
⊢ Set.Nonempty (univ \ A)

tactic: simp only [not_exists, true_and_iff, exists_prop, mem_iUnion, mem_singleton_iff, not_and,
  mem_univ, mem_diff, Subtype.exists, Subtype.coe_mk]
state_before: case hs
α : Type u_1
inst✝ : MetricSpace α
β : Type u
N : ℕ
τ : ℝ
hτ : 1 < τ
hN : IsEmpty (SatelliteConfig α N τ)
q : BallPackage β α
h✝ : Nonempty β
p : TauPackage β α :=
  {
    toBallPackage :=
      { c := q.c, r := q.r, rpos := (_ : ∀ (b : β), 0 < BallPackage.r q b), r_bound := q.r_bound,
        r_le := (_ : ∀ (b : β), BallPackage.r q b ≤ q.r_bound) },
    τ := τ, one_lt_tau := hτ }
s : Fin N → Set β := fun i => ⋃ (k : Ordinal) (_ : k < lastStep p) (_ : color p k = ↑i), {index p k}
i : Fin N
jx : Ordinal
jx_lt : jx < lastStep p
jxi : color p jx = ↑i
hx : index p jx ∈ s i
jy : Ordinal
jy_lt : jy < lastStep p
jyi : color p jy = ↑i
hy : index p jy ∈ s i
x_ne_y : index p jx ≠ index p jy
jxy : jx < jy
A : Set ℕ :=
  ⋃ (j : { j // j < jy }) (_ :
    Set.Nonempty
      (closedBall (BallPackage.c p.toBallPackage (index p ↑j)) (BallPackage.r p.toBallPackage (index p ↑j)) ∩
        closedBall (BallPackage.c p.toBallPackage (index p jy)) (BallPackage.r p.toBallPackage (index p jy)))),
    {color p ↑j}
color_j : color p jy = sInf (univ \ A)
⊢ N ∈ univ \ A

tactic: intro k hk _
state_before: case hs
α : Type u_1
inst✝ : MetricSpace α
β : Type u
N : ℕ
τ : ℝ
hτ : 1 < τ
hN : IsEmpty (SatelliteConfig α N τ)
q : BallPackage β α
h✝ : Nonempty β
p : TauPackage β α :=
  {
    toBallPackage :=
      { c := q.c, r := q.r, rpos := (_ : ∀ (b : β), 0 < BallPackage.r q b), r_bound := q.r_bound,
        r_le := (_ : ∀ (b : β), BallPackage.r q b ≤ q.r_bound) },
    τ := τ, one_lt_tau := hτ }
s : Fin N → Set β := fun i => ⋃ (k : Ordinal) (_ : k < lastStep p) (_ : color p k = ↑i), {index p k}
i : Fin N
jx : Ordinal
jx_lt : jx < lastStep p
jxi : color p jx = ↑i
hx : index p jx ∈ s i
jy : Ordinal
jy_lt : jy < lastStep p
jyi : color p jy = ↑i
hy : index p jy ∈ s i
x_ne_y : index p jx ≠ index p jy
jxy : jx < jy
A : Set ℕ :=
  ⋃ (j : { j // j < jy }) (_ :
    Set.Nonempty
      (closedBall (BallPackage.c p.toBallPackage (index p ↑j)) (BallPackage.r p.toBallPackage (index p ↑j)) ∩
        closedBall (BallPackage.c p.toBallPackage (index p jy)) (BallPackage.r p.toBallPackage (index p jy)))),
    {color p ↑j}
color_j : color p jy = sInf (univ \ A)
⊢ ∀ (x : Ordinal),
    x < jy →
      Set.Nonempty
          (closedBall
              (BallPackage.c q
                (index
                  {
                    toBallPackage :=
                      { c := q.c, r := q.r, rpos := (_ : ∀ (b : β), 0 < BallPackage.r q b), r_bound := q.r_bound,
                        r_le := (_ : ∀ (b : β), BallPackage.r q b ≤ q.r_bound) },
                    τ := τ, one_lt_tau := hτ }
                  x))
              (BallPackage.r q
                (index
                  {
                    toBallPackage :=
                      { c := q.c, r := q.r, rpos := (_ : ∀ (b : β), 0 < BallPackage.r q b), r_bound := q.r_bound,
                        r_le := (_ : ∀ (b : β), BallPackage.r q b ≤ q.r_bound) },
                    τ := τ, one_lt_tau := hτ }
                  x)) ∩
            closedBall
              (BallPackage.c q
                (index
                  {
                    toBallPackage :=
                      { c := q.c, r := q.r, rpos := (_ : ∀ (b : β), 0 < BallPackage.r q b), r_bound := q.r_bound,
                        r_le := (_ : ∀ (b : β), BallPackage.r q b ≤ q.r_bound) },
                    τ := τ, one_lt_tau := hτ }
                  jy))
              (BallPackage.r q
                (index
                  {
                    toBallPackage :=
                      { c := q.c, r := q.r, rpos := (_ : ∀ (b : β), 0 < BallPackage.r q b), r_bound := q.r_bound,
                        r_le := (_ : ∀ (b : β), BallPackage.r q b ≤ q.r_bound) },
                    τ := τ, one_lt_tau := hτ }
                  jy))) →
        ¬N =
            color
              {
                toBallPackage :=
                  { c := q.c, r := q.r, rpos := (_ : ∀ (b : β), 0 < BallPackage.r q b), r_bound := q.r_bound,
                    r_le := (_ : ∀ (b : β), BallPackage.r q b ≤ q.r_bound) },
                τ := τ, one_lt_tau := hτ }
              x

tactic: exact (p.color_lt (hk.trans jy_lt) hN).ne'
state_before: case hs
α : Type u_1
inst✝ : MetricSpace α
β : Type u
N : ℕ
τ : ℝ
hτ : 1 < τ
hN : IsEmpty (SatelliteConfig α N τ)
q : BallPackage β α
h✝ : Nonempty β
p : TauPackage β α :=
  {
    toBallPackage :=
      { c := q.c, r := q.r, rpos := (_ : ∀ (b : β), 0 < BallPackage.r q b), r_bound := q.r_bound,
        r_le := (_ : ∀ (b : β), BallPackage.r q b ≤ q.r_bound) },
    τ := τ, one_lt_tau := hτ }
s : Fin N → Set β := fun i => ⋃ (k : Ordinal) (_ : k < lastStep p) (_ : color p k = ↑i), {index p k}
i : Fin N
jx : Ordinal
jx_lt : jx < lastStep p
jxi : color p jx = ↑i
hx : index p jx ∈ s i
jy : Ordinal
jy_lt : jy < lastStep p
jyi : color p jy = ↑i
hy : index p jy ∈ s i
x_ne_y : index p jx ≠ index p jy
jxy : jx < jy
A : Set ℕ :=
  ⋃ (j : { j // j < jy }) (_ :
    Set.Nonempty
      (closedBall (BallPackage.c p.toBallPackage (index p ↑j)) (BallPackage.r p.toBallPackage (index p ↑j)) ∩
        closedBall (BallPackage.c p.toBallPackage (index p jy)) (BallPackage.r p.toBallPackage (index p jy)))),
    {color p ↑j}
color_j : color p jy = sInf (univ \ A)
k : Ordinal
hk : k < jy
a✝ :
  Set.Nonempty
    (closedBall
        (BallPackage.c q
          (index
            {
              toBallPackage :=
                { c := q.c, r := q.r, rpos := (_ : ∀ (b : β), 0 < BallPackage.r q b), r_bound := q.r_bound,
                  r_le := (_ : ∀ (b : β), BallPackage.r q b ≤ q.r_bound) },
              τ := τ, one_lt_tau := hτ }
            k))
        (BallPackage.r q
          (index
            {
              toBallPackage :=
                { c := q.c, r := q.r, rpos := (_ : ∀ (b : β), 0 < BallPackage.r q b), r_bound := q.r_bound,
                  r_le := (_ : ∀ (b : β), BallPackage.r q b ≤ q.r_bound) },
              τ := τ, one_lt_tau := hτ }
            k)) ∩
      closedBall
        (BallPackage.c q
          (index
            {
              toBallPackage :=
                { c := q.c, r := q.r, rpos := (_ : ∀ (b : β), 0 < BallPackage.r q b), r_bound := q.r_bound,
                  r_le := (_ : ∀ (b : β), BallPackage.r q b ≤ q.r_bound) },
              τ := τ, one_lt_tau := hτ }
            jy))
        (BallPackage.r q
          (index
            {
              toBallPackage :=
                { c := q.c, r := q.r, rpos := (_ : ∀ (b : β), 0 < BallPackage.r q b), r_bound := q.r_bound,
                  r_le := (_ : ∀ (b : β), BallPackage.r q b ≤ q.r_bound) },
              τ := τ, one_lt_tau := hτ }
            jy)))
⊢ ¬N =
      color
        {
          toBallPackage :=
            { c := q.c, r := q.r, rpos := (_ : ∀ (b : β), 0 < BallPackage.r q b), r_bound := q.r_bound,
              r_le := (_ : ∀ (b : β), BallPackage.r q b ≤ q.r_bound) },
          τ := τ, one_lt_tau := hτ }
        k

tactic: refine' range_subset_iff.2 fun b => _
state_before: case inr.refine'_2
α : Type u_1
inst✝ : MetricSpace α
β : Type u
N : ℕ
τ : ℝ
hτ : 1 < τ
hN : IsEmpty (SatelliteConfig α N τ)
q : BallPackage β α
h✝ : Nonempty β
p : TauPackage β α :=
  {
    toBallPackage :=
      { c := q.c, r := q.r, rpos := (_ : ∀ (b : β), 0 < BallPackage.r q b), r_bound := q.r_bound,
        r_le := (_ : ∀ (b : β), BallPackage.r q b ≤ q.r_bound) },
    τ := τ, one_lt_tau := hτ }
s : Fin N → Set β := fun i => ⋃ (k : Ordinal) (_ : k < lastStep p) (_ : color p k = ↑i), {index p k}
⊢ range q.c ⊆ ⋃ (i : Fin N) (j : β) (_ : j ∈ s i), ball (BallPackage.c q j) (BallPackage.r q j)

tactic: obtain ⟨a, ha⟩ :
  ∃ a : Ordinal, a < p.lastStep ∧ dist (p.c b) (p.c (p.index a)) < p.r (p.index a) := by
  simpa only [iUnionUpTo, exists_prop, mem_iUnion, mem_ball, Subtype.exists,
    Subtype.coe_mk] using p.mem_iUnionUpTo_lastStep b
state_before: case inr.refine'_2
α : Type u_1
inst✝ : MetricSpace α
β : Type u
N : ℕ
τ : ℝ
hτ : 1 < τ
hN : IsEmpty (SatelliteConfig α N τ)
q : BallPackage β α
h✝ : Nonempty β
p : TauPackage β α :=
  {
    toBallPackage :=
      { c := q.c, r := q.r, rpos := (_ : ∀ (b : β), 0 < BallPackage.r q b), r_bound := q.r_bound,
        r_le := (_ : ∀ (b : β), BallPackage.r q b ≤ q.r_bound) },
    τ := τ, one_lt_tau := hτ }
s : Fin N → Set β := fun i => ⋃ (k : Ordinal) (_ : k < lastStep p) (_ : color p k = ↑i), {index p k}
b : β
⊢ BallPackage.c q b ∈ ⋃ (i : Fin N) (j : β) (_ : j ∈ s i), ball (BallPackage.c q j) (BallPackage.r q j)

tactic: simp only [exists_prop, mem_iUnion, mem_ball, mem_singleton_iff, biUnion_and', exists_eq_left,
  iUnion_exists, exists_and_left]
state_before: case inr.refine'_2.intro
α : Type u_1
inst✝ : MetricSpace α
β : Type u
N : ℕ
τ : ℝ
hτ : 1 < τ
hN : IsEmpty (SatelliteConfig α N τ)
q : BallPackage β α
h✝ : Nonempty β
p : TauPackage β α :=
  {
    toBallPackage :=
      { c := q.c, r := q.r, rpos := (_ : ∀ (b : β), 0 < BallPackage.r q b), r_bound := q.r_bound,
        r_le := (_ : ∀ (b : β), BallPackage.r q b ≤ q.r_bound) },
    τ := τ, one_lt_tau := hτ }
s : Fin N → Set β := fun i => ⋃ (k : Ordinal) (_ : k < lastStep p) (_ : color p k = ↑i), {index p k}
b : β
a : Ordinal
ha :
  a < lastStep p ∧
    dist (BallPackage.c p.toBallPackage b) (BallPackage.c p.toBallPackage (index p a)) <
      BallPackage.r p.toBallPackage (index p a)
⊢ BallPackage.c q b ∈ ⋃ (i : Fin N) (j : β) (_ : j ∈ s i), ball (BallPackage.c q j) (BallPackage.r q j)

tactic: exact ⟨⟨p.color a, p.color_lt ha.1 hN⟩, a, rfl, ha⟩
state_before: case inr.refine'_2.intro
α : Type u_1
inst✝ : MetricSpace α
β : Type u
N : ℕ
τ : ℝ
hτ : 1 < τ
hN : IsEmpty (SatelliteConfig α N τ)
q : BallPackage β α
h✝ : Nonempty β
p : TauPackage β α :=
  {
    toBallPackage :=
      { c := q.c, r := q.r, rpos := (_ : ∀ (b : β), 0 < BallPackage.r q b), r_bound := q.r_bound,
        r_le := (_ : ∀ (b : β), BallPackage.r q b ≤ q.r_bound) },
    τ := τ, one_lt_tau := hτ }
s : Fin N → Set β := fun i => ⋃ (k : Ordinal) (_ : k < lastStep p) (_ : color p k = ↑i), {index p k}
b : β
a : Ordinal
ha :
  a < lastStep p ∧
    dist (BallPackage.c p.toBallPackage b) (BallPackage.c p.toBallPackage (index p a)) <
      BallPackage.r p.toBallPackage (index p a)
⊢ ∃ i i_1,
    color
          {
            toBallPackage :=
              { c := q.c, r := q.r, rpos := (_ : ∀ (b : β), 0 < BallPackage.r q b), r_bound := q.r_bound,
                r_le := (_ : ∀ (b : β), BallPackage.r q b ≤ q.r_bound) },
            τ := τ, one_lt_tau := hτ }
          i_1 =
        ↑i ∧
      i_1 <
          lastStep
            {
              toBallPackage :=
                { c := q.c, r := q.r, rpos := (_ : ∀ (b : β), 0 < BallPackage.r q b), r_bound := q.r_bound,
                  r_le := (_ : ∀ (b : β), BallPackage.r q b ≤ q.r_bound) },
              τ := τ, one_lt_tau := hτ } ∧
        dist (BallPackage.c q b)
            (BallPackage.c q
              (index
                {
                  toBallPackage :=
                    { c := q.c, r := q.r, rpos := (_ : ∀ (b : β), 0 < BallPackage.r q b), r_bound := q.r_bound,
                      r_le := (_ : ∀ (b : β), BallPackage.r q b ≤ q.r_bound) },
                  τ := τ, one_lt_tau := hτ }
                i_1)) <
          BallPackage.r q
            (index
              {
                toBallPackage :=
                  { c := q.c, r := q.r, rpos := (_ : ∀ (b : β), 0 < BallPackage.r q b), r_bound := q.r_bound,
                    r_le := (_ : ∀ (b : β), BallPackage.r q b ≤ q.r_bound) },
                τ := τ, one_lt_tau := hτ }
              i_1)

tactic: simpa only [iUnionUpTo, exists_prop, mem_iUnion, mem_ball, Subtype.exists,
  Subtype.coe_mk] using p.mem_iUnionUpTo_lastStep b
state_before: α : Type u_1
inst✝ : MetricSpace α
β : Type u
N : ℕ
τ : ℝ
hτ : 1 < τ
hN : IsEmpty (SatelliteConfig α N τ)
q : BallPackage β α
h✝ : Nonempty β
p : TauPackage β α :=
  {
    toBallPackage :=
      { c := q.c, r := q.r, rpos := (_ : ∀ (b : β), 0 < BallPackage.r q b), r_bound := q.r_bound,
        r_le := (_ : ∀ (b : β), BallPackage.r q b ≤ q.r_bound) },
    τ := τ, one_lt_tau := hτ }
s : Fin N → Set β := fun i => ⋃ (k : Ordinal) (_ : k < lastStep p) (_ : color p k = ↑i), {index p k}
b : β
⊢ ∃ a,
    a < lastStep p ∧
      dist (BallPackage.c p.toBallPackage b) (BallPackage.c p.toBallPackage (index p a)) <
        BallPackage.r p.toBallPackage (index p a)