File: Mathlib/Data/Bool/Count.lean

full_name: List.count_not_add_count
code: @[simp]
theorem count_not_add_count (l : List Bool) (b : Bool) : count (!b) l + count b l = length l 
goal: List.count (!b) l + List.count b l = l.length

full_name: List.count_add_count_not
code: @[simp]
theorem count_add_count_not (l : List Bool) (b : Bool) : count b l + count (!b) l = length l 
goal: List.count b l + List.count (!b) l = l.length

full_name: List.count_false_add_count_true
code: @[simp]
theorem count_false_add_count_true (l : List Bool) : count false l + count true l = length l 
goal: List.count false l + List.count true l = l.length

full_name: List.count_true_add_count_false
code: @[simp]
theorem count_true_add_count_false (l : List Bool) : count true l + count false l = length l 
goal: List.count true l + List.count false l = l.length

full_name: List.Chain.count_not
code: theorem Chain.count_not :
    ∀ {b : Bool} {l : List Bool}, Chain (· ≠ ·) b l → count (!b) l = count b l + length l % 2
  
goal: List.Chain (fun x x_1 => x ≠ x_1) b l → List.count (!b) l = List.count b l + l.length % 2

full_name: List.Chain'.count_not_eq_count
code: theorem count_not_eq_count (hl : Chain' (· ≠ ·) l) (h2 : Even (length l)) (b : Bool) :
    count (!b) l = count b l 
goal: List.count (!b) l = List.count b l

full_name: List.Chain'.count_false_eq_count_true
code: theorem count_false_eq_count_true (hl : Chain' (· ≠ ·) l) (h2 : Even (length l)) :
    count false l = count true l 
goal: List.count false l = List.count true l

full_name: List.Chain'.count_not_le_count_add_one
code: theorem count_not_le_count_add_one (hl : Chain' (· ≠ ·) l) (b : Bool) :
    count (!b) l ≤ count b l + 1 
goal: List.count (!b) l ≤ List.count b l + 1

full_name: List.Chain'.count_false_le_count_true_add_one
code: theorem count_false_le_count_true_add_one (hl : Chain' (· ≠ ·) l) :
    count false l ≤ count true l + 1 
goal: List.count false l ≤ List.count true l + 1

full_name: List.Chain'.count_true_le_count_false_add_one
code: theorem count_true_le_count_false_add_one (hl : Chain' (· ≠ ·) l) :
    count true l ≤ count false l + 1 
goal: List.count true l ≤ List.count false l + 1

full_name: List.Chain'.two_mul_count_bool_of_even
code: theorem two_mul_count_bool_of_even (hl : Chain' (· ≠ ·) l) (h2 : Even (length l)) (b : Bool) :
    2 * count b l = length l 
goal: 2 * List.count b l = l.length

full_name: List.Chain'.two_mul_count_bool_eq_ite
code: theorem two_mul_count_bool_eq_ite (hl : Chain' (· ≠ ·) l) (b : Bool) :
    2 * count b l =
      if Even (length l) then length l else
      if Option.some b == l.head? then length l + 1 else length l - 1 
goal: 2 * List.count b l =
  if Even l.length then l.length else if (some b == l.head?) = true then l.length + 1 else l.length - 1

full_name: List.Chain'.length_sub_one_le_two_mul_count_bool
code: theorem length_sub_one_le_two_mul_count_bool (hl : Chain' (· ≠ ·) l) (b : Bool) :
    length l - 1 ≤ 2 * count b l 
goal: l.length - 1 ≤ 2 * List.count b l

full_name: List.Chain'.length_div_two_le_count_bool
code: theorem length_div_two_le_count_bool (hl : Chain' (· ≠ ·) l) (b : Bool) :
    length l / 2 ≤ count b l 
goal: l.length / 2 ≤ List.count b l

full_name: List.Chain'.two_mul_count_bool_le_length_add_one
code: theorem two_mul_count_bool_le_length_add_one (hl : Chain' (· ≠ ·) l) (b : Bool) :
    2 * count b l ≤ length l + 1 
goal: 2 * List.count b l ≤ l.length + 1