File: Mathlib/Combinatorics/Enumerative/DoubleCounting.lean

full_name: Finset.bipartiteBelow
code: /-- Elements of `s` which are "below" `b` according to relation `r`. -/
def bipartiteBelow : Finset α 
goal: Finset α

full_name: Finset.bipartiteAbove
code: /-- Elements of `t` which are "above" `a` according to relation `r`. -/
def bipartiteAbove : Finset β 
goal: Finset β

full_name: Finset.bipartiteBelow_swap
code: theorem bipartiteBelow_swap : t.bipartiteBelow (swap r) a = t.bipartiteAbove r a 
goal: Finset.bipartiteBelow (Function.swap r) t a = Finset.bipartiteAbove r t a

full_name: Finset.bipartiteAbove_swap
code: theorem bipartiteAbove_swap : s.bipartiteAbove (swap r) b = s.bipartiteBelow r b 
goal: Finset.bipartiteAbove (Function.swap r) s b = Finset.bipartiteBelow r s b

full_name: Finset.coe_bipartiteBelow
code: @[simp, norm_cast]
theorem coe_bipartiteBelow : (s.bipartiteBelow r b : Set α) = { a ∈ s | r a b } 
goal: ↑(Finset.bipartiteBelow r s b) = {a | a ∈ s ∧ r a b}

full_name: Finset.coe_bipartiteAbove
code: @[simp, norm_cast]
theorem coe_bipartiteAbove : (t.bipartiteAbove r a : Set β) = { b ∈ t | r a b } 
goal: ↑(Finset.bipartiteAbove r t a) = {b | b ∈ t ∧ r a b}

full_name: Finset.mem_bipartiteBelow
code: @[simp]
theorem mem_bipartiteBelow {a : α} : a ∈ s.bipartiteBelow r b ↔ a ∈ s ∧ r a b 
goal: a ∈ Finset.bipartiteBelow r s b ↔ a ∈ s ∧ r a b

full_name: Finset.mem_bipartiteAbove
code: @[simp]
theorem mem_bipartiteAbove {b : β} : b ∈ t.bipartiteAbove r a ↔ b ∈ t ∧ r a b 
goal: b ∈ Finset.bipartiteAbove r t a ↔ b ∈ t ∧ r a b

full_name: Finset.sum_card_bipartiteAbove_eq_sum_card_bipartiteBelow
code: theorem sum_card_bipartiteAbove_eq_sum_card_bipartiteBelow [∀ a b, Decidable (r a b)] :
    (∑ a ∈ s, (t.bipartiteAbove r a).card) = ∑ b ∈ t, (s.bipartiteBelow r b).card 
goal: ∑ a ∈ s, (Finset.bipartiteAbove r t a).card = ∑ b ∈ t, (Finset.bipartiteBelow r s b).card

full_name: Finset.card_mul_le_card_mul
code: /-- Double counting argument. Considering `r` as a bipartite graph, the LHS is a lower bound on the
number of edges while the RHS is an upper bound. -/
theorem card_mul_le_card_mul [∀ a b, Decidable (r a b)]
    (hm : ∀ a ∈ s, m ≤ (t.bipartiteAbove r a).card)
    (hn : ∀ b ∈ t, (s.bipartiteBelow r b).card ≤ n) : s.card * m ≤ t.card * n 
goal: s.card * m ≤ t.card * n

full_name: Finset.card_mul_le_card_mul'
code: theorem card_mul_le_card_mul' [∀ a b, Decidable (r a b)]
    (hn : ∀ b ∈ t, n ≤ (s.bipartiteBelow r b).card)
    (hm : ∀ a ∈ s, (t.bipartiteAbove r a).card ≤ m) : t.card * n ≤ s.card * m 
goal: t.card * n ≤ s.card * m

full_name: Finset.card_mul_eq_card_mul
code: theorem card_mul_eq_card_mul [∀ a b, Decidable (r a b)]
    (hm : ∀ a ∈ s, (t.bipartiteAbove r a).card = m)
    (hn : ∀ b ∈ t, (s.bipartiteBelow r b).card = n) : s.card * m = t.card * n 
goal: s.card * m = t.card * n

full_name: Finset.card_le_card_of_forall_subsingleton
code: theorem card_le_card_of_forall_subsingleton (hs : ∀ a ∈ s, ∃ b, b ∈ t ∧ r a b)
    (ht : ∀ b ∈ t, ({ a ∈ s | r a b } : Set α).Subsingleton) : s.card ≤ t.card 
goal: s.card ≤ t.card

full_name: Finset.card_le_card_of_forall_subsingleton'
code: theorem card_le_card_of_forall_subsingleton' (ht : ∀ b ∈ t, ∃ a, a ∈ s ∧ r a b)
    (hs : ∀ a ∈ s, ({ b ∈ t | r a b } : Set β).Subsingleton) : t.card ≤ s.card 
goal: t.card ≤ s.card

full_name: Fintype.card_le_card_of_leftTotal_unique
code: theorem card_le_card_of_leftTotal_unique (h₁ : LeftTotal r) (h₂ : LeftUnique r) :
    Fintype.card α ≤ Fintype.card β 
goal: Fintype.card α ≤ Fintype.card β

full_name: Fintype.card_le_card_of_rightTotal_unique
code: theorem card_le_card_of_rightTotal_unique (h₁ : RightTotal r) (h₂ : RightUnique r) :
    Fintype.card β ≤ Fintype.card α 
goal: Fintype.card β ≤ Fintype.card α