The areas / V01. The language of Mathlib
Mathlib.Data.Bool.Count
15 declarations. Mathlib docs · Source
theorem List.count_not_add_count E0 #
∀ (l : List Bool) (b : Bool), List.count (!b) l + List.count b l = l.length
theorem List.count_add_count_not E0 #
∀ (l : List Bool) (b : Bool), List.count b l + List.count (!b) l = l.length
theorem List.count_false_add_count_true E0 #
∀ (l : List Bool), List.count false l + List.count true l = l.length
theorem List.count_true_add_count_false E0 #
∀ (l : List Bool), List.count true l + List.count false l = l.length
theorem List.IsChain.count_not_cons E1 #
∀ {b : Bool} {l : List Bool},
List.IsChain (fun x1 x2 ↦ x1 ≠ x2) (b :: l) → List.count (!b) l = List.count b l + l.length % 2
theorem List.IsChain.count_not_eq_count E1 #
∀ {l : List Bool},
List.IsChain (fun x1 x2 ↦ x1 ≠ x2) l → Even l.length → ∀ (b : Bool), List.count (!b) l = List.count b l
theorem List.IsChain.count_false_eq_count_true E1 #
∀ {l : List Bool}, List.IsChain (fun x1 x2 ↦ x1 ≠ x2) l → Even l.length → List.count false l = List.count true l
theorem List.IsChain.count_not_le_count_add_one E1 #
∀ {l : List Bool}, List.IsChain (fun x1 x2 ↦ x1 ≠ x2) l → ∀ (b : Bool), List.count (!b) l ≤ List.count b l + 1
theorem List.IsChain.count_false_le_count_true_add_one E1 #
∀ {l : List Bool}, List.IsChain (fun x1 x2 ↦ x1 ≠ x2) l → List.count false l ≤ List.count true l + 1
theorem List.IsChain.count_true_le_count_false_add_one E1 #
∀ {l : List Bool}, List.IsChain (fun x1 x2 ↦ x1 ≠ x2) l → List.count true l ≤ List.count false l + 1
theorem List.IsChain.two_mul_count_bool_of_even E1 #
∀ {l : List Bool}, List.IsChain (fun x1 x2 ↦ x1 ≠ x2) l → Even l.length → ∀ (b : Bool), 2 * List.count b l = l.length
theorem List.IsChain.two_mul_count_bool_eq_ite E1 #
∀ {l : List Bool},
List.IsChain (fun x1 x2 ↦ x1 ≠ x2) l →
∀ (b : Bool),
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
theorem List.IsChain.length_sub_one_le_two_mul_count_bool E1 #
∀ {l : List Bool}, List.IsChain (fun x1 x2 ↦ x1 ≠ x2) l → ∀ (b : Bool), l.length - 1 ≤ 2 * List.count b l
theorem List.IsChain.length_div_two_le_count_bool E1 #
∀ {l : List Bool}, List.IsChain (fun x1 x2 ↦ x1 ≠ x2) l → ∀ (b : Bool), l.length / 2 ≤ List.count b l
theorem List.IsChain.two_mul_count_bool_le_length_add_one E1 #
∀ {l : List Bool}, List.IsChain (fun x1 x2 ↦ x1 ≠ x2) l → ∀ (b : Bool), 2 * List.count b l ≤ l.length + 1