Theorem: Besicovitch.TauPackage.mem_iUnionUpTo_lastStep
File: Mathlib/MeasureTheory/Covering/Besicovitch.lean

tactic: have A : ∀ z : β, p.c z ∈ p.iUnionUpTo p.lastStep ∨ p.τ * p.r z < p.R p.lastStep := by
  have : p.lastStep ∈ {i | ¬∃ b : β, p.c b ∉ p.iUnionUpTo i ∧ p.R i ≤ p.τ * p.r b} :=
    csInf_mem p.lastStep_nonempty
  simpa only [not_exists, mem_setOf_eq, not_and_or, not_le, not_not_mem]
state_before: α : Type u_1
inst✝¹ : MetricSpace α
β : Type u
inst✝ : Nonempty β
p : TauPackage β α
x : β
⊢ BallPackage.c p.toBallPackage x ∈ iUnionUpTo p (lastStep p)

tactic: by_contra h
state_before: α : Type u_1
inst✝¹ : MetricSpace α
β : Type u
inst✝ : Nonempty β
p : TauPackage β α
x : β
A :
  ∀ (z : β),
    BallPackage.c p.toBallPackage z ∈ iUnionUpTo p (lastStep p) ∨
      p.τ * BallPackage.r p.toBallPackage z < R p (lastStep p)
⊢ BallPackage.c p.toBallPackage x ∈ iUnionUpTo p (lastStep p)

tactic: rcases A x with (H | H)
state_before: α : Type u_1
inst✝¹ : MetricSpace α
β : Type u
inst✝ : Nonempty β
p : TauPackage β α
x : β
A :
  ∀ (z : β),
    BallPackage.c p.toBallPackage z ∈ iUnionUpTo p (lastStep p) ∨
      p.τ * BallPackage.r p.toBallPackage z < R p (lastStep p)
h : ¬BallPackage.c p.toBallPackage x ∈ iUnionUpTo p (lastStep p)
⊢ False

tactic: have Rpos : 0 < p.R p.lastStep := by
  apply lt_trans (mul_pos (_root_.zero_lt_one.trans p.one_lt_tau) (p.rpos _)) H
state_before: case inr
α : Type u_1
inst✝¹ : MetricSpace α
β : Type u
inst✝ : Nonempty β
p : TauPackage β α
x : β
A :
  ∀ (z : β),
    BallPackage.c p.toBallPackage z ∈ iUnionUpTo p (lastStep p) ∨
      p.τ * BallPackage.r p.toBallPackage z < R p (lastStep p)
h : ¬BallPackage.c p.toBallPackage x ∈ iUnionUpTo p (lastStep p)
H : p.τ * BallPackage.r p.toBallPackage x < R p (lastStep p)
⊢ False

tactic: have B : p.τ⁻¹ * p.R p.lastStep < p.R p.lastStep := by
  conv_rhs => rw [← one_mul (p.R p.lastStep)]
  exact mul_lt_mul (inv_lt_one p.one_lt_tau) le_rfl Rpos zero_le_one
state_before: case inr
α : Type u_1
inst✝¹ : MetricSpace α
β : Type u
inst✝ : Nonempty β
p : TauPackage β α
x : β
A :
  ∀ (z : β),
    BallPackage.c p.toBallPackage z ∈ iUnionUpTo p (lastStep p) ∨
      p.τ * BallPackage.r p.toBallPackage z < R p (lastStep p)
h : ¬BallPackage.c p.toBallPackage x ∈ iUnionUpTo p (lastStep p)
H : p.τ * BallPackage.r p.toBallPackage x < R p (lastStep p)
Rpos : 0 < R p (lastStep p)
⊢ False

tactic: rcases A y with (Hy | Hy)
state_before: case inr.intro.intro
α : Type u_1
inst✝¹ : MetricSpace α
β : Type u
inst✝ : Nonempty β
p : TauPackage β α
x : β
A :
  ∀ (z : β),
    BallPackage.c p.toBallPackage z ∈ iUnionUpTo p (lastStep p) ∨
      p.τ * BallPackage.r p.toBallPackage z < R p (lastStep p)
h : ¬BallPackage.c p.toBallPackage x ∈ iUnionUpTo p (lastStep p)
H : p.τ * BallPackage.r p.toBallPackage x < R p (lastStep p)
Rpos : 0 < R p (lastStep p)
B : p.τ⁻¹ * R p (lastStep p) < R p (lastStep p)
y : β
hy1 : ¬BallPackage.c p.toBallPackage y ∈ iUnionUpTo p (lastStep p)
hy2 : p.τ⁻¹ * R p (lastStep p) < BallPackage.r p.toBallPackage y
⊢ False

tactic: have : p.lastStep ∈ {i | ¬∃ b : β, p.c b ∉ p.iUnionUpTo i ∧ p.R i ≤ p.τ * p.r b} :=
  csInf_mem p.lastStep_nonempty
state_before: α : Type u_1
inst✝¹ : MetricSpace α
β : Type u
inst✝ : Nonempty β
p : TauPackage β α
x : β
⊢ ∀ (z : β),
    BallPackage.c p.toBallPackage z ∈ iUnionUpTo p (lastStep p) ∨
      p.τ * BallPackage.r p.toBallPackage z < R p (lastStep p)

tactic: simpa only [not_exists, mem_setOf_eq, not_and_or, not_le, not_not_mem]
state_before: α : Type u_1
inst✝¹ : MetricSpace α
β : Type u
inst✝ : Nonempty β
p : TauPackage β α
x : β
this :
  lastStep p ∈
    {i | ¬∃ b, ¬BallPackage.c p.toBallPackage b ∈ iUnionUpTo p i ∧ R p i ≤ p.τ * BallPackage.r p.toBallPackage b}
⊢ ∀ (z : β),
    BallPackage.c p.toBallPackage z ∈ iUnionUpTo p (lastStep p) ∨
      p.τ * BallPackage.r p.toBallPackage z < R p (lastStep p)

tactic: exact h H
state_before: case inl
α : Type u_1
inst✝¹ : MetricSpace α
β : Type u
inst✝ : Nonempty β
p : TauPackage β α
x : β
A :
  ∀ (z : β),
    BallPackage.c p.toBallPackage z ∈ iUnionUpTo p (lastStep p) ∨
      p.τ * BallPackage.r p.toBallPackage z < R p (lastStep p)
h : ¬BallPackage.c p.toBallPackage x ∈ iUnionUpTo p (lastStep p)
H : BallPackage.c p.toBallPackage x ∈ iUnionUpTo p (lastStep p)
⊢ False

tactic: apply lt_trans (mul_pos (_root_.zero_lt_one.trans p.one_lt_tau) (p.rpos _)) H
state_before: α : Type u_1
inst✝¹ : MetricSpace α
β : Type u
inst✝ : Nonempty β
p : TauPackage β α
x : β
A :
  ∀ (z : β),
    BallPackage.c p.toBallPackage z ∈ iUnionUpTo p (lastStep p) ∨
      p.τ * BallPackage.r p.toBallPackage z < R p (lastStep p)
h : ¬BallPackage.c p.toBallPackage x ∈ iUnionUpTo p (lastStep p)
H : p.τ * BallPackage.r p.toBallPackage x < R p (lastStep p)
⊢ 0 < R p (lastStep p)

tactic: conv_rhs => rw [← one_mul (p.R p.lastStep)]
state_before: α : Type u_1
inst✝¹ : MetricSpace α
β : Type u
inst✝ : Nonempty β
p : TauPackage β α
x : β
A :
  ∀ (z : β),
    BallPackage.c p.toBallPackage z ∈ iUnionUpTo p (lastStep p) ∨
      p.τ * BallPackage.r p.toBallPackage z < R p (lastStep p)
h : ¬BallPackage.c p.toBallPackage x ∈ iUnionUpTo p (lastStep p)
H : p.τ * BallPackage.r p.toBallPackage x < R p (lastStep p)
Rpos : 0 < R p (lastStep p)
⊢ p.τ⁻¹ * R p (lastStep p) < R p (lastStep p)

tactic: exact mul_lt_mul (inv_lt_one p.one_lt_tau) le_rfl Rpos zero_le_one
state_before: α : Type u_1
inst✝¹ : MetricSpace α
β : Type u
inst✝ : Nonempty β
p : TauPackage β α
x : β
A :
  ∀ (z : β),
    BallPackage.c p.toBallPackage z ∈ iUnionUpTo p (lastStep p) ∨
      p.τ * BallPackage.r p.toBallPackage z < R p (lastStep p)
h : ¬BallPackage.c p.toBallPackage x ∈ iUnionUpTo p (lastStep p)
H : p.τ * BallPackage.r p.toBallPackage x < R p (lastStep p)
Rpos : 0 < R p (lastStep p)
⊢ p.τ⁻¹ * R p (lastStep p) < 1 * R p (lastStep p)

tactic: have := exists_lt_of_lt_csSup ?_ B
state_before: α : Type u_1
inst✝¹ : MetricSpace α
β : Type u
inst✝ : Nonempty β
p : TauPackage β α
x : β
A :
  ∀ (z : β),
    BallPackage.c p.toBallPackage z ∈ iUnionUpTo p (lastStep p) ∨
      p.τ * BallPackage.r p.toBallPackage z < R p (lastStep p)
h : ¬BallPackage.c p.toBallPackage x ∈ iUnionUpTo p (lastStep p)
H : p.τ * BallPackage.r p.toBallPackage x < R p (lastStep p)
Rpos : 0 < R p (lastStep p)
B : p.τ⁻¹ * R p (lastStep p) < R p (lastStep p)
⊢ ∃ y,
    ¬BallPackage.c p.toBallPackage y ∈ iUnionUpTo p (lastStep p) ∧
      p.τ⁻¹ * R p (lastStep p) < BallPackage.r p.toBallPackage y

tactic: rw [← image_univ, nonempty_image_iff]
state_before: case refine_1
α : Type u_1
inst✝¹ : MetricSpace α
β : Type u
inst✝ : Nonempty β
p : TauPackage β α
x : β
A :
  ∀ (z : β),
    BallPackage.c p.toBallPackage z ∈ iUnionUpTo p (lastStep p) ∨
      p.τ * BallPackage.r p.toBallPackage z < R p (lastStep p)
h : ¬BallPackage.c p.toBallPackage x ∈ iUnionUpTo p (lastStep p)
H : p.τ * BallPackage.r p.toBallPackage x < R p (lastStep p)
Rpos : 0 < R p (lastStep p)
B : p.τ⁻¹ * R p (lastStep p) < R p (lastStep p)
⊢ Set.Nonempty (range fun b => BallPackage.r p.toBallPackage ↑b)

tactic: exact ⟨⟨_, h⟩, mem_univ _⟩
state_before: case refine_1
α : Type u_1
inst✝¹ : MetricSpace α
β : Type u
inst✝ : Nonempty β
p : TauPackage β α
x : β
A :
  ∀ (z : β),
    BallPackage.c p.toBallPackage z ∈ iUnionUpTo p (lastStep p) ∨
      p.τ * BallPackage.r p.toBallPackage z < R p (lastStep p)
h : ¬BallPackage.c p.toBallPackage x ∈ iUnionUpTo p (lastStep p)
H : p.τ * BallPackage.r p.toBallPackage x < R p (lastStep p)
Rpos : 0 < R p (lastStep p)
B : p.τ⁻¹ * R p (lastStep p) < R p (lastStep p)
⊢ Set.Nonempty univ

tactic: simpa only [exists_prop, mem_range, exists_exists_and_eq_and, Subtype.exists,
Subtype.coe_mk]
state_before: case refine_2
α : Type u_1
inst✝¹ : MetricSpace α
β : Type u
inst✝ : Nonempty β
p : TauPackage β α
x : β
A :
  ∀ (z : β),
    BallPackage.c p.toBallPackage z ∈ iUnionUpTo p (lastStep p) ∨
      p.τ * BallPackage.r p.toBallPackage z < R p (lastStep p)
h : ¬BallPackage.c p.toBallPackage x ∈ iUnionUpTo p (lastStep p)
H : p.τ * BallPackage.r p.toBallPackage x < R p (lastStep p)
Rpos : 0 < R p (lastStep p)
B : p.τ⁻¹ * R p (lastStep p) < R p (lastStep p)
this : ∃ a, (a ∈ range fun b => BallPackage.r p.toBallPackage ↑b) ∧ p.τ⁻¹ * R p (lastStep p) < a
⊢ ∃ y,
    ¬BallPackage.c p.toBallPackage y ∈ iUnionUpTo p (lastStep p) ∧
      p.τ⁻¹ * R p (lastStep p) < BallPackage.r p.toBallPackage y

tactic: exact hy1 Hy
state_before: case inr.intro.intro.inl
α : Type u_1
inst✝¹ : MetricSpace α
β : Type u
inst✝ : Nonempty β
p : TauPackage β α
x : β
A :
  ∀ (z : β),
    BallPackage.c p.toBallPackage z ∈ iUnionUpTo p (lastStep p) ∨
      p.τ * BallPackage.r p.toBallPackage z < R p (lastStep p)
h : ¬BallPackage.c p.toBallPackage x ∈ iUnionUpTo p (lastStep p)
H : p.τ * BallPackage.r p.toBallPackage x < R p (lastStep p)
Rpos : 0 < R p (lastStep p)
B : p.τ⁻¹ * R p (lastStep p) < R p (lastStep p)
y : β
hy1 : ¬BallPackage.c p.toBallPackage y ∈ iUnionUpTo p (lastStep p)
hy2 : p.τ⁻¹ * R p (lastStep p) < BallPackage.r p.toBallPackage y
Hy : BallPackage.c p.toBallPackage y ∈ iUnionUpTo p (lastStep p)
⊢ False

tactic: rw [← div_eq_inv_mul] at hy2
state_before: case inr.intro.intro.inr
α : Type u_1
inst✝¹ : MetricSpace α
β : Type u
inst✝ : Nonempty β
p : TauPackage β α
x : β
A :
  ∀ (z : β),
    BallPackage.c p.toBallPackage z ∈ iUnionUpTo p (lastStep p) ∨
      p.τ * BallPackage.r p.toBallPackage z < R p (lastStep p)
h : ¬BallPackage.c p.toBallPackage x ∈ iUnionUpTo p (lastStep p)
H : p.τ * BallPackage.r p.toBallPackage x < R p (lastStep p)
Rpos : 0 < R p (lastStep p)
B : p.τ⁻¹ * R p (lastStep p) < R p (lastStep p)
y : β
hy1 : ¬BallPackage.c p.toBallPackage y ∈ iUnionUpTo p (lastStep p)
hy2 : p.τ⁻¹ * R p (lastStep p) < BallPackage.r p.toBallPackage y
Hy : p.τ * BallPackage.r p.toBallPackage y < R p (lastStep p)
⊢ False

tactic: have := (div_le_iff' (_root_.zero_lt_one.trans p.one_lt_tau)).1 hy2.le
state_before: case inr.intro.intro.inr
α : Type u_1
inst✝¹ : MetricSpace α
β : Type u
inst✝ : Nonempty β
p : TauPackage β α
x : β
A :
  ∀ (z : β),
    BallPackage.c p.toBallPackage z ∈ iUnionUpTo p (lastStep p) ∨
      p.τ * BallPackage.r p.toBallPackage z < R p (lastStep p)
h : ¬BallPackage.c p.toBallPackage x ∈ iUnionUpTo p (lastStep p)
H : p.τ * BallPackage.r p.toBallPackage x < R p (lastStep p)
Rpos : 0 < R p (lastStep p)
B : p.τ⁻¹ * R p (lastStep p) < R p (lastStep p)
y : β
hy1 : ¬BallPackage.c p.toBallPackage y ∈ iUnionUpTo p (lastStep p)
hy2 : R p (lastStep p) / p.τ < BallPackage.r p.toBallPackage y
Hy : p.τ * BallPackage.r p.toBallPackage y < R p (lastStep p)
⊢ False

tactic: exact lt_irrefl _ (Hy.trans_le this)
state_before: case inr.intro.intro.inr
α : Type u_1
inst✝¹ : MetricSpace α
β : Type u
inst✝ : Nonempty β
p : TauPackage β α
x : β
A :
  ∀ (z : β),
    BallPackage.c p.toBallPackage z ∈ iUnionUpTo p (lastStep p) ∨
      p.τ * BallPackage.r p.toBallPackage z < R p (lastStep p)
h : ¬BallPackage.c p.toBallPackage x ∈ iUnionUpTo p (lastStep p)
H : p.τ * BallPackage.r p.toBallPackage x < R p (lastStep p)
Rpos : 0 < R p (lastStep p)
B : p.τ⁻¹ * R p (lastStep p) < R p (lastStep p)
y : β
hy1 : ¬BallPackage.c p.toBallPackage y ∈ iUnionUpTo p (lastStep p)
hy2 : R p (lastStep p) / p.τ < BallPackage.r p.toBallPackage y
Hy : p.τ * BallPackage.r p.toBallPackage y < R p (lastStep p)
this : R p (lastStep p) ≤ p.τ * BallPackage.r p.toBallPackage y
⊢ False