l3lab/ntp-mathlib huggingface dataset:
@[simp]
theorem irrational_mul_nat_iff : Irrational (x * n) ↔ n ≠ 0 ∧ Irrational x := by
  

Proof state:
q : ℚ
m : ℤ
n : ℕ
x : ℝ
⊢ Irrational (x * ↑n) ↔ n ≠ 0 ∧ Irrational x

Next tactic:
rw [← cast_coe_nat, irrational_mul_rat_iff, Nat.cast_ne_zero]
@[simp]
theorem irrational_rat_div_iff : Irrational (q / x) ↔ q ≠ 0 ∧ Irrational x := by
  

Proof state:
q : ℚ
m : ℤ
n : ℕ
x : ℝ
⊢ Irrational (↑q / x) ↔ q ≠ 0 ∧ Irrational x

Next tactic:
simp [div_eq_mul_inv]
@[simp]
theorem irrational_div_rat_iff : Irrational (x / q) ↔ q ≠ 0 ∧ Irrational x := by
  

Proof state:
q : ℚ
m : ℤ
n : ℕ
x : ℝ
⊢ Irrational (x / ↑q) ↔ q ≠ 0 ∧ Irrational x

Next tactic:
rw [div_eq_mul_inv, ← cast_inv, irrational_mul_rat_iff, Ne.def, inv_eq_zero]
@[simp]
theorem irrational_int_div_iff : Irrational (m / x) ↔ m ≠ 0 ∧ Irrational x := by
  

Proof state:
q : ℚ
m : ℤ
n : ℕ
x : ℝ
⊢ Irrational (↑m / x) ↔ m ≠ 0 ∧ Irrational x

Next tactic:
simp [div_eq_mul_inv]
@[simp]
theorem irrational_div_int_iff : Irrational (x / m) ↔ m ≠ 0 ∧ Irrational x := by
  

Proof state:
q : ℚ
m : ℤ
n : ℕ
x : ℝ
⊢ Irrational (x / ↑m) ↔ m ≠ 0 ∧ Irrational x

Next tactic:
rw [← cast_coe_int, irrational_div_rat_iff, Int.cast_ne_zero]
@[simp]
theorem irrational_nat_div_iff : Irrational (n / x) ↔ n ≠ 0 ∧ Irrational x := by
  

Proof state:
q : ℚ
m : ℤ
n : ℕ
x : ℝ
⊢ Irrational (↑n / x) ↔ n ≠ 0 ∧ Irrational x

Next tactic:
simp [div_eq_mul_inv]
@[simp]
theorem irrational_div_nat_iff : Irrational (x / n) ↔ n ≠ 0 ∧ Irrational x := by
  

Proof state:
q : ℚ
m : ℤ
n : ℕ
x : ℝ
⊢ Irrational (x / ↑n) ↔ n ≠ 0 ∧ Irrational x

Next tactic:
rw [← cast_coe_nat, irrational_div_rat_iff, Nat.cast_ne_zero]
@[simp]
theorem bind_add (μ ν : Measure α) (κ : kernel α β) : (μ + ν).bind κ = μ.bind κ + ν.bind κ := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
mγ : MeasurableSpace γ
μ ν : Measure α
κ : ↥(kernel α β)
⊢ Measure.bind (μ + ν) ⇑κ = Measure.bind μ ⇑κ + Measure.bind ν ⇑κ

Next tactic:
ext1 s hs
@[simp]
theorem bind_add (μ ν : Measure α) (κ : kernel α β) : (μ + ν).bind κ = μ.bind κ + ν.bind κ := by
  ext1 s hs
  

Proof state:
case h
α : Type u_1
β : Type u_2
γ : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
mγ : MeasurableSpace γ
μ ν : Measure α
κ : ↥(kernel α β)
s : Set β
hs : MeasurableSet s
⊢ ↑↑(Measure.bind (μ + ν) ⇑κ) s = ↑↑(Measure.bind μ ⇑κ + Measure.bind ν ⇑κ) s

Next tactic:
rw [Measure.bind_apply hs (kernel.measurable _), lintegral_add_measure, Measure.coe_add,
    Pi.add_apply, Measure.bind_apply hs (kernel.measurable _),
    Measure.bind_apply hs (kernel.measurable _)]
@[simp]
theorem bind_smul (κ : kernel α β) (μ : Measure α) (r : ℝ≥0∞) : (r • μ).bind κ = r • μ.bind κ := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
mγ : MeasurableSpace γ
κ : ↥(kernel α β)
μ : Measure α
r : ℝ≥0∞
⊢ Measure.bind (r • μ) ⇑κ = r • Measure.bind μ ⇑κ

Next tactic:
ext1 s hs
@[simp]
theorem bind_smul (κ : kernel α β) (μ : Measure α) (r : ℝ≥0∞) : (r • μ).bind κ = r • μ.bind κ := by
  ext1 s hs
  

Proof state:
case h
α : Type u_1
β : Type u_2
γ : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
mγ : MeasurableSpace γ
κ : ↥(kernel α β)
μ : Measure α
r : ℝ≥0∞
s : Set β
hs : MeasurableSet s
⊢ ↑↑(Measure.bind (r • μ) ⇑κ) s = ↑↑(r • Measure.bind μ ⇑κ) s

Next tactic:
rw [Measure.bind_apply hs (kernel.measurable _), lintegral_smul_measure, Measure.coe_smul,
    Pi.smul_apply, Measure.bind_apply hs (kernel.measurable _), smul_eq_mul]
theorem const_bind_eq_comp_const (κ : kernel α β) (μ : Measure α) :
    const α (μ.bind κ) = κ ∘ₖ const α μ := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
mγ : MeasurableSpace γ
κ : ↥(kernel α β)
μ : Measure α
⊢ const α (Measure.bind μ ⇑κ) = κ ∘ₖ const α μ

Next tactic:
ext a s hs
theorem const_bind_eq_comp_const (κ : kernel α β) (μ : Measure α) :
    const α (μ.bind κ) = κ ∘ₖ const α μ := by
  ext a s hs
  

Proof state:
case h.h
α : Type u_1
β : Type u_2
γ : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
mγ : MeasurableSpace γ
κ : ↥(kernel α β)
μ : Measure α
a : α
s : Set β
hs : MeasurableSet s
⊢ ↑↑((const α (Measure.bind μ ⇑κ)) a) s = ↑↑((κ ∘ₖ const α μ) a) s

Next tactic:
simp_rw [comp_apply' _ _ _ hs, const_apply, Measure.bind_apply hs (kernel.measurable _)]
theorem comp_const_apply_eq_bind (κ : kernel α β) (μ : Measure α) (a : α) :
    (κ ∘ₖ const α μ) a = μ.bind κ := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
mγ : MeasurableSpace γ
κ : ↥(kernel α β)
μ : Measure α
a : α
⊢ (κ ∘ₖ const α μ) a = Measure.bind μ ⇑κ

Next tactic:
rw [← const_apply (μ.bind κ) a, const_bind_eq_comp_const κ μ]
theorem Invariant.comp_const (hκ : Invariant κ μ) : κ ∘ₖ const α μ = const α μ := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
mγ : MeasurableSpace γ
κ η : ↥(kernel α α)
μ : Measure α
hκ : Invariant κ μ
⊢ κ ∘ₖ const α μ = const α μ

Next tactic:
rw [← const_bind_eq_comp_const κ μ, hκ.def]
theorem Invariant.comp [IsSFiniteKernel κ] (hκ : Invariant κ μ) (hη : Invariant η μ) :
    Invariant (κ ∘ₖ η) μ := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
mγ : MeasurableSpace γ
κ η : ↥(kernel α α)
μ : Measure α
inst✝ : IsSFiniteKernel κ
hκ : Invariant κ μ
hη : Invariant η μ
⊢ Invariant (κ ∘ₖ η) μ

Next tactic:
cases' isEmpty_or_nonempty α with _ hα
theorem Invariant.comp [IsSFiniteKernel κ] (hκ : Invariant κ μ) (hη : Invariant η μ) :
    Invariant (κ ∘ₖ η) μ := by
  cases' isEmpty_or_nonempty α with _ hα
  · 

Proof state:
case inl
α : Type u_1
β : Type u_2
γ : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
mγ : MeasurableSpace γ
κ η : ↥(kernel α α)
μ : Measure α
inst✝ : IsSFiniteKernel κ
hκ : Invariant κ μ
hη : Invariant η μ
h✝ : IsEmpty α
⊢ Invariant (κ ∘ₖ η) μ

Next tactic:
exact Subsingleton.elim _ _
theorem Invariant.comp [IsSFiniteKernel κ] (hκ : Invariant κ μ) (hη : Invariant η μ) :
    Invariant (κ ∘ₖ η) μ := by
  cases' isEmpty_or_nonempty α with _ hα
  · exact Subsingleton.elim _ _
  · 

Proof state:
case inr
α : Type u_1
β : Type u_2
γ : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
mγ : MeasurableSpace γ
κ η : ↥(kernel α α)
μ : Measure α
inst✝ : IsSFiniteKernel κ
hκ : Invariant κ μ
hη : Invariant η μ
hα : Nonempty α
⊢ Invariant (κ ∘ₖ η) μ

Next tactic:
simp_rw [Invariant, ← comp_const_apply_eq_bind (κ ∘ₖ η) μ hα.some, comp_assoc, hη.comp_const,
      hκ.comp_const, const_apply]
theorem shiftLeft'_tt_eq_mul_pow (m) : ∀ n, shiftLeft' true m n + 1 = (m + 1) * 2 ^ n
  | 0 => by 

Proof state:
m : ℕ
⊢ shiftLeft' true m 0 + 1 = (m + 1) * 2 ^ 0

Next tactic:
simp [shiftLeft', pow_zero, Nat.one_mul]
theorem shiftLeft'_tt_eq_mul_pow (m) : ∀ n, shiftLeft' true m n + 1 = (m + 1) * 2 ^ n
  | 0 => by simp [shiftLeft', pow_zero, Nat.one_mul]
  | k + 1 => by
    

Proof state:
m k : ℕ
⊢ shiftLeft' true m (k + 1) + 1 = (m + 1) * 2 ^ (k + 1)

Next tactic:
change bit1 (shiftLeft' true m k) + 1 = (m + 1) * (2 ^ k * 2)
theorem shiftLeft'_tt_eq_mul_pow (m) : ∀ n, shiftLeft' true m n + 1 = (m + 1) * 2 ^ n
  | 0 => by simp [shiftLeft', pow_zero, Nat.one_mul]
  | k + 1 => by
    change bit1 (shiftLeft' true m k) + 1 = (m + 1) * (2 ^ k * 2)
    

Proof state:
m k : ℕ
⊢ bit1 (shiftLeft' true m k) + 1 = (m + 1) * (2 ^ k * 2)

Next tactic:
rw [bit1_val]
theorem shiftLeft'_tt_eq_mul_pow (m) : ∀ n, shiftLeft' true m n + 1 = (m + 1) * 2 ^ n
  | 0 => by simp [shiftLeft', pow_zero, Nat.one_mul]
  | k + 1 => by
    change bit1 (shiftLeft' true m k) + 1 = (m + 1) * (2 ^ k * 2)
    rw [bit1_val]
    

Proof state:
m k : ℕ
⊢ 2 * shiftLeft' true m k + 1 + 1 = (m + 1) * (2 ^ k * 2)

Next tactic:
change 2 * (shiftLeft' true m k + 1) = _
theorem shiftLeft'_tt_eq_mul_pow (m) : ∀ n, shiftLeft' true m n + 1 = (m + 1) * 2 ^ n
  | 0 => by simp [shiftLeft', pow_zero, Nat.one_mul]
  | k + 1 => by
    change bit1 (shiftLeft' true m k) + 1 = (m + 1) * (2 ^ k * 2)
    rw [bit1_val]
    change 2 * (shiftLeft' true m k + 1) = _
    

Proof state:
m k : ℕ
⊢ 2 * (shiftLeft' true m k + 1) = (m + 1) * (2 ^ k * 2)

Next tactic:
rw [shiftLeft'_tt_eq_mul_pow m k, mul_left_comm, mul_comm 2]
theorem shiftLeft'_ne_zero_left (b) {m} (h : m ≠ 0) (n) : shiftLeft' b m n ≠ 0 := by
  

Proof state:
b : Bool
m : ℕ
h : m ≠ 0
n : ℕ
⊢ shiftLeft' b m n ≠ 0

Next tactic:
induction n
theorem shiftLeft'_ne_zero_left (b) {m} (h : m ≠ 0) (n) : shiftLeft' b m n ≠ 0 := by
  induction n <;> 

Proof state:
case zero
b : Bool
m : ℕ
h : m ≠ 0
⊢ shiftLeft' b m zero ≠ 0

Next tactic:
simp [bit_ne_zero, shiftLeft', *]
theorem shiftLeft'_ne_zero_left (b) {m} (h : m ≠ 0) (n) : shiftLeft' b m n ≠ 0 := by
  induction n <;> 

Proof state:
case succ
b : Bool
m : ℕ
h : m ≠ 0
n✝ : ℕ
n_ih✝ : shiftLeft' b m n✝ ≠ 0
⊢ shiftLeft' b m (succ n✝) ≠ 0

Next tactic:
simp [bit_ne_zero, shiftLeft', *]
@[simp]
theorem size_zero : size 0 = 0 := by 

Proof state:
⊢ size 0 = 0

Next tactic:
simp [size]
@[simp]
theorem size_bit {b n} (h : bit b n ≠ 0) : size (bit b n) = succ (size n) := by
  

Proof state:
b : Bool
n : ℕ
h : bit b n ≠ 0
⊢ size (bit b n) = succ (size n)

Next tactic:
rw [size]
@[simp]
theorem size_bit {b n} (h : bit b n ≠ 0) : size (bit b n) = succ (size n) := by
  rw [size]
  

Proof state:
b : Bool
n : ℕ
h : bit b n ≠ 0
⊢ binaryRec 0 (fun x x => succ) (bit b n) = succ (binaryRec 0 (fun x x => succ) n)

Next tactic:
conv =>
    lhs
    rw [binaryRec]
    simp [h]
@[simp]
theorem size_bit {b n} (h : bit b n ≠ 0) : size (bit b n) = succ (size n) := by
  rw [size]
  conv =>
    

Proof state:
b : Bool
n : ℕ
h : bit b n ≠ 0
| binaryRec 0 (fun x x => succ) (bit b n) = succ (binaryRec 0 (fun x x => succ) n)

Next tactic:
lhs
    rw [binaryRec]
    simp [h]
@[simp]
theorem size_bit {b n} (h : bit b n ≠ 0) : size (bit b n) = succ (size n) := by
  rw [size]
  conv =>
    

Proof state:
b : Bool
n : ℕ
h : bit b n ≠ 0
| binaryRec 0 (fun x x => succ) (bit b n) = succ (binaryRec 0 (fun x x => succ) n)

Next tactic:
lhs
@[simp]
theorem size_bit {b n} (h : bit b n ≠ 0) : size (bit b n) = succ (size n) := by
  rw [size]
  conv =>
    lhs
    

Proof state:
b : Bool
n : ℕ
h : bit b n ≠ 0
| binaryRec 0 (fun x x => succ) (bit b n)

Next tactic:
rw [binaryRec]
@[simp]
theorem size_bit {b n} (h : bit b n ≠ 0) : size (bit b n) = succ (size n) := by
  rw [size]
  conv =>
    lhs
    rw [binaryRec]
    

Proof state:
b : Bool
n : ℕ
h : bit b n ≠ 0
| if n0 : bit b n = 0 then Eq.mpr (_ : ℕ = ℕ) 0
  else
    let n' := div2 (bit b n);
    let_fun _x := (_ : bit (bodd (bit b n)) (div2 (bit b n)) = bit b n);
    Eq.mpr (_ : ℕ = ℕ) (succ (binaryRec 0 (fun x x => succ) n'))

Next tactic:
simp [h]
@[simp]
theorem size_bit {b n} (h : bit b n ≠ 0) : size (bit b n) = succ (size n) := by
  rw [size]
  conv =>
    lhs
    rw [binaryRec]
    simp [h]
  

Proof state:
b : Bool
n : ℕ
h : bit b n ≠ 0
⊢ succ (binaryRec 0 (fun x x => succ) (div2 (bit b n))) = succ (binaryRec 0 (fun x x => succ) n)

Next tactic:
rw [div2_bit]
@[simp]
theorem size_one : size 1 = 1 :=
  show size (bit1 0) = 1 by 

Proof state:
⊢ size (bit1 0) = 1

Next tactic:
rw [size_bit1, size_zero]
@[simp]
theorem size_shiftLeft' {b m n} (h : shiftLeft' b m n ≠ 0) :
    size (shiftLeft' b m n) = size m + n := by
  

Proof state:
b : Bool
m n : ℕ
h : shiftLeft' b m n ≠ 0
⊢ size (shiftLeft' b m n) = size m + n

Next tactic:
induction' n with n IH
@[simp]
theorem size_shiftLeft' {b m n} (h : shiftLeft' b m n ≠ 0) :
    size (shiftLeft' b m n) = size m + n := by
  induction' n with n IH <;> 

Proof state:
case zero
b : Bool
m : ℕ
h : shiftLeft' b m zero ≠ 0
⊢ size (shiftLeft' b m zero) = size m + zero

Next tactic:
simp [shiftLeft'] at h ⊢
@[simp]
theorem size_shiftLeft' {b m n} (h : shiftLeft' b m n ≠ 0) :
    size (shiftLeft' b m n) = size m + n := by
  induction' n with n IH <;> 

Proof state:
case succ
b : Bool
m n : ℕ
IH : shiftLeft' b m n ≠ 0 → size (shiftLeft' b m n) = size m + n
h : shiftLeft' b m (succ n) ≠ 0
⊢ size (shiftLeft' b m (succ n)) = size m + succ n

Next tactic:
simp [shiftLeft'] at h ⊢
@[simp]
theorem size_shiftLeft' {b m n} (h : shiftLeft' b m n ≠ 0) :
    size (shiftLeft' b m n) = size m + n := by
  induction' n with n IH <;> simp [shiftLeft'] at h ⊢
  

Proof state:
case succ
b : Bool
m n : ℕ
IH : shiftLeft' b m n ≠ 0 → size (shiftLeft' b m n) = size m + n
h : ¬bit b (shiftLeft' b m n) = 0
⊢ size (bit b (shiftLeft' b m n)) = size m + succ n

Next tactic:
rw [size_bit h, Nat.add_succ]
@[simp]
theorem size_shiftLeft' {b m n} (h : shiftLeft' b m n ≠ 0) :
    size (shiftLeft' b m n) = size m + n := by
  induction' n with n IH <;> simp [shiftLeft'] at h ⊢
  rw [size_bit h, Nat.add_succ]
  

Proof state:
case succ
b : Bool
m n : ℕ
IH : shiftLeft' b m n ≠ 0 → size (shiftLeft' b m n) = size m + n
h : ¬bit b (shiftLeft' b m n) = 0
⊢ succ (size (shiftLeft' b m n)) = succ (size m + n)

Next tactic:
by_cases s0 : shiftLeft' b m n = 0 <;> [skip; rw [IH s0]]
@[simp]
theorem size_shiftLeft' {b m n} (h : shiftLeft' b m n ≠ 0) :
    size (shiftLeft' b m n) = size m + n := by
  induction' n with n IH <;> simp [shiftLeft'] at h ⊢
  rw [size_bit h, Nat.add_succ]
  

Proof state:
case succ
b : Bool
m n : ℕ
IH : shiftLeft' b m n ≠ 0 → size (shiftLeft' b m n) = size m + n
h : ¬bit b (shiftLeft' b m n) = 0
⊢ succ (size (shiftLeft' b m n)) = succ (size m + n)

Next tactic:
by_cases s0 : shiftLeft' b m n = 0
@[simp]
theorem size_shiftLeft' {b m n} (h : shiftLeft' b m n ≠ 0) :
    size (shiftLeft' b m n) = size m + n := by
  induction' n with n IH <;> simp [shiftLeft'] at h ⊢
  rw [size_bit h, Nat.add_succ]
  by_cases s0 : shiftLeft' b m n = 0 <;> [

Proof state:
case pos
b : Bool
m n : ℕ
IH : shiftLeft' b m n ≠ 0 → size (shiftLeft' b m n) = size m + n
h : ¬bit b (shiftLeft' b m n) = 0
s0 : shiftLeft' b m n = 0
⊢ succ (size (shiftLeft' b m n)) = succ (size m + n)

Next tactic:
skip
@[simp]
theorem size_shiftLeft' {b m n} (h : shiftLeft' b m n ≠ 0) :
    size (shiftLeft' b m n) = size m + n := by
  induction' n with n IH <;> simp [shiftLeft'] at h ⊢
  rw [size_bit h, Nat.add_succ]
  by_cases s0 : shiftLeft' b m n = 0 <;> [skip; 

Proof state:
case neg
b : Bool
m n : ℕ
IH : shiftLeft' b m n ≠ 0 → size (shiftLeft' b m n) = size m + n
h : ¬bit b (shiftLeft' b m n) = 0
s0 : ¬shiftLeft' b m n = 0
⊢ succ (size (shiftLeft' b m n)) = succ (size m + n)

Next tactic:
rw [IH s0]
@[simp]
theorem size_shiftLeft' {b m n} (h : shiftLeft' b m n ≠ 0) :
    size (shiftLeft' b m n) = size m + n := by
  induction' n with n IH <;> simp [shiftLeft'] at h ⊢
  rw [size_bit h, Nat.add_succ]
  by_cases s0 : shiftLeft' b m n = 0 <;> [skip; rw [IH s0]]
  

Proof state:
case pos
b : Bool
m n : ℕ
IH : shiftLeft' b m n ≠ 0 → size (shiftLeft' b m n) = size m + n
h : ¬bit b (shiftLeft' b m n) = 0
s0 : shiftLeft' b m n = 0
⊢ succ (size (shiftLeft' b m n)) = succ (size m + n)

Next tactic:
rw [s0] at h ⊢
@[simp]
theorem size_shiftLeft' {b m n} (h : shiftLeft' b m n ≠ 0) :
    size (shiftLeft' b m n) = size m + n := by
  induction' n with n IH <;> simp [shiftLeft'] at h ⊢
  rw [size_bit h, Nat.add_succ]
  by_cases s0 : shiftLeft' b m n = 0 <;> [skip; rw [IH s0]]
  rw [s0] at h ⊢
  

Proof state:
case pos
b : Bool
m n : ℕ
IH : shiftLeft' b m n ≠ 0 → size (shiftLeft' b m n) = size m + n
h : ¬bit b 0 = 0
s0 : shiftLeft' b m n = 0
⊢ succ (size 0) = succ (size m + n)

Next tactic:
cases b
@[simp]
theorem size_shiftLeft' {b m n} (h : shiftLeft' b m n ≠ 0) :
    size (shiftLeft' b m n) = size m + n := by
  induction' n with n IH <;> simp [shiftLeft'] at h ⊢
  rw [size_bit h, Nat.add_succ]
  by_cases s0 : shiftLeft' b m n = 0 <;> [skip; rw [IH s0]]
  rw [s0] at h ⊢
  cases b; · 

Proof state:
case pos.false
m n : ℕ
IH : shiftLeft' false m n ≠ 0 → size (shiftLeft' false m n) = size m + n
h : ¬bit false 0 = 0
s0 : shiftLeft' false m n = 0
⊢ succ (size 0) = succ (size m + n)

Next tactic:
exact absurd rfl h
@[simp]
theorem size_shiftLeft' {b m n} (h : shiftLeft' b m n ≠ 0) :
    size (shiftLeft' b m n) = size m + n := by
  induction' n with n IH <;> simp [shiftLeft'] at h ⊢
  rw [size_bit h, Nat.add_succ]
  by_cases s0 : shiftLeft' b m n = 0 <;> [skip; rw [IH s0]]
  rw [s0] at h ⊢
  cases b; · exact absurd rfl h
  

Proof state:
case pos.true
m n : ℕ
IH : shiftLeft' true m n ≠ 0 → size (shiftLeft' true m n) = size m + n
h : ¬bit true 0 = 0
s0 : shiftLeft' true m n = 0
⊢ succ (size 0) = succ (size m + n)

Next tactic:
have : shiftLeft' true m n + 1 = 1 := congr_arg (· + 1) s0
@[simp]
theorem size_shiftLeft' {b m n} (h : shiftLeft' b m n ≠ 0) :
    size (shiftLeft' b m n) = size m + n := by
  induction' n with n IH <;> simp [shiftLeft'] at h ⊢
  rw [size_bit h, Nat.add_succ]
  by_cases s0 : shiftLeft' b m n = 0 <;> [skip; rw [IH s0]]
  rw [s0] at h ⊢
  cases b; · exact absurd rfl h
  have : shiftLeft' true m n + 1 = 1 := congr_arg (· + 1) s0
  

Proof state:
case pos.true
m n : ℕ
IH : shiftLeft' true m n ≠ 0 → size (shiftLeft' true m n) = size m + n
h : ¬bit true 0 = 0
s0 : shiftLeft' true m n = 0
this : shiftLeft' true m n + 1 = 1
⊢ succ (size 0) = succ (size m + n)

Next tactic:
rw [shiftLeft'_tt_eq_mul_pow] at this
@[simp]
theorem size_shiftLeft' {b m n} (h : shiftLeft' b m n ≠ 0) :
    size (shiftLeft' b m n) = size m + n := by
  induction' n with n IH <;> simp [shiftLeft'] at h ⊢
  rw [size_bit h, Nat.add_succ]
  by_cases s0 : shiftLeft' b m n = 0 <;> [skip; rw [IH s0]]
  rw [s0] at h ⊢
  cases b; · exact absurd rfl h
  have : shiftLeft' true m n + 1 = 1 := congr_arg (· + 1) s0
  rw [shiftLeft'_tt_eq_mul_pow] at this
  

Proof state:
case pos.true
m n : ℕ
IH : shiftLeft' true m n ≠ 0 → size (shiftLeft' true m n) = size m + n
h : ¬bit true 0 = 0
s0 : shiftLeft' true m n = 0
this : (m + 1) * 2 ^ n = 1
⊢ succ (size 0) = succ (size m + n)

Next tactic:
obtain rfl := succ.inj (eq_one_of_dvd_one ⟨_, this.symm⟩)
@[simp]
theorem size_shiftLeft' {b m n} (h : shiftLeft' b m n ≠ 0) :
    size (shiftLeft' b m n) = size m + n := by
  induction' n with n IH <;> simp [shiftLeft'] at h ⊢
  rw [size_bit h, Nat.add_succ]
  by_cases s0 : shiftLeft' b m n = 0 <;> [skip; rw [IH s0]]
  rw [s0] at h ⊢
  cases b; · exact absurd rfl h
  have : shiftLeft' true m n + 1 = 1 := congr_arg (· + 1) s0
  rw [shiftLeft'_tt_eq_mul_pow] at this
  obtain rfl := succ.inj (eq_one_of_dvd_one ⟨_, this.symm⟩)
  

Proof state:
case pos.true
n : ℕ
h : ¬bit true 0 = 0
IH : shiftLeft' true 0 n ≠ 0 → size (shiftLeft' true 0 n) = size 0 + n
s0 : shiftLeft' true 0 n = 0
this : (0 + 1) * 2 ^ n = 1
⊢ succ (size 0) = succ (size 0 + n)

Next tactic:
simp only [zero_add, one_mul] at this
@[simp]
theorem size_shiftLeft' {b m n} (h : shiftLeft' b m n ≠ 0) :
    size (shiftLeft' b m n) = size m + n := by
  induction' n with n IH <;> simp [shiftLeft'] at h ⊢
  rw [size_bit h, Nat.add_succ]
  by_cases s0 : shiftLeft' b m n = 0 <;> [skip; rw [IH s0]]
  rw [s0] at h ⊢
  cases b; · exact absurd rfl h
  have : shiftLeft' true m n + 1 = 1 := congr_arg (· + 1) s0
  rw [shiftLeft'_tt_eq_mul_pow] at this
  obtain rfl := succ.inj (eq_one_of_dvd_one ⟨_, this.symm⟩)
  simp only [zero_add, one_mul] at this
  

Proof state:
case pos.true
n : ℕ
h : ¬bit true 0 = 0
IH : shiftLeft' true 0 n ≠ 0 → size (shiftLeft' true 0 n) = size 0 + n
s0 : shiftLeft' true 0 n = 0
this : 2 ^ n = 1
⊢ succ (size 0) = succ (size 0 + n)

Next tactic:
obtain rfl : n = 0 :=
    Nat.eq_zero_of_le_zero
      (le_of_not_gt fun hn => ne_of_gt (pow_lt_pow_right (by decide) hn) this)
@[simp]
theorem size_shiftLeft' {b m n} (h : shiftLeft' b m n ≠ 0) :
    size (shiftLeft' b m n) = size m + n := by
  induction' n with n IH <;> simp [shiftLeft'] at h ⊢
  rw [size_bit h, Nat.add_succ]
  by_cases s0 : shiftLeft' b m n = 0 <;> [skip; rw [IH s0]]
  rw [s0] at h ⊢
  cases b; · exact absurd rfl h
  have : shiftLeft' true m n + 1 = 1 := congr_arg (· + 1) s0
  rw [shiftLeft'_tt_eq_mul_pow] at this
  obtain rfl := succ.inj (eq_one_of_dvd_one ⟨_, this.symm⟩)
  simp only [zero_add, one_mul] at this
  obtain rfl : n = 0 :=
    Nat.eq_zero_of_le_zero
      (le_of_not_gt fun hn => ne_of_gt (pow_lt_pow_right (by 

Proof state:
n : ℕ
h : ¬bit true 0 = 0
IH : shiftLeft' true 0 n ≠ 0 → size (shiftLeft' true 0 n) = size 0 + n
s0 : shiftLeft' true 0 n = 0
this : 2 ^ n = 1
hn : n > 0
⊢ 1 < 2

Next tactic:
decide
@[simp]
theorem size_shiftLeft' {b m n} (h : shiftLeft' b m n ≠ 0) :
    size (shiftLeft' b m n) = size m + n := by
  induction' n with n IH <;> simp [shiftLeft'] at h ⊢
  rw [size_bit h, Nat.add_succ]
  by_cases s0 : shiftLeft' b m n = 0 <;> [skip; rw [IH s0]]
  rw [s0] at h ⊢
  cases b; · exact absurd rfl h
  have : shiftLeft' true m n + 1 = 1 := congr_arg (· + 1) s0
  rw [shiftLeft'_tt_eq_mul_pow] at this
  obtain rfl := succ.inj (eq_one_of_dvd_one ⟨_, this.symm⟩)
  simp only [zero_add, one_mul] at this
  obtain rfl : n = 0 :=
    Nat.eq_zero_of_le_zero
      (le_of_not_gt fun hn => ne_of_gt (pow_lt_pow_right (by decide) hn) this)
  

Proof state:
case pos.true
h : ¬bit true 0 = 0
IH : shiftLeft' true 0 0 ≠ 0 → size (shiftLeft' true 0 0) = size 0 + 0
s0 : shiftLeft' true 0 0 = 0
this : 2 ^ 0 = 1
⊢ succ (size 0) = succ (size 0 + 0)

Next tactic:
rfl
@[simp, nolint simpNF]
theorem size_shiftLeft {m} (h : m ≠ 0) (n) : size (m <<< n) = size m + n :=
  by 

Proof state:
m : ℕ
h : m ≠ 0
n : ℕ
⊢ size (m <<< n) = size m + n

Next tactic:
simp only [size_shiftLeft' (shiftLeft'_ne_zero_left _ h _), ← shiftLeft'_false]
theorem lt_size_self (n : ℕ) : n < 2 ^ size n := by
  

Proof state:
n : ℕ
⊢ n < 2 ^ size n

Next tactic:
rw [← one_shiftLeft]
theorem lt_size_self (n : ℕ) : n < 2 ^ size n := by
  rw [← one_shiftLeft]
  

Proof state:
n : ℕ
⊢ n < 1 <<< size n

Next tactic:
have : ∀ {n}, n = 0 → n < 1 <<< (size n) := by simp
theorem lt_size_self (n : ℕ) : n < 2 ^ size n := by
  rw [← one_shiftLeft]
  have : ∀ {n}, n = 0 → n < 1 <<< (size n) := by 

Proof state:
n : ℕ
⊢ ∀ {n : ℕ}, n = 0 → n < 1 <<< size n

Next tactic:
simp
theorem lt_size_self (n : ℕ) : n < 2 ^ size n := by
  rw [← one_shiftLeft]
  have : ∀ {n}, n = 0 → n < 1 <<< (size n) := by simp
  

Proof state:
n : ℕ
this : ∀ {n : ℕ}, n = 0 → n < 1 <<< size n
⊢ n < 1 <<< size n

Next tactic:
apply binaryRec _ _ n
theorem lt_size_self (n : ℕ) : n < 2 ^ size n := by
  rw [← one_shiftLeft]
  have : ∀ {n}, n = 0 → n < 1 <<< (size n) := by simp
  apply binaryRec _ _ n
  · 

Proof state:
n : ℕ
this : ∀ {n : ℕ}, n = 0 → n < 1 <<< size n
⊢ 0 < 1 <<< size 0

Next tactic:
apply this rfl
theorem lt_size_self (n : ℕ) : n < 2 ^ size n := by
  rw [← one_shiftLeft]
  have : ∀ {n}, n = 0 → n < 1 <<< (size n) := by simp
  apply binaryRec _ _ n
  · apply this rfl
  

Proof state:
n : ℕ
this : ∀ {n : ℕ}, n = 0 → n < 1 <<< size n
⊢ ∀ (b : Bool), ∀ n < 1 <<< size n, bit b n < 1 <<< size (bit b n)

Next tactic:
intro b n IH
theorem lt_size_self (n : ℕ) : n < 2 ^ size n := by
  rw [← one_shiftLeft]
  have : ∀ {n}, n = 0 → n < 1 <<< (size n) := by simp
  apply binaryRec _ _ n
  · apply this rfl
  intro b n IH
  

Proof state:
n✝ : ℕ
this : ∀ {n : ℕ}, n = 0 → n < 1 <<< size n
b : Bool
n : ℕ
IH : n < 1 <<< size n
⊢ bit b n < 1 <<< size (bit b n)

Next tactic:
by_cases h : bit b n = 0
theorem lt_size_self (n : ℕ) : n < 2 ^ size n := by
  rw [← one_shiftLeft]
  have : ∀ {n}, n = 0 → n < 1 <<< (size n) := by simp
  apply binaryRec _ _ n
  · apply this rfl
  intro b n IH
  by_cases h : bit b n = 0
  · 

Proof state:
case pos
n✝ : ℕ
this : ∀ {n : ℕ}, n = 0 → n < 1 <<< size n
b : Bool
n : ℕ
IH : n < 1 <<< size n
h : bit b n = 0
⊢ bit b n < 1 <<< size (bit b n)

Next tactic:
apply this h
theorem lt_size_self (n : ℕ) : n < 2 ^ size n := by
  rw [← one_shiftLeft]
  have : ∀ {n}, n = 0 → n < 1 <<< (size n) := by simp
  apply binaryRec _ _ n
  · apply this rfl
  intro b n IH
  by_cases h : bit b n = 0
  · apply this h
  

Proof state:
case neg
n✝ : ℕ
this : ∀ {n : ℕ}, n = 0 → n < 1 <<< size n
b : Bool
n : ℕ
IH : n < 1 <<< size n
h : ¬bit b n = 0
⊢ bit b n < 1 <<< size (bit b n)

Next tactic:
rw [size_bit h, shiftLeft_succ, shiftLeft_eq, one_mul, ← bit0_val]