-- Mathlib/NumberTheory/Rayleigh.lean
theorem beattySeq_symmDiff_beattySeq'_pos {r s : ℝ} (hrs : r.IsConjExponent s) :
    {beattySeq r k | k > 0} ∆ {beattySeq' s k | k > 0} = {n | 0 < n}

Proof state:
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

Result:
no goals

Proof state:
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)

Result:
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}

Proof state:
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}

Tactic:
intro _ hs

Result:
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}

Proof state:
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}

Tactic:
intro _ hs

Result:
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}

Proof state:
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', sub_pos, Int.lt_ceil, Int.cast_one]

Result:
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

Proof state:
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

Result:
no goals

Proof state:
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]

Result:
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}

Proof state:
r s : ℝ
hrs : r.IsConjExponent s
j k : ℤ
hk : k > 0
hjk : beattySeq r k = j
⊢ 1 ≤ ↑k

Tactic:
norm_cast

Result:
no goals

Proof state:
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}

Tactic:
rintro j (⟨⟨k, hk, hjk⟩, -⟩ | ⟨⟨k, hk, hjk⟩, -⟩)

Result:
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}

Proof state:
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⟩⟩

Result:
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

Proof state:
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}

Tactic:
rw [Set.mem_setOf_eq, ← hjk, beattySeq, Int.floor_pos]

Result:
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

Proof state:
r s : ℝ
hrs : r.IsConjExponent s
j k : ℤ
hk : k > 0
hjk : beattySeq' s k = j
⊢ 1 ≤ ↑k

Tactic:
norm_cast

Result:
no goals

Proof state:
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⟩⟩

Result:
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

Proof state:
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

Result:
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}

Proof state:
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

Result:
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}

Proof state:
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

Result:
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

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

Tactic:
apply Set.eq_of_subset_of_subset

Result:
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}

Proof state:
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

Result:
no goals

Proof state:
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

Result:
no goals