Theorem: Cardinal.increasing_cantorFunction
File: Mathlib/Data/Real/Cardinality.lean

tactic: have h3 : c < 1 := by
  apply h2.trans
  norm_num
state_before: c : ℝ
f✝ g✝ : ℕ → Bool
n✝ : ℕ
h1 : 0 < c
h2 : c < 1 / 2
n : ℕ
f g : ℕ → Bool
hn : ∀ (k : ℕ), k < n → f k = g k
fn : f n = false
gn : g n = true
⊢ cantorFunction c f < cantorFunction c g

tactic: induction' n with n ih generalizing f g
state_before: c : ℝ
f✝ g✝ : ℕ → Bool
n✝ : ℕ
h1 : 0 < c
h2 : c < 1 / 2
n : ℕ
f g : ℕ → Bool
hn : ∀ (k : ℕ), k < n → f k = g k
fn : f n = false
gn : g n = true
h3 : c < 1
⊢ cantorFunction c f < cantorFunction c g

tactic: rw [cantorFunction_succ f (le_of_lt h1) h3, cantorFunction_succ g (le_of_lt h1) h3]
state_before: case succ
c : ℝ
f✝¹ g✝¹ : ℕ → Bool
n✝¹ : ℕ
h1 : 0 < c
h2 : c < 1 / 2
n✝ : ℕ
f✝ g✝ : ℕ → Bool
hn✝ : ∀ (k : ℕ), k < n✝ → f✝ k = g✝ k
fn✝ : f✝ n✝ = false
gn✝ : g✝ n✝ = true
h3 : c < 1
n : ℕ
ih :
  ∀ {f g : ℕ → Bool},
    (∀ (k : ℕ), k < n → f k = g k) → f n = false → g n = true → cantorFunction c f < cantorFunction c g
f g : ℕ → Bool
hn : ∀ (k : ℕ), k < succ n → f k = g k
fn : f (succ n) = false
gn : g (succ n) = true
⊢ cantorFunction c f < cantorFunction c g

tactic: rw [hn 0 <| zero_lt_succ n]
state_before: case succ
c : ℝ
f✝¹ g✝¹ : ℕ → Bool
n✝¹ : ℕ
h1 : 0 < c
h2 : c < 1 / 2
n✝ : ℕ
f✝ g✝ : ℕ → Bool
hn✝ : ∀ (k : ℕ), k < n✝ → f✝ k = g✝ k
fn✝ : f✝ n✝ = false
gn✝ : g✝ n✝ = true
h3 : c < 1
n : ℕ
ih :
  ∀ {f g : ℕ → Bool},
    (∀ (k : ℕ), k < n → f k = g k) → f n = false → g n = true → cantorFunction c f < cantorFunction c g
f g : ℕ → Bool
hn : ∀ (k : ℕ), k < succ n → f k = g k
fn : f (succ n) = false
gn : g (succ n) = true
⊢ ((bif f 0 then 1 else 0) + c * cantorFunction c fun n => f (n + 1)) <
    (bif g 0 then 1 else 0) + c * cantorFunction c fun n => g (n + 1)

tactic: apply add_lt_add_left
state_before: case succ
c : ℝ
f✝¹ g✝¹ : ℕ → Bool
n✝¹ : ℕ
h1 : 0 < c
h2 : c < 1 / 2
n✝ : ℕ
f✝ g✝ : ℕ → Bool
hn✝ : ∀ (k : ℕ), k < n✝ → f✝ k = g✝ k
fn✝ : f✝ n✝ = false
gn✝ : g✝ n✝ = true
h3 : c < 1
n : ℕ
ih :
  ∀ {f g : ℕ → Bool},
    (∀ (k : ℕ), k < n → f k = g k) → f n = false → g n = true → cantorFunction c f < cantorFunction c g
f g : ℕ → Bool
hn : ∀ (k : ℕ), k < succ n → f k = g k
fn : f (succ n) = false
gn : g (succ n) = true
⊢ ((bif g 0 then 1 else 0) + c * cantorFunction c fun n => f (n + 1)) <
    (bif g 0 then 1 else 0) + c * cantorFunction c fun n => g (n + 1)

tactic: rw [mul_lt_mul_left h1]
state_before: case succ.bc
c : ℝ
f✝¹ g✝¹ : ℕ → Bool
n✝¹ : ℕ
h1 : 0 < c
h2 : c < 1 / 2
n✝ : ℕ
f✝ g✝ : ℕ → Bool
hn✝ : ∀ (k : ℕ), k < n✝ → f✝ k = g✝ k
fn✝ : f✝ n✝ = false
gn✝ : g✝ n✝ = true
h3 : c < 1
n : ℕ
ih :
  ∀ {f g : ℕ → Bool},
    (∀ (k : ℕ), k < n → f k = g k) → f n = false → g n = true → cantorFunction c f < cantorFunction c g
f g : ℕ → Bool
hn : ∀ (k : ℕ), k < succ n → f k = g k
fn : f (succ n) = false
gn : g (succ n) = true
⊢ (c * cantorFunction c fun n => f (n + 1)) < c * cantorFunction c fun n => g (n + 1)

tactic: exact ih (fun k hk => hn _ <| Nat.succ_lt_succ hk) fn gn
state_before: case succ.bc
c : ℝ
f✝¹ g✝¹ : ℕ → Bool
n✝¹ : ℕ
h1 : 0 < c
h2 : c < 1 / 2
n✝ : ℕ
f✝ g✝ : ℕ → Bool
hn✝ : ∀ (k : ℕ), k < n✝ → f✝ k = g✝ k
fn✝ : f✝ n✝ = false
gn✝ : g✝ n✝ = true
h3 : c < 1
n : ℕ
ih :
  ∀ {f g : ℕ → Bool},
    (∀ (k : ℕ), k < n → f k = g k) → f n = false → g n = true → cantorFunction c f < cantorFunction c g
f g : ℕ → Bool
hn : ∀ (k : ℕ), k < succ n → f k = g k
fn : f (succ n) = false
gn : g (succ n) = true
⊢ (cantorFunction c fun n => f (n + 1)) < cantorFunction c fun n => g (n + 1)

tactic: apply h2.trans
state_before: c : ℝ
f✝ g✝ : ℕ → Bool
n✝ : ℕ
h1 : 0 < c
h2 : c < 1 / 2
n : ℕ
f g : ℕ → Bool
hn : ∀ (k : ℕ), k < n → f k = g k
fn : f n = false
gn : g n = true
⊢ c < 1

tactic: norm_num
state_before: c : ℝ
f✝ g✝ : ℕ → Bool
n✝ : ℕ
h1 : 0 < c
h2 : c < 1 / 2
n : ℕ
f g : ℕ → Bool
hn : ∀ (k : ℕ), k < n → f k = g k
fn : f n = false
gn : g n = true
⊢ 1 / 2 < 1

tactic: let f_max : ℕ → Bool := fun n => Nat.rec false (fun _ _ => true) n
state_before: case zero
c : ℝ
f✝¹ g✝¹ : ℕ → Bool
n✝ : ℕ
h1 : 0 < c
h2 : c < 1 / 2
n : ℕ
f✝ g✝ : ℕ → Bool
hn✝ : ∀ (k : ℕ), k < n → f✝ k = g✝ k
fn✝ : f✝ n = false
gn✝ : g✝ n = true
h3 : c < 1
f g : ℕ → Bool
hn : ∀ (k : ℕ), k < zero → f k = g k
fn : f zero = false
gn : g zero = true
⊢ cantorFunction c f < cantorFunction c g

tactic: have hf_max : ∀ n, f n → f_max n := by
  intro n hn
  cases n
  rw [fn] at hn
  contradiction
  apply rfl
state_before: case zero
c : ℝ
f✝¹ g✝¹ : ℕ → Bool
n✝ : ℕ
h1 : 0 < c
h2 : c < 1 / 2
n : ℕ
f✝ g✝ : ℕ → Bool
hn✝ : ∀ (k : ℕ), k < n → f✝ k = g✝ k
fn✝ : f✝ n = false
gn✝ : g✝ n = true
h3 : c < 1
f g : ℕ → Bool
hn : ∀ (k : ℕ), k < zero → f k = g k
fn : f zero = false
gn : g zero = true
f_max : ℕ → Bool := fun n => rec false (fun x x => true) n
⊢ cantorFunction c f < cantorFunction c g

tactic: let g_min : ℕ → Bool := fun n => Nat.rec true (fun _ _ => false) n
state_before: case zero
c : ℝ
f✝¹ g✝¹ : ℕ → Bool
n✝ : ℕ
h1 : 0 < c
h2 : c < 1 / 2
n : ℕ
f✝ g✝ : ℕ → Bool
hn✝ : ∀ (k : ℕ), k < n → f✝ k = g✝ k
fn✝ : f✝ n = false
gn✝ : g✝ n = true
h3 : c < 1
f g : ℕ → Bool
hn : ∀ (k : ℕ), k < zero → f k = g k
fn : f zero = false
gn : g zero = true
f_max : ℕ → Bool := fun n => rec false (fun x x => true) n
hf_max : ∀ (n : ℕ), f n = true → f_max n = true
⊢ cantorFunction c f < cantorFunction c g

tactic: have hg_min : ∀ n, g_min n → g n := by
  intro n hn
  cases n
  rw [gn]
  simp at hn
state_before: case zero
c : ℝ
f✝¹ g✝¹ : ℕ → Bool
n✝ : ℕ
h1 : 0 < c
h2 : c < 1 / 2
n : ℕ
f✝ g✝ : ℕ → Bool
hn✝ : ∀ (k : ℕ), k < n → f✝ k = g✝ k
fn✝ : f✝ n = false
gn✝ : g✝ n = true
h3 : c < 1
f g : ℕ → Bool
hn : ∀ (k : ℕ), k < zero → f k = g k
fn : f zero = false
gn : g zero = true
f_max : ℕ → Bool := fun n => rec false (fun x x => true) n
hf_max : ∀ (n : ℕ), f n = true → f_max n = true
g_min : ℕ → Bool := fun n => rec true (fun x x => false) n
⊢ cantorFunction c f < cantorFunction c g

tactic: apply (cantorFunction_le (le_of_lt h1) h3 hf_max).trans_lt
state_before: case zero
c : ℝ
f✝¹ g✝¹ : ℕ → Bool
n✝ : ℕ
h1 : 0 < c
h2 : c < 1 / 2
n : ℕ
f✝ g✝ : ℕ → Bool
hn✝ : ∀ (k : ℕ), k < n → f✝ k = g✝ k
fn✝ : f✝ n = false
gn✝ : g✝ n = true
h3 : c < 1
f g : ℕ → Bool
hn : ∀ (k : ℕ), k < zero → f k = g k
fn : f zero = false
gn : g zero = true
f_max : ℕ → Bool := fun n => rec false (fun x x => true) n
hf_max : ∀ (n : ℕ), f n = true → f_max n = true
g_min : ℕ → Bool := fun n => rec true (fun x x => false) n
hg_min : ∀ (n : ℕ), g_min n = true → g n = true
⊢ cantorFunction c f < cantorFunction c g

tactic: refine' lt_of_lt_of_le _ (cantorFunction_le (le_of_lt h1) h3 hg_min)
state_before: case zero
c : ℝ
f✝¹ g✝¹ : ℕ → Bool
n✝ : ℕ
h1 : 0 < c
h2 : c < 1 / 2
n : ℕ
f✝ g✝ : ℕ → Bool
hn✝ : ∀ (k : ℕ), k < n → f✝ k = g✝ k
fn✝ : f✝ n = false
gn✝ : g✝ n = true
h3 : c < 1
f g : ℕ → Bool
hn : ∀ (k : ℕ), k < zero → f k = g k
fn : f zero = false
gn : g zero = true
f_max : ℕ → Bool := fun n => rec false (fun x x => true) n
hf_max : ∀ (n : ℕ), f n = true → f_max n = true
g_min : ℕ → Bool := fun n => rec true (fun x x => false) n
hg_min : ∀ (n : ℕ), g_min n = true → g n = true
⊢ (cantorFunction c fun n => f_max n) < cantorFunction c g

tactic: convert this
state_before: case zero
c : ℝ
f✝¹ g✝¹ : ℕ → Bool
n✝ : ℕ
h1 : 0 < c
h2 : c < 1 / 2
n : ℕ
f✝ g✝ : ℕ → Bool
hn✝ : ∀ (k : ℕ), k < n → f✝ k = g✝ k
fn✝ : f✝ n = false
gn✝ : g✝ n = true
h3 : c < 1
f g : ℕ → Bool
hn : ∀ (k : ℕ), k < zero → f k = g k
fn : f zero = false
gn : g zero = true
f_max : ℕ → Bool := fun n => rec false (fun x x => true) n
hf_max : ∀ (n : ℕ), f n = true → f_max n = true
g_min : ℕ → Bool := fun n => rec true (fun x x => false) n
hg_min : ∀ (n : ℕ), g_min n = true → g n = true
this : c / (1 - c) < 1
⊢ (cantorFunction c fun n => f_max n) < cantorFunction c fun n => g_min n

tactic: intro n hn
state_before: c : ℝ
f✝¹ g✝¹ : ℕ → Bool
n✝ : ℕ
h1 : 0 < c
h2 : c < 1 / 2
n : ℕ
f✝ g✝ : ℕ → Bool
hn✝ : ∀ (k : ℕ), k < n → f✝ k = g✝ k
fn✝ : f✝ n = false
gn✝ : g✝ n = true
h3 : c < 1
f g : ℕ → Bool
hn : ∀ (k : ℕ), k < zero → f k = g k
fn : f zero = false
gn : g zero = true
f_max : ℕ → Bool := fun n => rec false (fun x x => true) n
⊢ ∀ (n : ℕ), f n = true → f_max n = true

tactic: cases n
state_before: c : ℝ
f✝¹ g✝¹ : ℕ → Bool
n✝¹ : ℕ
h1 : 0 < c
h2 : c < 1 / 2
n✝ : ℕ
f✝ g✝ : ℕ → Bool
hn✝¹ : ∀ (k : ℕ), k < n✝ → f✝ k = g✝ k
fn✝ : f✝ n✝ = false
gn✝ : g✝ n✝ = true
h3 : c < 1
f g : ℕ → Bool
hn✝ : ∀ (k : ℕ), k < zero → f k = g k
fn : f zero = false
gn : g zero = true
f_max : ℕ → Bool := fun n => rec false (fun x x => true) n
n : ℕ
hn : f n = true
⊢ f_max n = true

tactic: rw [fn] at hn
state_before: case zero
c : ℝ
f✝¹ g✝¹ : ℕ → Bool
n✝ : ℕ
h1 : 0 < c
h2 : c < 1 / 2
n : ℕ
f✝ g✝ : ℕ → Bool
hn✝¹ : ∀ (k : ℕ), k < n → f✝ k = g✝ k
fn✝ : f✝ n = false
gn✝ : g✝ n = true
h3 : c < 1
f g : ℕ → Bool
hn✝ : ∀ (k : ℕ), k < zero → f k = g k
fn : f zero = false
gn : g zero = true
f_max : ℕ → Bool := fun n => rec false (fun x x => true) n
hn : f zero = true
⊢ f_max zero = true

case succ
c : ℝ
f✝¹ g✝¹ : ℕ → Bool
n✝¹ : ℕ
h1 : 0 < c
h2 : c < 1 / 2
n : ℕ
f✝ g✝ : ℕ → Bool
hn✝¹ : ∀ (k : ℕ), k < n → f✝ k = g✝ k
fn✝ : f✝ n = false
gn✝ : g✝ n = true
h3 : c < 1
f g : ℕ → Bool
hn✝ : ∀ (k : ℕ), k < zero → f k = g k
fn : f zero = false
gn : g zero = true
f_max : ℕ → Bool := fun n => rec false (fun x x => true) n
n✝ : ℕ
hn : f (succ n✝) = true
⊢ f_max (succ n✝) = true

tactic: contradiction
state_before: case zero
c : ℝ
f✝¹ g✝¹ : ℕ → Bool
n✝ : ℕ
h1 : 0 < c
h2 : c < 1 / 2
n : ℕ
f✝ g✝ : ℕ → Bool
hn✝¹ : ∀ (k : ℕ), k < n → f✝ k = g✝ k
fn✝ : f✝ n = false
gn✝ : g✝ n = true
h3 : c < 1
f g : ℕ → Bool
hn✝ : ∀ (k : ℕ), k < zero → f k = g k
fn : f zero = false
gn : g zero = true
f_max : ℕ → Bool := fun n => rec false (fun x x => true) n
hn : false = true
⊢ f_max zero = true

case succ
c : ℝ
f✝¹ g✝¹ : ℕ → Bool
n✝¹ : ℕ
h1 : 0 < c
h2 : c < 1 / 2
n : ℕ
f✝ g✝ : ℕ → Bool
hn✝¹ : ∀ (k : ℕ), k < n → f✝ k = g✝ k
fn✝ : f✝ n = false
gn✝ : g✝ n = true
h3 : c < 1
f g : ℕ → Bool
hn✝ : ∀ (k : ℕ), k < zero → f k = g k
fn : f zero = false
gn : g zero = true
f_max : ℕ → Bool := fun n => rec false (fun x x => true) n
n✝ : ℕ
hn : f (succ n✝) = true
⊢ f_max (succ n✝) = true

tactic: apply rfl
state_before: case succ
c : ℝ
f✝¹ g✝¹ : ℕ → Bool
n✝¹ : ℕ
h1 : 0 < c
h2 : c < 1 / 2
n : ℕ
f✝ g✝ : ℕ → Bool
hn✝¹ : ∀ (k : ℕ), k < n → f✝ k = g✝ k
fn✝ : f✝ n = false
gn✝ : g✝ n = true
h3 : c < 1
f g : ℕ → Bool
hn✝ : ∀ (k : ℕ), k < zero → f k = g k
fn : f zero = false
gn : g zero = true
f_max : ℕ → Bool := fun n => rec false (fun x x => true) n
n✝ : ℕ
hn : f (succ n✝) = true
⊢ f_max (succ n✝) = true

tactic: intro n hn
state_before: c : ℝ
f✝¹ g✝¹ : ℕ → Bool
n✝ : ℕ
h1 : 0 < c
h2 : c < 1 / 2
n : ℕ
f✝ g✝ : ℕ → Bool
hn✝ : ∀ (k : ℕ), k < n → f✝ k = g✝ k
fn✝ : f✝ n = false
gn✝ : g✝ n = true
h3 : c < 1
f g : ℕ → Bool
hn : ∀ (k : ℕ), k < zero → f k = g k
fn : f zero = false
gn : g zero = true
f_max : ℕ → Bool := fun n => rec false (fun x x => true) n
hf_max : ∀ (n : ℕ), f n = true → f_max n = true
g_min : ℕ → Bool := fun n => rec true (fun x x => false) n
⊢ ∀ (n : ℕ), g_min n = true → g n = true

tactic: cases n
state_before: c : ℝ
f✝¹ g✝¹ : ℕ → Bool
n✝¹ : ℕ
h1 : 0 < c
h2 : c < 1 / 2
n✝ : ℕ
f✝ g✝ : ℕ → Bool
hn✝¹ : ∀ (k : ℕ), k < n✝ → f✝ k = g✝ k
fn✝ : f✝ n✝ = false
gn✝ : g✝ n✝ = true
h3 : c < 1
f g : ℕ → Bool
hn✝ : ∀ (k : ℕ), k < zero → f k = g k
fn : f zero = false
gn : g zero = true
f_max : ℕ → Bool := fun n => rec false (fun x x => true) n
hf_max : ∀ (n : ℕ), f n = true → f_max n = true
g_min : ℕ → Bool := fun n => rec true (fun x x => false) n
n : ℕ
hn : g_min n = true
⊢ g n = true

tactic: rw [gn]
state_before: case zero
c : ℝ
f✝¹ g✝¹ : ℕ → Bool
n✝ : ℕ
h1 : 0 < c
h2 : c < 1 / 2
n : ℕ
f✝ g✝ : ℕ → Bool
hn✝¹ : ∀ (k : ℕ), k < n → f✝ k = g✝ k
fn✝ : f✝ n = false
gn✝ : g✝ n = true
h3 : c < 1
f g : ℕ → Bool
hn✝ : ∀ (k : ℕ), k < zero → f k = g k
fn : f zero = false
gn : g zero = true
f_max : ℕ → Bool := fun n => rec false (fun x x => true) n
hf_max : ∀ (n : ℕ), f n = true → f_max n = true
g_min : ℕ → Bool := fun n => rec true (fun x x => false) n
hn : g_min zero = true
⊢ g zero = true

case succ
c : ℝ
f✝¹ g✝¹ : ℕ → Bool
n✝¹ : ℕ
h1 : 0 < c
h2 : c < 1 / 2
n : ℕ
f✝ g✝ : ℕ → Bool
hn✝¹ : ∀ (k : ℕ), k < n → f✝ k = g✝ k
fn✝ : f✝ n = false
gn✝ : g✝ n = true
h3 : c < 1
f g : ℕ → Bool
hn✝ : ∀ (k : ℕ), k < zero → f k = g k
fn : f zero = false
gn : g zero = true
f_max : ℕ → Bool := fun n => rec false (fun x x => true) n
hf_max : ∀ (n : ℕ), f n = true → f_max n = true
g_min : ℕ → Bool := fun n => rec true (fun x x => false) n
n✝ : ℕ
hn : g_min (succ n✝) = true
⊢ g (succ n✝) = true

tactic: simp at hn
state_before: case succ
c : ℝ
f✝¹ g✝¹ : ℕ → Bool
n✝¹ : ℕ
h1 : 0 < c
h2 : c < 1 / 2
n : ℕ
f✝ g✝ : ℕ → Bool
hn✝¹ : ∀ (k : ℕ), k < n → f✝ k = g✝ k
fn✝ : f✝ n = false
gn✝ : g✝ n = true
h3 : c < 1
f g : ℕ → Bool
hn✝ : ∀ (k : ℕ), k < zero → f k = g k
fn : f zero = false
gn : g zero = true
f_max : ℕ → Bool := fun n => rec false (fun x x => true) n
hf_max : ∀ (n : ℕ), f n = true → f_max n = true
g_min : ℕ → Bool := fun n => rec true (fun x x => false) n
n✝ : ℕ
hn : g_min (succ n✝) = true
⊢ g (succ n✝) = true

tactic: rw [div_lt_one, lt_sub_iff_add_lt]
state_before: c : ℝ
f✝¹ g✝¹ : ℕ → Bool
n✝ : ℕ
h1 : 0 < c
h2 : c < 1 / 2
n : ℕ
f✝ g✝ : ℕ → Bool
hn✝ : ∀ (k : ℕ), k < n → f✝ k = g✝ k
fn✝ : f✝ n = false
gn✝ : g✝ n = true
h3 : c < 1
f g : ℕ → Bool
hn : ∀ (k : ℕ), k < zero → f k = g k
fn : f zero = false
gn : g zero = true
f_max : ℕ → Bool := fun n => rec false (fun x x => true) n
hf_max : ∀ (n : ℕ), f n = true → f_max n = true
g_min : ℕ → Bool := fun n => rec true (fun x x => false) n
hg_min : ∀ (n : ℕ), g_min n = true → g n = true
⊢ c / (1 - c) < 1

tactic: rwa [sub_pos]
state_before: c : ℝ
f✝¹ g✝¹ : ℕ → Bool
n✝ : ℕ
h1 : 0 < c
h2 : c < 1 / 2
n : ℕ
f✝ g✝ : ℕ → Bool
hn✝ : ∀ (k : ℕ), k < n → f✝ k = g✝ k
fn✝ : f✝ n = false
gn✝ : g✝ n = true
h3 : c < 1
f g : ℕ → Bool
hn : ∀ (k : ℕ), k < zero → f k = g k
fn : f zero = false
gn : g zero = true
f_max : ℕ → Bool := fun n => rec false (fun x x => true) n
hf_max : ∀ (n : ℕ), f n = true → f_max n = true
g_min : ℕ → Bool := fun n => rec true (fun x x => false) n
hg_min : ∀ (n : ℕ), g_min n = true → g n = true
⊢ 0 < 1 - c

tactic: convert _root_.add_lt_add h2 h2
state_before: c : ℝ
f✝¹ g✝¹ : ℕ → Bool
n✝ : ℕ
h1 : 0 < c
h2 : c < 1 / 2
n : ℕ
f✝ g✝ : ℕ → Bool
hn✝ : ∀ (k : ℕ), k < n → f✝ k = g✝ k
fn✝ : f✝ n = false
gn✝ : g✝ n = true
h3 : c < 1
f g : ℕ → Bool
hn : ∀ (k : ℕ), k < zero → f k = g k
fn : f zero = false
gn : g zero = true
f_max : ℕ → Bool := fun n => rec false (fun x x => true) n
hf_max : ∀ (n : ℕ), f n = true → f_max n = true
g_min : ℕ → Bool := fun n => rec true (fun x x => false) n
hg_min : ∀ (n : ℕ), g_min n = true → g n = true
⊢ c + c < 1

tactic: norm_num
state_before: case h.e'_4
c : ℝ
f✝¹ g✝¹ : ℕ → Bool
n✝ : ℕ
h1 : 0 < c
h2 : c < 1 / 2
n : ℕ
f✝ g✝ : ℕ → Bool
hn✝ : ∀ (k : ℕ), k < n → f✝ k = g✝ k
fn✝ : f✝ n = false
gn✝ : g✝ n = true
h3 : c < 1
f g : ℕ → Bool
hn : ∀ (k : ℕ), k < zero → f k = g k
fn : f zero = false
gn : g zero = true
f_max : ℕ → Bool := fun n => rec false (fun x x => true) n
hf_max : ∀ (n : ℕ), f n = true → f_max n = true
g_min : ℕ → Bool := fun n => rec true (fun x x => false) n
hg_min : ∀ (n : ℕ), g_min n = true → g n = true
⊢ 1 = 1 / 2 + 1 / 2

tactic: rw [cantorFunction_succ _ (le_of_lt h1) h3, div_eq_mul_inv, ←
  tsum_geometric_of_lt_1 (le_of_lt h1) h3]
state_before: case h.e'_3
c : ℝ
f✝¹ g✝¹ : ℕ → Bool
n✝ : ℕ
h1 : 0 < c
h2 : c < 1 / 2
n : ℕ
f✝ g✝ : ℕ → Bool
hn✝ : ∀ (k : ℕ), k < n → f✝ k = g✝ k
fn✝ : f✝ n = false
gn✝ : g✝ n = true
h3 : c < 1
f g : ℕ → Bool
hn : ∀ (k : ℕ), k < zero → f k = g k
fn : f zero = false
gn : g zero = true
f_max : ℕ → Bool := fun n => rec false (fun x x => true) n
hf_max : ∀ (n : ℕ), f n = true → f_max n = true
g_min : ℕ → Bool := fun n => rec true (fun x x => false) n
hg_min : ∀ (n : ℕ), g_min n = true → g n = true
this : c / (1 - c) < 1
⊢ (cantorFunction c fun n => f_max n) = c / (1 - c)

tactic: apply zero_add
state_before: case h.e'_3
c : ℝ
f✝¹ g✝¹ : ℕ → Bool
n✝ : ℕ
h1 : 0 < c
h2 : c < 1 / 2
n : ℕ
f✝ g✝ : ℕ → Bool
hn✝ : ∀ (k : ℕ), k < n → f✝ k = g✝ k
fn✝ : f✝ n = false
gn✝ : g✝ n = true
h3 : c < 1
f g : ℕ → Bool
hn : ∀ (k : ℕ), k < zero → f k = g k
fn : f zero = false
gn : g zero = true
f_max : ℕ → Bool := fun n => rec false (fun x x => true) n
hf_max : ∀ (n : ℕ), f n = true → f_max n = true
g_min : ℕ → Bool := fun n => rec true (fun x x => false) n
hg_min : ∀ (n : ℕ), g_min n = true → g n = true
this : c / (1 - c) < 1
⊢ ((bif f_max 0 then 1 else 0) + c * cantorFunction c fun n => f_max (n + 1)) = c * ∑' (n : ℕ), c ^ n

tactic: refine' (tsum_eq_single 0 _).trans _
state_before: case h.e'_4
c : ℝ
f✝¹ g✝¹ : ℕ → Bool
n✝ : ℕ
h1 : 0 < c
h2 : c < 1 / 2
n : ℕ
f✝ g✝ : ℕ → Bool
hn✝ : ∀ (k : ℕ), k < n → f✝ k = g✝ k
fn✝ : f✝ n = false
gn✝ : g✝ n = true
h3 : c < 1
f g : ℕ → Bool
hn : ∀ (k : ℕ), k < zero → f k = g k
fn : f zero = false
gn : g zero = true
f_max : ℕ → Bool := fun n => rec false (fun x x => true) n
hf_max : ∀ (n : ℕ), f n = true → f_max n = true
g_min : ℕ → Bool := fun n => rec true (fun x x => false) n
hg_min : ∀ (n : ℕ), g_min n = true → g n = true
this : c / (1 - c) < 1
⊢ (cantorFunction c fun n => g_min n) = 1

tactic: intro n hn
state_before: case h.e'_4.refine'_1
c : ℝ
f✝¹ g✝¹ : ℕ → Bool
n✝ : ℕ
h1 : 0 < c
h2 : c < 1 / 2
n : ℕ
f✝ g✝ : ℕ → Bool
hn✝ : ∀ (k : ℕ), k < n → f✝ k = g✝ k
fn✝ : f✝ n = false
gn✝ : g✝ n = true
h3 : c < 1
f g : ℕ → Bool
hn : ∀ (k : ℕ), k < zero → f k = g k
fn : f zero = false
gn : g zero = true
f_max : ℕ → Bool := fun n => rec false (fun x x => true) n
hf_max : ∀ (n : ℕ), f n = true → f_max n = true
g_min : ℕ → Bool := fun n => rec true (fun x x => false) n
hg_min : ∀ (n : ℕ), g_min n = true → g n = true
this : c / (1 - c) < 1
⊢ ∀ (b' : ℕ), b' ≠ 0 → cantorFunctionAux c (fun n => g_min n) b' = 0

tactic: cases n
state_before: case h.e'_4.refine'_1
c : ℝ
f✝¹ g✝¹ : ℕ → Bool
n✝¹ : ℕ
h1 : 0 < c
h2 : c < 1 / 2
n✝ : ℕ
f✝ g✝ : ℕ → Bool
hn✝¹ : ∀ (k : ℕ), k < n✝ → f✝ k = g✝ k
fn✝ : f✝ n✝ = false
gn✝ : g✝ n✝ = true
h3 : c < 1
f g : ℕ → Bool
hn✝ : ∀ (k : ℕ), k < zero → f k = g k
fn : f zero = false
gn : g zero = true
f_max : ℕ → Bool := fun n => rec false (fun x x => true) n
hf_max : ∀ (n : ℕ), f n = true → f_max n = true
g_min : ℕ → Bool := fun n => rec true (fun x x => false) n
hg_min : ∀ (n : ℕ), g_min n = true → g n = true
this : c / (1 - c) < 1
n : ℕ
hn : n ≠ 0
⊢ cantorFunctionAux c (fun n => g_min n) n = 0

tactic: contradiction
state_before: case h.e'_4.refine'_1.zero
c : ℝ
f✝¹ g✝¹ : ℕ → Bool
n✝ : ℕ
h1 : 0 < c
h2 : c < 1 / 2
n : ℕ
f✝ g✝ : ℕ → Bool
hn✝¹ : ∀ (k : ℕ), k < n → f✝ k = g✝ k
fn✝ : f✝ n = false
gn✝ : g✝ n = true
h3 : c < 1
f g : ℕ → Bool
hn✝ : ∀ (k : ℕ), k < zero → f k = g k
fn : f zero = false
gn : g zero = true
f_max : ℕ → Bool := fun n => rec false (fun x x => true) n
hf_max : ∀ (n : ℕ), f n = true → f_max n = true
g_min : ℕ → Bool := fun n => rec true (fun x x => false) n
hg_min : ∀ (n : ℕ), g_min n = true → g n = true
this : c / (1 - c) < 1
hn : zero ≠ 0
⊢ cantorFunctionAux c (fun n => g_min n) zero = 0

case h.e'_4.refine'_1.succ
c : ℝ
f✝¹ g✝¹ : ℕ → Bool
n✝¹ : ℕ
h1 : 0 < c
h2 : c < 1 / 2
n : ℕ
f✝ g✝ : ℕ → Bool
hn✝¹ : ∀ (k : ℕ), k < n → f✝ k = g✝ k
fn✝ : f✝ n = false
gn✝ : g✝ n = true
h3 : c < 1
f g : ℕ → Bool
hn✝ : ∀ (k : ℕ), k < zero → f k = g k
fn : f zero = false
gn : g zero = true
f_max : ℕ → Bool := fun n => rec false (fun x x => true) n
hf_max : ∀ (n : ℕ), f n = true → f_max n = true
g_min : ℕ → Bool := fun n => rec true (fun x x => false) n
hg_min : ∀ (n : ℕ), g_min n = true → g n = true
this : c / (1 - c) < 1
n✝ : ℕ
hn : succ n✝ ≠ 0
⊢ cantorFunctionAux c (fun n => g_min n) (succ n✝) = 0

tactic: rfl
state_before: case h.e'_4.refine'_1.succ
c : ℝ
f✝¹ g✝¹ : ℕ → Bool
n✝¹ : ℕ
h1 : 0 < c
h2 : c < 1 / 2
n : ℕ
f✝ g✝ : ℕ → Bool
hn✝¹ : ∀ (k : ℕ), k < n → f✝ k = g✝ k
fn✝ : f✝ n = false
gn✝ : g✝ n = true
h3 : c < 1
f g : ℕ → Bool
hn✝ : ∀ (k : ℕ), k < zero → f k = g k
fn : f zero = false
gn : g zero = true
f_max : ℕ → Bool := fun n => rec false (fun x x => true) n
hf_max : ∀ (n : ℕ), f n = true → f_max n = true
g_min : ℕ → Bool := fun n => rec true (fun x x => false) n
hg_min : ∀ (n : ℕ), g_min n = true → g n = true
this : c / (1 - c) < 1
n✝ : ℕ
hn : succ n✝ ≠ 0
⊢ cantorFunctionAux c (fun n => g_min n) (succ n✝) = 0

tactic: exact cantorFunctionAux_zero _
state_before: case h.e'_4.refine'_2
c : ℝ
f✝¹ g✝¹ : ℕ → Bool
n✝ : ℕ
h1 : 0 < c
h2 : c < 1 / 2
n : ℕ
f✝ g✝ : ℕ → Bool
hn✝ : ∀ (k : ℕ), k < n → f✝ k = g✝ k
fn✝ : f✝ n = false
gn✝ : g✝ n = true
h3 : c < 1
f g : ℕ → Bool
hn : ∀ (k : ℕ), k < zero → f k = g k
fn : f zero = false
gn : g zero = true
f_max : ℕ → Bool := fun n => rec false (fun x x => true) n
hf_max : ∀ (n : ℕ), f n = true → f_max n = true
g_min : ℕ → Bool := fun n => rec true (fun x x => false) n
hg_min : ∀ (n : ℕ), g_min n = true → g n = true
this : c / (1 - c) < 1
⊢ cantorFunctionAux c (fun n => g_min n) 0 = 1