Documentation

Atlas.AnAlgorithmistsToolkit.code.HallTheorem

def HallTheorem.BipartiteExpander {L : Type u_1} {R : Type u_2} [DecidableEq R] [Fintype L] (neighbors : L → Finset R) (α β : ℝ) :
Instances For
    theorem HallTheorem.hall_marriage_theorem {L : Type u_1} {R : Type u_2} [Finite L] [DecidableEq R] (neighbors : L → Finset R) :
    (∀ (S : Finset L), S.card ≤ (S.biUnion neighbors).card) ↔ ∃ (f : L → R), Function.Injective f ∧ ∀ (x : L), f x ∈ neighbors x
    theorem HallTheorem.bipartite_expander_matching {L : Type u_1} {R : Type u_2} [DecidableEq L] [DecidableEq R] [Fintype L] (neighbors : L → Finset R) (α β : ℝ) (hexp : BipartiteExpander neighbors α β) (hβ : 1 < β) (S : Finset L) (hS : ↑S.card ≤ α * ↑(Fintype.card L)) :
    ∃ (f : ↥S → R), Function.Injective f ∧ ∀ (x : ↥S), f x ∈ neighbors ↑x
    structure HallTheorem.MultibutterflyNetwork (N numLayers : ℕ) :
    Instances For
      structure HallTheorem.LayerAssignment (N : ℕ) (α : ℝ) :
      Instances For
        def HallTheorem.RoutingAssignment (N numLayers : ℕ) (α : ℝ) :
        Instances For
          theorem HallTheorem.multibutterfly_can_route {N numLayers : ℕ} (net : MultibutterflyNetwork N numLayers) (assignments : RoutingAssignment N numLayers net.α) (i : Fin numLayers) :
          (∃ (fUp : ↥(assignments i).up → Fin N), Function.Injective fUp ∧ ∀ (x : ↥(assignments i).up), fUp x ∈ net.upNeighbors i ↑x) ∧ ∃ (fDown : ↥(assignments i).down → Fin N), Function.Injective fDown ∧ ∀ (x : ↥(assignments i).down), fDown x ∈ net.downNeighbors i ↑x
          def HallTheorem.uniqueNeighbors {L : Type u_1} {R : Type u_2} [DecidableEq L] [DecidableEq R] (neighbors : L → Finset R) (S : Finset L) :
          Instances For
            theorem HallTheorem.unique_neighbors_lower_bound {L : Type u_1} {R : Type u_2} [DecidableEq R] (neighbors : L → Finset R) (d : ℕ) (β : ℝ) (S : Finset L) (hexp : β * ↑S.card ≤ ↑(S.biUnion neighbors).card) (A B : Finset R) (hAB_union : A ∪ B = S.biUnion neighbors) (hAB_disj : Disjoint A B) (hedge : ↑A.card + 2 * ↑B.card ≤ ↑d * ↑S.card) :
            (2 * β - ↑d) * ↑S.card ≤ ↑A.card
            def SimpleGraph.rightDegreeInS {L : Type u_1} {R : Type u_2} (G : SimpleGraph (L ⊕ R)) [DecidableRel G.Adj] (S : Finset L) (r : R) :
            Instances For
              def SimpleGraph.uniqueNeighbors {L : Type u_1} {R : Type u_2} [Fintype R] (G : SimpleGraph (L ⊕ R)) [DecidableRel G.Adj] (S : Finset L) :
              Instances For
                def SimpleGraph.multiNeighbors {L : Type u_1} {R : Type u_2} [Fintype R] (G : SimpleGraph (L ⊕ R)) [DecidableRel G.Adj] (S : Finset L) :
                Instances For
                  def SimpleGraph.IsBipartiteOn {L : Type u_1} {R : Type u_2} (G : SimpleGraph (L ⊕ R)) :
                  Instances For
                    theorem SimpleGraph.card_filter_adj_right_eq_of_regular_bipartite {L : Type u_1} {R : Type u_2} [Fintype L] [Fintype R] (G : SimpleGraph (L ⊕ R)) [DecidableRel G.Adj] {d : ℕ} (hbip : G.IsBipartiteOn) (hreg : G.IsRegularOfDegree d) (l : L) :
                    {r : R | G.Adj (Sum.inl l) (Sum.inr r)}.card = d
                    theorem SimpleGraph.sum_leftRightDegree_eq_d_mul_card {L : Type u_1} {R : Type u_2} [Fintype L] [Fintype R] (G : SimpleGraph (L ⊕ R)) [DecidableRel G.Adj] {d : ℕ} (hbip : G.IsBipartiteOn) (hreg : G.IsRegularOfDegree d) (S : Finset L) :
                    ∑ l ∈ S, {r : R | G.Adj (Sum.inl l) (Sum.inr r)}.card = d * S.card
                    theorem SimpleGraph.double_count_edges {L : Type u_1} {R : Type u_2} [Fintype R] (G : SimpleGraph (L ⊕ R)) [DecidableRel G.Adj] (S : Finset L) :
                    ∑ l ∈ S, {r : R | G.Adj (Sum.inl l) (Sum.inr r)}.card = ∑ r : R, G.rightDegreeInS S r
                    theorem SimpleGraph.sum_rightDegreeInS_ge {L : Type u_1} {R : Type u_2} [Fintype R] [DecidableEq R] (G : SimpleGraph (L ⊕ R)) [DecidableRel G.Adj] (S : Finset L) :
                    ∑ r : R, G.rightDegreeInS S r ≥ (G.uniqueNeighbors S).card + 2 * (G.multiNeighbors S).card
                    theorem SimpleGraph.unique_neighbors_lower_bound {L : Type u_1} {R : Type u_2} [Fintype L] [Fintype R] [DecidableEq R] (G : SimpleGraph (L ⊕ R)) [DecidableRel G.Adj] {d : ℕ} {α β : ℝ} (hbip : G.IsBipartiteOn) (hreg : G.IsRegularOfDegree d) (hexp : G.IsBipartiteExpander α β) (S : Finset L) (hS : ↑S.card ≤ α * ↑(Fintype.card L)) :
                    ↑(G.uniqueNeighbors S).card ≥ (2 * β - ↑d) * ↑S.card