{
  "artifactId": "artifact.library.mathlib.hall-marriage-theorem.v001",
  "candidateOnly": false,
  "category": "Combinatorics",
  "claimBoundary": "This is Mathlib's indexed-Finset equivalence. It concerns finite member sets t i, checks every finite subfamily s, and concludes the existence of an injective representative function; the page does not substitute a different graph-theoretic formulation.",
  "collectionSlug": "landmark-theorems-in-mathlib",
  "exactFormalStatement": "theorem Finset.all_card_le_biUnion_card_iff_exists_injective {ι : Type u} {α : Type v} [DecidableEq α] (t : ι → Finset α) : (∀ s : Finset ι, s.card ≤ (s.biUnion t).card) ↔ ∃ f : ι → α, Function.Injective f ∧ ∀ x : ι, f x ∈ t x",
  "family": "Matchings and systems of representatives",
  "id": "library.mathlib.hall-marriage-theorem.v001",
  "links": {
    "collection": "/collections/landmark-theorems-in-mathlib/",
    "collectionData": "/data/collections/mathlib-landmarks.json",
    "entry": "/library-theorems/hall-marriage-theorem/",
    "entryData": "/data/library-theorems/hall-marriage-theorem.json",
    "evidence": "/proofs/artifact.library.mathlib.hall-marriage-theorem.v001.html",
    "evidenceData": "/data/proofs/artifact.library.mathlib.hall-marriage-theorem.v001.evidence.json",
    "source": "/sources/upstream/hall-marriage-theorem/"
  },
  "landmark": {
    "completeFormalType": "Finset.all_card_le_biUnion_card_iff_exists_injective {ι : Type u} {α : Type v} [DecidableEq α] (t : ι → Finset α) : (∀ s : Finset ι, s.card ≤ (s.biUnion t).card) ↔ ∃ f : ι → α, Function.Injective f ∧ ∀ x : ι, f x ∈ t x",
    "concepts": [
      "matchings",
      "finite sets",
      "injective choice",
      "systems of representatives"
    ],
    "plainLanguage": "Suppose each index i is assigned a finite set t i. One can choose an element f i from every t i with no two indices choosing the same element exactly when, for every finite collection of indices, the union of their assigned sets has at least as many elements as that collection.",
    "poster": {
      "alt": "An ivory theorem poster compares the union-size condition for every finite indexed subfamily with an injective choice of one allowed representative per index, leaving unused target elements visible.",
      "byteSize": 2065189,
      "caption": "Every finite-subfamily union condition is shown equivalent to a total injective representative function, without implying surjectivity onto the target type.",
      "description": "The left side selects a finite subfamily of indexed Finsets, forms its union, and compares the two cardinalities. The right side highlights one distinct allowed representative per index while many elements of alpha remain unused. A lower strip names all five scope ingredients before an injective-not-onto footer.",
      "derivatives": [
        {
          "byteSize": 92580,
          "height": 960,
          "mediaType": "image/webp",
          "publicPath": "/assets/library-theorems/hall-marriage-theorem/theorem-poster-v1-640.webp",
          "sha256": "sha256:0065b1a0844daa919e8bbc58fac08a1325861f04edad9a8ab338957be99ccb0f",
          "width": 640
        },
        {
          "byteSize": 166966,
          "height": 1536,
          "mediaType": "image/webp",
          "publicPath": "/assets/library-theorems/hall-marriage-theorem/theorem-poster-v1-1024.webp",
          "sha256": "sha256:4a0f6a2e026007a6ef64b0721ff8aa01f0a43befb4a67251b1036fa3d1eb92bc",
          "width": 1024
        }
      ],
      "generatedAt": "2026-07-18T16:13:38.723Z",
      "height": 1536,
      "mediaType": "image/png",
      "modelRequested": "gpt-image-2",
      "publicPath": "/assets/library-theorems/hall-marriage-theorem/theorem-poster-v1.png",
      "sha256": "sha256:881f65abd5aade789ecf0be0987256585db6df2bdf75f735a8a040563f806014",
      "title": "Hall's Marriage Theorem at a glance",
      "width": 1024,
      "kind": "theorem_poster",
      "transcript": "COMBINATORICS · DISTINCT REPRESENTATIVES\nHALL'S MARRIAGE THEOREM\ni ↦ t(i)\n∀ finite s, |s| ≤ |⋃ i∈s t(i)|\n⇔\n∃ injective f with f(i) ∈ t(i)\nEVERY MEMBER SET t(i) IS FINITE\nTEST EVERY FINITE SUBFAMILY\nENOUGH ELEMENTS IN EACH UNION\nONE DISTINCT ALLOWED CHOICE PER INDEX\nARBITRARY INDEX TYPE ι\nEXACT SCOPE\nThe representative function is injective, not necessarily onto α."
    },
    "visual": {
      "alt": "Six emerald vertices and six ivory vertices are paired row by row by six gold edges, with faint alternative bipartite edges and nested neighborhood contours.",
      "byteSize": 2164361,
      "caption": "A system of distinct representatives appears as one selected edge at every left and right endpoint.",
      "description": "Two columns contain exactly six vertices each. Six thick horizontal gold edges pair the rows one to one, while faint diagonal candidate edges and nested cobalt contours suggest the surrounding family of choices and neighborhood conditions.",
      "derivatives": [
        {
          "byteSize": 19612,
          "height": 427,
          "mediaType": "image/webp",
          "publicPath": "/assets/library-theorems/hall-marriage-theorem/theorem-schematic-v1-640.webp",
          "sha256": "sha256:5d06bc2d60754f9e53764e4d28a6108f61f993b0067bffd04558ec6edfeac4b9",
          "width": 640
        },
        {
          "byteSize": 53838,
          "height": 800,
          "mediaType": "image/webp",
          "publicPath": "/assets/library-theorems/hall-marriage-theorem/theorem-schematic-v1-1200.webp",
          "sha256": "sha256:c350328c4641242d39037e0eabcb7b36f628f1d333b3fc6128fcdaccb30ee8e5",
          "width": 1200
        }
      ],
      "generatedAt": "2026-07-17T20:17:12Z",
      "height": 1024,
      "mediaType": "image/png",
      "modelRequested": "gpt-image-2",
      "publicPath": "/assets/library-theorems/hall-marriage-theorem/theorem-schematic-v1.png",
      "sha256": "sha256:34de0bfe0b1e6388c44c8498e474b792790fe026c4782452102064da937252d5",
      "title": "Hall matching schematic",
      "width": 1536
    },
    "walkthrough": {
      "introduction": "Mathlib's arbitrary-index Hall theorem builds finite local matching spaces, organizes their restrictions into an inverse system, uses compactness to select a coherent section, extracts a global injective representative function, and proves the converse by cardinality comparison.",
      "pages": [
        {
          "alt": "Ivory cards pair green index medallions with distinct blue candidate beads, while a finite fan shows several valid local matchings.",
          "byteSize": 3021602,
          "caption": "Every finite subfamily has a finite, nonempty space of injective representative choices.",
          "description": "For a finite index set ι', hallMatchingsOn stores functions into α that are injective and choose inside each assigned finite set. The Hall inequality feeds the finite theorem to prove nonemptiness, while encoding a matching into the finite union proves that this local matching space is finite.",
          "derivatives": [
            {
              "byteSize": 40406,
              "height": 427,
              "mediaType": "image/webp",
              "publicPath": "/assets/library-theorems/hall-marriage-theorem/proof-walkthrough-01-v1-640.webp",
              "sha256": "sha256:a2d8940d7a352e0b0028cc52985739d78035dda871f7175b72b603b47bdc53ed",
              "width": 640
            },
            {
              "byteSize": 145938,
              "height": 800,
              "mediaType": "image/webp",
              "publicPath": "/assets/library-theorems/hall-marriage-theorem/proof-walkthrough-01-v1-1200.webp",
              "sha256": "sha256:129b8edb310bf08e6680c3928f40224dc6890634d9b2ceda6a8b99153b34f23d",
              "width": 1200
            }
          ],
          "generatedAt": "2026-07-20T18:29:34Z",
          "height": 1024,
          "mediaType": "image/png",
          "modelRequested": "gpt-image-2",
          "publicPath": "/assets/library-theorems/hall-marriage-theorem/proof-walkthrough-01-v1.png",
          "sha256": "sha256:e3aec5a2cd7efb589e0d9463e5afc2b65dcc2790cae30c55cd149498c88e4a48",
          "title": "Build finite local matchings",
          "width": 1536,
          "equation": "Nonempty (hallMatchingsOn t ι') ∧ Finite (hallMatchingsOn t ι')",
          "kind": "proof_walkthrough_page",
          "sequenceIndex": 1
        },
        {
          "alt": "Three descending ivory cards preserve the same selected gold threads as green medallions and blue beads are removed by restriction.",
          "byteSize": 2724859,
          "caption": "A matching on a larger finite subfamily restricts to the same choices on every smaller one.",
          "description": "hallMatchingsOn.restrict precomposes a larger local matching with the subset inclusion and retains injectivity and membership. hallMatchingsFunctor uses exactly these restriction maps, reversing inclusions through the opposite category.",
          "derivatives": [
            {
              "byteSize": 29116,
              "height": 427,
              "mediaType": "image/webp",
              "publicPath": "/assets/library-theorems/hall-marriage-theorem/proof-walkthrough-02-v1-640.webp",
              "sha256": "sha256:3e9a16cffa0b9b4bf8c59af6760f18e0e92fb9141e914b0093bcfb998e18baf9",
              "width": 640
            },
            {
              "byteSize": 101812,
              "height": 800,
              "mediaType": "image/webp",
              "publicPath": "/assets/library-theorems/hall-marriage-theorem/proof-walkthrough-02-v1-1200.webp",
              "sha256": "sha256:fbe99a95e3c173b947cab1854117546034a49f12bccd1c615ee6b702b442ebdc",
              "width": 1200
            }
          ],
          "generatedAt": "2026-07-20T18:35:45Z",
          "height": 1024,
          "mediaType": "image/png",
          "modelRequested": "gpt-image-2",
          "publicPath": "/assets/library-theorems/hall-marriage-theorem/proof-walkthrough-02-v1.png",
          "sha256": "sha256:88c42e4bcb9e405d2a884ac38f3d5b0d23aec401cc3b469c9caf544170cd2027",
          "title": "Restrict larger matchings",
          "width": 1536,
          "equation": "hallMatchingsOn t ι'' → hallMatchingsOn t ι'",
          "kind": "proof_walkthrough_page",
          "sequenceIndex": 2
        },
        {
          "alt": "Many finite matching cards surround a central archival lens, with gold restriction paths aligning their selected threads into one coherent family.",
          "byteSize": 2957945,
          "caption": "Compactness selects local matchings for all finite subfamilies so that every restriction agrees.",
          "description": "Because each object of hallMatchingsFunctor is nonempty and finite, nonempty_sections_of_finite_inverse_system supplies a section u together with compatibility hu. This coherence, rather than an arbitrary independent choice on each finite set, is the bridge to one global function.",
          "derivatives": [
            {
              "byteSize": 52758,
              "height": 427,
              "mediaType": "image/webp",
              "publicPath": "/assets/library-theorems/hall-marriage-theorem/proof-walkthrough-03-v1-640.webp",
              "sha256": "sha256:6d759615e40737c8dd063c00c75685e3763f1dafccf4917524211aea7bfd7594",
              "width": 640
            },
            {
              "byteSize": 166720,
              "height": 800,
              "mediaType": "image/webp",
              "publicPath": "/assets/library-theorems/hall-marriage-theorem/proof-walkthrough-03-v1-1200.webp",
              "sha256": "sha256:45c42b8f3bda7330cd7b9f8d74d3df4c7a61413aabe1be365349ece7f0aeb9e8",
              "width": 1200
            }
          ],
          "generatedAt": "2026-07-20T18:38:39Z",
          "height": 1024,
          "mediaType": "image/png",
          "modelRequested": "gpt-image-2",
          "publicPath": "/assets/library-theorems/hall-marriage-theorem/proof-walkthrough-03-v1.png",
          "sha256": "sha256:20459e522e560de21ce64c5d8739fcc39359da91a1651c3ce7b48344a3fc647d",
          "title": "Choose a coherent section",
          "width": 1536,
          "equation": "obtain ⟨u, hu⟩ := nonempty_sections_of_finite_inverse_system ...",
          "kind": "proof_walkthrough_page",
          "sequenceIndex": 3
        },
        {
          "alt": "Inset singleton cards feed selected gold threads into one centered two-index card, with every thread terminating at a distinct allowed blue bead.",
          "byteSize": 2656117,
          "caption": "Singleton values form the global choice, while pairwise coherence forces those choices to be injective.",
          "description": "The function takes i from the coherent matching on the singleton containing i. For i and i', hu compares both singleton choices with the matching on their pair, whose injectivity proves equality of values can only come from equality of indices. The singleton matching also proves f i belongs to t i.",
          "derivatives": [
            {
              "byteSize": 31150,
              "height": 427,
              "mediaType": "image/webp",
              "publicPath": "/assets/library-theorems/hall-marriage-theorem/proof-walkthrough-04-v1-640.webp",
              "sha256": "sha256:6c27dfb1778869d656925168491f0b8a7e19811293a9aa3fcb03c86276b7ca88",
              "width": 640
            },
            {
              "byteSize": 96722,
              "height": 800,
              "mediaType": "image/webp",
              "publicPath": "/assets/library-theorems/hall-marriage-theorem/proof-walkthrough-04-v1-1200.webp",
              "sha256": "sha256:7f729c10d6d0fa3b10bd64eba866f685c458d1b871705323f4c985ff7d78740c",
              "width": 1200
            }
          ],
          "generatedAt": "2026-07-20T18:52:31Z",
          "height": 1024,
          "mediaType": "image/png",
          "modelRequested": "gpt-image-2",
          "publicPath": "/assets/library-theorems/hall-marriage-theorem/proof-walkthrough-04-v1.png",
          "sha256": "sha256:2b26adfb845a58086c0169af5b745b5c165dbe60e0a984d08f5f65b4c9da616a",
          "title": "Read off the global injective choice",
          "width": 1536,
          "equation": "∃ f, Function.Injective f ∧ ∀ i, f i ∈ t i",
          "kind": "proof_walkthrough_page",
          "sequenceIndex": 4
        },
        {
          "alt": "Four green indices map to four distinct selected blue beads, which sit inside a larger outlined union containing additional unused candidates.",
          "byteSize": 2605926,
          "caption": "Any injective representative choice sends each finite subfamily into its allowed union, so cardinalities satisfy Hall's condition.",
          "description": "Injectivity rewrites the size of s as the size of s.image f. Membership of every representative places that image inside s.biUnion t, and card_le_card gives the desired inequality. This closes the reverse implication and therefore the exact equivalence.",
          "derivatives": [
            {
              "byteSize": 23348,
              "height": 427,
              "mediaType": "image/webp",
              "publicPath": "/assets/library-theorems/hall-marriage-theorem/proof-walkthrough-05-v1-640.webp",
              "sha256": "sha256:e6421c7928fa990e5bf865804e0a7d46433de38cfb949c7c5da1d68fe8cf36d8",
              "width": 640
            },
            {
              "byteSize": 77444,
              "height": 800,
              "mediaType": "image/webp",
              "publicPath": "/assets/library-theorems/hall-marriage-theorem/proof-walkthrough-05-v1-1200.webp",
              "sha256": "sha256:0713b44d36184f915b190a0fef34b1922dae58669eb3feee6002ee2bcaacaab7",
              "width": 1200
            }
          ],
          "generatedAt": "2026-07-20T18:51:12Z",
          "height": 1024,
          "mediaType": "image/png",
          "modelRequested": "gpt-image-2",
          "publicPath": "/assets/library-theorems/hall-marriage-theorem/proof-walkthrough-05-v1.png",
          "sha256": "sha256:50f875aa52a7bcea24df5fc6ea7e394eaafb211cd1e3403234a83e617a771fb1",
          "title": "Recover the Hall inequalities",
          "width": 1536,
          "equation": "(∀ s, #s ≤ #(s.biUnion t)) ↔ ∃ f, Function.Injective f ∧ ∀ i, f i ∈ t i",
          "kind": "proof_walkthrough_page",
          "sequenceIndex": 5
        }
      ],
      "title": "From finite matchings to one global choice"
    },
    "whyLandmark": "Hall's theorem characterizes when a perfect system of distinct representatives exists. It is a cornerstone of matching theory and finite combinatorics; Mathlib's selected statement allows an arbitrary index type while testing every finite subfamily."
  },
  "nonClaims": [
    "Proof Atlas did not originate Hall's theorem or Mathlib's declaration.",
    "The selected declaration includes an arbitrary index type and a finite-subfamily condition.",
    "The explanatory matching diagram is not a proof of the equivalence."
  ],
  "publicExportEligible": true,
  "relationship": "upstream_direct",
  "schemaVersion": "library-theorem-entry-data.v1",
  "statementId": "statement.library.mathlib.hall-marriage-theorem.v001",
  "statusAxes": {
    "acceptedAtlasResult": "Not recorded for the preferred artifact",
    "locallyReproduced": "Exact upstream declaration replayed",
    "reviewedPage": "Current public presentation reviewed",
    "upstreamIndexed": "Pinned source bytes verified locally"
  },
  "summary": "A family of finite sets has distinct representatives exactly when every finite subfamily has a union at least as large as the subfamily.",
  "targetId": "target.library.mathlib.hall-marriage-theorem.v001",
  "title": "Hall's Marriage Theorem",
  "upstreamOrigin": {
    "declarationName": "Finset.all_card_le_biUnion_card_iff_exists_injective",
    "immutableSourceUrl": "https://github.com/leanprover-community/mathlib4/blob/5e932f97dd25535344f80f9dd8da3aab83df0fe6/Mathlib/Combinatorics/Hall/Basic.lean#L116",
    "packageName": "mathlib",
    "repositoryUrl": "https://github.com/leanprover-community/mathlib4",
    "sourceArtifactHash": "sha256:dab48f10ac7d10b7190b88f8b7e2447b55be1af098358a9f5318d66c675b2382",
    "sourceByteLength": 9649,
    "sourceCommit": "5e932f97dd25535344f80f9dd8da3aab83df0fe6",
    "sourceFile": "Mathlib/Combinatorics/Hall/Basic.lean",
    "sourceLine": 116,
    "verificationKind": "git_worktree"
  },
  "publicPresentationReview": {
    "status": "reviewed"
  }
}
