Theorem: FreeGroup.Red.sizeof_of_step
File: Mathlib/GroupTheory/FreeGroup/Basic.lean

tactic: induction L1 with
| nil =>
  dsimp
  simp only [Bool.sizeOf_eq_one]
  have H :
    1 + (1 + 1) + (1 + (1 + 1) + sizeOf L2) =
      sizeOf L2 + (1 + ((1 + 1) + (1 + 1) + 1)) := by
    ac_rfl
  rw [H]
  apply Nat.lt_add_of_pos_right
  apply Nat.lt_add_right
  apply Nat.zero_lt_one
| cons hd tl ih =>
  dsimp
  exact Nat.add_lt_add_left ih _
state_before: α : Type u
L L₁ L₂ L₃ L₄ L1 L2 : List (α × Bool)
x : α
b : Bool
⊢ sizeOf (L1 ++ L2) < sizeOf (L1 ++ (x, b) :: (x, !b) :: L2)
state_after: no goals

tactic: dsimp
state_before: case nil
α : Type u
L L₁ L₂ L₃ L₄ L2 : List (α × Bool)
x : α
b : Bool
⊢ sizeOf ([] ++ L2) < sizeOf ([] ++ (x, b) :: (x, !b) :: L2)
state_after: case nil
α : Type u
L L₁ L₂ L₃ L₄ L2 : List (α × Bool)
x : α
b : Bool
⊢ sizeOf L2 < 1 + (1 + sizeOf b) + (1 + (1 + sizeOf !b) + sizeOf L2)

tactic: simp only [Bool.sizeOf_eq_one]
state_before: case nil
α : Type u
L L₁ L₂ L₃ L₄ L2 : List (α × Bool)
x : α
b : Bool
⊢ sizeOf L2 < 1 + (1 + sizeOf b) + (1 + (1 + sizeOf !b) + sizeOf L2)
state_after: case nil
α : Type u
L L₁ L₂ L₃ L₄ L2 : List (α × Bool)
x : α
b : Bool
⊢ sizeOf L2 < 1 + (1 + 1) + (1 + (1 + 1) + sizeOf L2)

tactic: have H :
  1 + (1 + 1) + (1 + (1 + 1) + sizeOf L2) =
    sizeOf L2 + (1 + ((1 + 1) + (1 + 1) + 1)) := by
  ac_rfl
state_before: case nil
α : Type u
L L₁ L₂ L₃ L₄ L2 : List (α × Bool)
x : α
b : Bool
⊢ sizeOf L2 < 1 + (1 + 1) + (1 + (1 + 1) + sizeOf L2)
state_after: case nil
α : Type u
L L₁ L₂ L₃ L₄ L2 : List (α × Bool)
x : α
b : Bool
H : 1 + (1 + 1) + (1 + (1 + 1) + sizeOf L2) = sizeOf L2 + (1 + (1 + 1 + (1 + 1) + 1))
⊢ sizeOf L2 < 1 + (1 + 1) + (1 + (1 + 1) + sizeOf L2)

tactic: rw [H]
state_before: case nil
α : Type u
L L₁ L₂ L₃ L₄ L2 : List (α × Bool)
x : α
b : Bool
H : 1 + (1 + 1) + (1 + (1 + 1) + sizeOf L2) = sizeOf L2 + (1 + (1 + 1 + (1 + 1) + 1))
⊢ sizeOf L2 < 1 + (1 + 1) + (1 + (1 + 1) + sizeOf L2)
state_after: case nil
α : Type u
L L₁ L₂ L₃ L₄ L2 : List (α × Bool)
x : α
b : Bool
H : 1 + (1 + 1) + (1 + (1 + 1) + sizeOf L2) = sizeOf L2 + (1 + (1 + 1 + (1 + 1) + 1))
⊢ sizeOf L2 < sizeOf L2 + (1 + (1 + 1 + (1 + 1) + 1))

tactic: apply Nat.lt_add_of_pos_right
state_before: case nil
α : Type u
L L₁ L₂ L₃ L₄ L2 : List (α × Bool)
x : α
b : Bool
H : 1 + (1 + 1) + (1 + (1 + 1) + sizeOf L2) = sizeOf L2 + (1 + (1 + 1 + (1 + 1) + 1))
⊢ sizeOf L2 < sizeOf L2 + (1 + (1 + 1 + (1 + 1) + 1))
state_after: case nil.h
α : Type u
L L₁ L₂ L₃ L₄ L2 : List (α × Bool)
x : α
b : Bool
H : 1 + (1 + 1) + (1 + (1 + 1) + sizeOf L2) = sizeOf L2 + (1 + (1 + 1 + (1 + 1) + 1))
⊢ 0 < 1 + (1 + 1 + (1 + 1) + 1)

tactic: apply Nat.lt_add_right
state_before: case nil.h
α : Type u
L L₁ L₂ L₃ L₄ L2 : List (α × Bool)
x : α
b : Bool
H : 1 + (1 + 1) + (1 + (1 + 1) + sizeOf L2) = sizeOf L2 + (1 + (1 + 1 + (1 + 1) + 1))
⊢ 0 < 1 + (1 + 1 + (1 + 1) + 1)
state_after: case nil.h.h
α : Type u
L L₁ L₂ L₃ L₄ L2 : List (α × Bool)
x : α
b : Bool
H : 1 + (1 + 1) + (1 + (1 + 1) + sizeOf L2) = sizeOf L2 + (1 + (1 + 1 + (1 + 1) + 1))
⊢ 0 < 1

tactic: apply Nat.zero_lt_one
state_before: case nil.h.h
α : Type u
L L₁ L₂ L₃ L₄ L2 : List (α × Bool)
x : α
b : Bool
H : 1 + (1 + 1) + (1 + (1 + 1) + sizeOf L2) = sizeOf L2 + (1 + (1 + 1 + (1 + 1) + 1))
⊢ 0 < 1
state_after: no goals

tactic: ac_rfl
state_before: α : Type u
L L₁ L₂ L₃ L₄ L2 : List (α × Bool)
x : α
b : Bool
⊢ 1 + (1 + 1) + (1 + (1 + 1) + sizeOf L2) = sizeOf L2 + (1 + (1 + 1 + (1 + 1) + 1))
state_after: no goals

tactic: dsimp
state_before: case cons
α : Type u
L L₁ L₂ L₃ L₄ L2 : List (α × Bool)
x : α
b : Bool
hd : α × Bool
tl : List (α × Bool)
ih : sizeOf (tl ++ L2) < sizeOf (tl ++ (x, b) :: (x, !b) :: L2)
⊢ sizeOf (hd :: tl ++ L2) < sizeOf (hd :: tl ++ (x, b) :: (x, !b) :: L2)
state_after: case cons
α : Type u
L L₁ L₂ L₃ L₄ L2 : List (α × Bool)
x : α
b : Bool
hd : α × Bool
tl : List (α × Bool)
ih : sizeOf (tl ++ L2) < sizeOf (tl ++ (x, b) :: (x, !b) :: L2)
⊢ 1 + sizeOf hd + sizeOf (tl ++ L2) < 1 + sizeOf hd + sizeOf (tl ++ (x, b) :: (x, !b) :: L2)

tactic: exact Nat.add_lt_add_left ih _
state_before: case cons
α : Type u
L L₁ L₂ L₃ L₄ L2 : List (α × Bool)
x : α
b : Bool
hd : α × Bool
tl : List (α × Bool)
ih : sizeOf (tl ++ L2) < sizeOf (tl ++ (x, b) :: (x, !b) :: L2)
⊢ 1 + sizeOf hd + sizeOf (tl ++ L2) < 1 + sizeOf hd + sizeOf (tl ++ (x, b) :: (x, !b) :: L2)
state_after: no goals