Theorem: beattySeq_symmDiff_beattySeq'_pos
File: Mathlib/NumberTheory/Rayleigh.lean

tactic: apply Set.eq_of_subset_of_subset
state_before: r s : ℝ
hrs : r.IsConjExponent s
⊢ {x | ∃ k > 0, beattySeq r k = x} ∆ {x | ∃ k > 0, beattySeq' s k = x} = {n | 0 < n}
state_after: case a
r s : ℝ
hrs : r.IsConjExponent s
⊢ {x | ∃ k > 0, beattySeq r k = x} ∆ {x | ∃ k > 0, beattySeq' s k = x} ⊆ {n | 0 < n}

case a
r s : ℝ
hrs : r.IsConjExponent s
⊢ {n | 0 < n} ⊆ {x | ∃ k > 0, beattySeq r k = x} ∆ {x | ∃ k > 0, beattySeq' s k = x}

tactic: intro j (hj : 0 < j)
state_before: case a
r s : ℝ
hrs : r.IsConjExponent s
⊢ {n | 0 < n} ⊆ {x | ∃ k > 0, beattySeq r k = x} ∆ {x | ∃ k > 0, beattySeq' s k = x}
state_after: case a
r s : ℝ
hrs : r.IsConjExponent s
j : ℤ
hj : 0 < j
⊢ j ∈ {x | ∃ k > 0, beattySeq r k = x} ∆ {x | ∃ k > 0, beattySeq' s k = x}

tactic: have hb₁ : ∀ s ≥ 0, j ∈ {beattySeq s k | k > 0} ↔ j ∈ {beattySeq s k | k} := by
  intro _ hs
  refine ⟨fun ⟨k, _, hk⟩ ↦ ⟨k, hk⟩, fun ⟨k, hk⟩ ↦ ⟨k, ?_, hk⟩⟩
  rw [← hk, beattySeq, Int.floor_pos] at hj
  exact_mod_cast pos_of_mul_pos_left (zero_lt_one.trans_le hj) hs
state_before: case a
r s : ℝ
hrs : r.IsConjExponent s
j : ℤ
hj : 0 < j
⊢ j ∈ {x | ∃ k > 0, beattySeq r k = x} ∆ {x | ∃ k > 0, beattySeq' s k = x}
state_after: case a
r s : ℝ
hrs : r.IsConjExponent s
j : ℤ
hj : 0 < j
hb₁ : ∀ s ≥ 0, j ∈ {x | ∃ k > 0, beattySeq s k = x} ↔ j ∈ {x | ∃ k, beattySeq s k = x}
⊢ j ∈ {x | ∃ k > 0, beattySeq r k = x} ∆ {x | ∃ k > 0, beattySeq' s k = x}

tactic: have hb₂ : ∀ s ≥ 0, j ∈ {beattySeq' s k | k > 0} ↔ j ∈ {beattySeq' s k | k} := by
  intro _ hs
  refine ⟨fun ⟨k, _, hk⟩ ↦ ⟨k, hk⟩, fun ⟨k, hk⟩ ↦ ⟨k, ?_, hk⟩⟩
  rw [← hk, beattySeq', sub_pos, Int.lt_ceil, Int.cast_one] at hj
  exact_mod_cast pos_of_mul_pos_left (zero_lt_one.trans hj) hs
state_before: case a
r s : ℝ
hrs : r.IsConjExponent s
j : ℤ
hj : 0 < j
hb₁ : ∀ s ≥ 0, j ∈ {x | ∃ k > 0, beattySeq s k = x} ↔ j ∈ {x | ∃ k, beattySeq s k = x}
⊢ j ∈ {x | ∃ k > 0, beattySeq r k = x} ∆ {x | ∃ k > 0, beattySeq' s k = x}
state_after: case a
r s : ℝ
hrs : r.IsConjExponent s
j : ℤ
hj : 0 < j
hb₁ : ∀ s ≥ 0, j ∈ {x | ∃ k > 0, beattySeq s k = x} ↔ j ∈ {x | ∃ k, beattySeq s k = x}
hb₂ : ∀ s ≥ 0, j ∈ {x | ∃ k > 0, beattySeq' s k = x} ↔ j ∈ {x | ∃ k, beattySeq' s k = x}
⊢ j ∈ {x | ∃ k > 0, beattySeq r k = x} ∆ {x | ∃ k > 0, beattySeq' s k = x}

tactic: rw [Set.mem_symmDiff, hb₁ _ hrs.nonneg, hb₂ _ hrs.symm.nonneg, ← compl_beattySeq hrs,
  Set.not_mem_compl_iff, Set.mem_compl_iff, and_self, and_self]
state_before: case a
r s : ℝ
hrs : r.IsConjExponent s
j : ℤ
hj : 0 < j
hb₁ : ∀ s ≥ 0, j ∈ {x | ∃ k > 0, beattySeq s k = x} ↔ j ∈ {x | ∃ k, beattySeq s k = x}
hb₂ : ∀ s ≥ 0, j ∈ {x | ∃ k > 0, beattySeq' s k = x} ↔ j ∈ {x | ∃ k, beattySeq' s k = x}
⊢ j ∈ {x | ∃ k > 0, beattySeq r k = x} ∆ {x | ∃ k > 0, beattySeq' s k = x}
state_after: case a
r s : ℝ
hrs : r.IsConjExponent s
j : ℤ
hj : 0 < j
hb₁ : ∀ s ≥ 0, j ∈ {x | ∃ k > 0, beattySeq s k = x} ↔ j ∈ {x | ∃ k, beattySeq s k = x}
hb₂ : ∀ s ≥ 0, j ∈ {x | ∃ k > 0, beattySeq' s k = x} ↔ j ∈ {x | ∃ k, beattySeq' s k = x}
⊢ j ∈ {x | ∃ k, beattySeq r k = x} ∨ j ∉ {x | ∃ k, beattySeq r k = x}

tactic: exact or_not
state_before: case a
r s : ℝ
hrs : r.IsConjExponent s
j : ℤ
hj : 0 < j
hb₁ : ∀ s ≥ 0, j ∈ {x | ∃ k > 0, beattySeq s k = x} ↔ j ∈ {x | ∃ k, beattySeq s k = x}
hb₂ : ∀ s ≥ 0, j ∈ {x | ∃ k > 0, beattySeq' s k = x} ↔ j ∈ {x | ∃ k, beattySeq' s k = x}
⊢ j ∈ {x | ∃ k, beattySeq r k = x} ∨ j ∉ {x | ∃ k, beattySeq r k = x}
state_after: no goals

tactic: rintro j (⟨⟨k, hk, hjk⟩, -⟩ | ⟨⟨k, hk, hjk⟩, -⟩)
state_before: case a
r s : ℝ
hrs : r.IsConjExponent s
⊢ {x | ∃ k > 0, beattySeq r k = x} ∆ {x | ∃ k > 0, beattySeq' s k = x} ⊆ {n | 0 < n}
state_after: case a.inl.intro.intro.intro
r s : ℝ
hrs : r.IsConjExponent s
j k : ℤ
hk : k > 0
hjk : beattySeq r k = j
⊢ j ∈ {n | 0 < n}

case a.inr.intro.intro.intro
r s : ℝ
hrs : r.IsConjExponent s
j k : ℤ
hk : k > 0
hjk : beattySeq' s k = j
⊢ j ∈ {n | 0 < n}

tactic: rw [Set.mem_setOf_eq, ← hjk, beattySeq, Int.floor_pos]
state_before: case a.inl.intro.intro.intro
r s : ℝ
hrs : r.IsConjExponent s
j k : ℤ
hk : k > 0
hjk : beattySeq r k = j
⊢ j ∈ {n | 0 < n}
state_after: case a.inl.intro.intro.intro
r s : ℝ
hrs : r.IsConjExponent s
j k : ℤ
hk : k > 0
hjk : beattySeq r k = j
⊢ 1 ≤ ↑k * r

tactic: exact one_le_mul_of_one_le_of_one_le (by norm_cast) hrs.one_lt.le
state_before: case a.inl.intro.intro.intro
r s : ℝ
hrs : r.IsConjExponent s
j k : ℤ
hk : k > 0
hjk : beattySeq r k = j
⊢ 1 ≤ ↑k * r
state_after: no goals

tactic: norm_cast
state_before: r s : ℝ
hrs : r.IsConjExponent s
j k : ℤ
hk : k > 0
hjk : beattySeq r k = j
⊢ 1 ≤ ↑k
state_after: no goals

tactic: rw [Set.mem_setOf_eq, ← hjk, beattySeq', sub_pos, Int.lt_ceil, Int.cast_one]
state_before: case a.inr.intro.intro.intro
r s : ℝ
hrs : r.IsConjExponent s
j k : ℤ
hk : k > 0
hjk : beattySeq' s k = j
⊢ j ∈ {n | 0 < n}
state_after: case a.inr.intro.intro.intro
r s : ℝ
hrs : r.IsConjExponent s
j k : ℤ
hk : k > 0
hjk : beattySeq' s k = j
⊢ 1 < ↑k * s

tactic: exact one_lt_mul_of_le_of_lt (by norm_cast) hrs.symm.one_lt
state_before: case a.inr.intro.intro.intro
r s : ℝ
hrs : r.IsConjExponent s
j k : ℤ
hk : k > 0
hjk : beattySeq' s k = j
⊢ 1 < ↑k * s
state_after: no goals

tactic: norm_cast
state_before: r s : ℝ
hrs : r.IsConjExponent s
j k : ℤ
hk : k > 0
hjk : beattySeq' s k = j
⊢ 1 ≤ ↑k
state_after: no goals

tactic: intro _ hs
state_before: r s : ℝ
hrs : r.IsConjExponent s
j : ℤ
hj : 0 < j
⊢ ∀ s ≥ 0, j ∈ {x | ∃ k > 0, beattySeq s k = x} ↔ j ∈ {x | ∃ k, beattySeq s k = x}
state_after: r s : ℝ
hrs : r.IsConjExponent s
j : ℤ
hj : 0 < j
s✝ : ℝ
hs : s✝ ≥ 0
⊢ j ∈ {x | ∃ k > 0, beattySeq s✝ k = x} ↔ j ∈ {x | ∃ k, beattySeq s✝ k = x}

tactic: refine ⟨fun ⟨k, _, hk⟩ ↦ ⟨k, hk⟩, fun ⟨k, hk⟩ ↦ ⟨k, ?_, hk⟩⟩
state_before: r s : ℝ
hrs : r.IsConjExponent s
j : ℤ
hj : 0 < j
s✝ : ℝ
hs : s✝ ≥ 0
⊢ j ∈ {x | ∃ k > 0, beattySeq s✝ k = x} ↔ j ∈ {x | ∃ k, beattySeq s✝ k = x}
state_after: r s : ℝ
hrs : r.IsConjExponent s
j : ℤ
hj : 0 < j
s✝ : ℝ
hs : s✝ ≥ 0
x✝ : j ∈ {x | ∃ k, beattySeq s✝ k = x}
k : ℤ
hk : beattySeq s✝ k = j
⊢ k > 0

tactic: rw [← hk, beattySeq, Int.floor_pos] at hj
state_before: r s : ℝ
hrs : r.IsConjExponent s
j : ℤ
hj : 0 < j
s✝ : ℝ
hs : s✝ ≥ 0
x✝ : j ∈ {x | ∃ k, beattySeq s✝ k = x}
k : ℤ
hk : beattySeq s✝ k = j
⊢ k > 0
state_after: r s : ℝ
hrs : r.IsConjExponent s
j : ℤ
s✝ : ℝ
hs : s✝ ≥ 0
x✝ : j ∈ {x | ∃ k, beattySeq s✝ k = x}
k : ℤ
hj : 1 ≤ ↑k * s✝
hk : beattySeq s✝ k = j
⊢ k > 0

tactic: exact_mod_cast pos_of_mul_pos_left (zero_lt_one.trans_le hj) hs
state_before: r s : ℝ
hrs : r.IsConjExponent s
j : ℤ
s✝ : ℝ
hs : s✝ ≥ 0
x✝ : j ∈ {x | ∃ k, beattySeq s✝ k = x}
k : ℤ
hj : 1 ≤ ↑k * s✝
hk : beattySeq s✝ k = j
⊢ k > 0
state_after: no goals

tactic: intro _ hs
state_before: r s : ℝ
hrs : r.IsConjExponent s
j : ℤ
hj : 0 < j
hb₁ : ∀ s ≥ 0, j ∈ {x | ∃ k > 0, beattySeq s k = x} ↔ j ∈ {x | ∃ k, beattySeq s k = x}
⊢ ∀ s ≥ 0, j ∈ {x | ∃ k > 0, beattySeq' s k = x} ↔ j ∈ {x | ∃ k, beattySeq' s k = x}
state_after: r s : ℝ
hrs : r.IsConjExponent s
j : ℤ
hj : 0 < j
hb₁ : ∀ s ≥ 0, j ∈ {x | ∃ k > 0, beattySeq s k = x} ↔ j ∈ {x | ∃ k, beattySeq s k = x}
s✝ : ℝ
hs : s✝ ≥ 0
⊢ j ∈ {x | ∃ k > 0, beattySeq' s✝ k = x} ↔ j ∈ {x | ∃ k, beattySeq' s✝ k = x}

tactic: refine ⟨fun ⟨k, _, hk⟩ ↦ ⟨k, hk⟩, fun ⟨k, hk⟩ ↦ ⟨k, ?_, hk⟩⟩
state_before: r s : ℝ
hrs : r.IsConjExponent s
j : ℤ
hj : 0 < j
hb₁ : ∀ s ≥ 0, j ∈ {x | ∃ k > 0, beattySeq s k = x} ↔ j ∈ {x | ∃ k, beattySeq s k = x}
s✝ : ℝ
hs : s✝ ≥ 0
⊢ j ∈ {x | ∃ k > 0, beattySeq' s✝ k = x} ↔ j ∈ {x | ∃ k, beattySeq' s✝ k = x}
state_after: r s : ℝ
hrs : r.IsConjExponent s
j : ℤ
hj : 0 < j
hb₁ : ∀ s ≥ 0, j ∈ {x | ∃ k > 0, beattySeq s k = x} ↔ j ∈ {x | ∃ k, beattySeq s k = x}
s✝ : ℝ
hs : s✝ ≥ 0
x✝ : j ∈ {x | ∃ k, beattySeq' s✝ k = x}
k : ℤ
hk : beattySeq' s✝ k = j
⊢ k > 0

tactic: rw [← hk, beattySeq', sub_pos, Int.lt_ceil, Int.cast_one] at hj
state_before: r s : ℝ
hrs : r.IsConjExponent s
j : ℤ
hj : 0 < j
hb₁ : ∀ s ≥ 0, j ∈ {x | ∃ k > 0, beattySeq s k = x} ↔ j ∈ {x | ∃ k, beattySeq s k = x}
s✝ : ℝ
hs : s✝ ≥ 0
x✝ : j ∈ {x | ∃ k, beattySeq' s✝ k = x}
k : ℤ
hk : beattySeq' s✝ k = j
⊢ k > 0
state_after: r s : ℝ
hrs : r.IsConjExponent s
j : ℤ
hb₁ : ∀ s ≥ 0, j ∈ {x | ∃ k > 0, beattySeq s k = x} ↔ j ∈ {x | ∃ k, beattySeq s k = x}
s✝ : ℝ
hs : s✝ ≥ 0
x✝ : j ∈ {x | ∃ k, beattySeq' s✝ k = x}
k : ℤ
hj : 1 < ↑k * s✝
hk : beattySeq' s✝ k = j
⊢ k > 0

tactic: exact_mod_cast pos_of_mul_pos_left (zero_lt_one.trans hj) hs
state_before: r s : ℝ
hrs : r.IsConjExponent s
j : ℤ
hb₁ : ∀ s ≥ 0, j ∈ {x | ∃ k > 0, beattySeq s k = x} ↔ j ∈ {x | ∃ k, beattySeq s k = x}
s✝ : ℝ
hs : s✝ ≥ 0
x✝ : j ∈ {x | ∃ k, beattySeq' s✝ k = x}
k : ℤ
hj : 1 < ↑k * s✝
hk : beattySeq' s✝ k = j
⊢ k > 0
state_after: no goals