p : ℕ → Prop
inst✝ : DecidablePred p
a b : ℕ
this : Disjoint (filter p (range a)) (filter p (map (addLeftEmbedding a) (range b)))
⊢ count p (a + b) = count p a + count (fun k => p (a + k)) b
p : ℕ → Prop
inst✝ : DecidablePred p
a b : ℕ
⊢ count p (a + b) = count p a + count (fun k => p (a + k)) b
have : Disjoint ((range a).filter p) (((range b).map <| addLeftEmbedding a).filter p) := by
  apply disjoint_filter_filter
  rw [Finset.disjoint_left]
  simp_rw [mem_map, mem_range, addLeftEmbedding_apply]
  rintro x hx ⟨c, _, rfl⟩
  exact (self_le_add_right _ _).not_lt hx
p : ℕ → Prop
inst✝ : DecidablePred p
a b : ℕ
this : Disjoint (filter p (range a)) (filter p (map (addLeftEmbedding a) (range b)))
⊢ card (filter p (range a)) +
      card
        (filter (p ∘ ↑{ toFun := fun h => a + h, inj' := (_ : Function.Injective ((fun x x_1 => x + x_1) a)) })
          (range b)) =
    card (filter p (range a)) + card (filter (fun k => p (a + k)) (range b))
p : ℕ → Prop
inst✝ : DecidablePred p
a b : ℕ
this : Disjoint (filter p (range a)) (filter p (map (addLeftEmbedding a) (range b)))
⊢ count p (a + b) = count p a + count (fun k => p (a + k)) b
simp_rw [count_eq_card_filter_range, range_add, filter_union, card_disjoint_union this,
  filter_map, addLeftEmbedding, card_map]
no goals
p : ℕ → Prop
inst✝ : DecidablePred p
a b : ℕ
this : Disjoint (filter p (range a)) (filter p (map (addLeftEmbedding a) (range b)))
⊢ card (filter p (range a)) +
      card
        (filter (p ∘ ↑{ toFun := fun h => a + h, inj' := (_ : Function.Injective ((fun x x_1 => x + x_1) a)) })
          (range b)) =
    card (filter p (range a)) + card (filter (fun k => p (a + k)) (range b))
rfl
case a
p : ℕ → Prop
inst✝ : DecidablePred p
a b : ℕ
⊢ Disjoint (range a) (map (addLeftEmbedding a) (range b))
p : ℕ → Prop
inst✝ : DecidablePred p
a b : ℕ
⊢ Disjoint (filter p (range a)) (filter p (map (addLeftEmbedding a) (range b)))
apply disjoint_filter_filter
case a
p : ℕ → Prop
inst✝ : DecidablePred p
a b : ℕ
⊢ ∀ ⦃a_1 : ℕ⦄, a_1 ∈ range a → ¬a_1 ∈ map (addLeftEmbedding a) (range b)
case a
p : ℕ → Prop
inst✝ : DecidablePred p
a b : ℕ
⊢ Disjoint (range a) (map (addLeftEmbedding a) (range b))
rw [Finset.disjoint_left]
case a
p : ℕ → Prop
inst✝ : DecidablePred p
a b : ℕ
⊢ ∀ ⦃a_1 : ℕ⦄, a_1 < a → ¬∃ a_3, a_3 < b ∧ a + a_3 = a_1
case a
p : ℕ → Prop
inst✝ : DecidablePred p
a b : ℕ
⊢ ∀ ⦃a_1 : ℕ⦄, a_1 ∈ range a → ¬a_1 ∈ map (addLeftEmbedding a) (range b)
simp_rw [mem_map, mem_range, addLeftEmbedding_apply]
case a.intro.intro
p : ℕ → Prop
inst✝ : DecidablePred p
a b c : ℕ
left✝ : c < b
hx : a + c < a
⊢ False
case a
p : ℕ → Prop
inst✝ : DecidablePred p
a b : ℕ
⊢ ∀ ⦃a_1 : ℕ⦄, a_1 < a → ¬∃ a_3, a_3 < b ∧ a + a_3 = a_1
rintro x hx ⟨c, _, rfl⟩
no goals
case a.intro.intro
p : ℕ → Prop
inst✝ : DecidablePred p
a b c : ℕ
left✝ : c < b
hx : a + c < a
⊢ False
exact (self_le_add_right _ _).not_lt hx