Download data/lean/OAI/Combinatorics/MatchingEntropy/Model.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 2.02 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Combinatorics/MatchingEntropy/Model.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Combinatorics/MatchingEntropy/Model.lean
-
curl -L -o Model.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Combinatorics/MatchingEntropy/Model.lean
2.02 kB
| import Mathlib | |
| namespace OAI | |
| noncomputable section | |
| open scoped BigOperators Topology | |
| open Filter | |
| universe uV uE uIndex uΞΉ | |
| namespace MatchingEntropyBounds | |
| structure LooplessGraph (V : Type uV) (E : Type uE) where | |
| left : E β V | |
| right : E β V | |
| loopless : β e, left e β right e | |
| variable {V : Type uV} {E : Type uE} | |
| [Fintype V] [Fintype E] [DecidableEq V] [DecidableEq E] | |
| namespace LooplessGraph | |
| def Incident (G : LooplessGraph V E) (v : V) (e : E) : Prop := | |
| G.left e = v β¨ G.right e = v | |
| instance incidentDecidable (G : LooplessGraph V E) (v : V) (e : E) : | |
| Decidable (G.Incident v e) := inferInstanceAs (Decidable (G.left e = v β¨ G.right e = v)) | |
| def IsPerfectMatching (G : LooplessGraph V E) (M : Finset E) : Prop := | |
| β v, β! e, e β M β§ G.Incident v e | |
| abbrev Matching (G : LooplessGraph V E) := {M : Finset E // G.IsPerfectMatching M} | |
| instance matchingFintype (G : LooplessGraph V E) : Fintype G.Matching := | |
| Fintype.ofFinite _ | |
| def indicator (G : LooplessGraph V E) (M : G.Matching) (e : E) : β := | |
| if e β M.val then 1 else 0 | |
| def polytope (G : LooplessGraph V E) : Set (E β β) := | |
| convexHull β (Set.range G.indicator) | |
| def mean (G : LooplessGraph V E) (p : G.Matching β β) (e : E) : β := | |
| β M, p M * G.indicator M e | |
| end LooplessGraph | |
| def probabilitySimplex (Index : Type uIndex) [Fintype Index] : Set (Index β β) := | |
| {weights | (β index, 0 β€ weights index) β§ β index, weights index = 1} | |
| namespace LooplessGraph | |
| def feasibleLaws (G : LooplessGraph V E) (y : E β β) : Set (G.Matching β β) := | |
| {p | p β probabilitySimplex G.Matching β§ G.mean p = y} | |
| end LooplessGraph | |
| def entropy {ΞΉ : Type uΞΉ} [Fintype ΞΉ] (p : ΞΉ β β) : β := | |
| β i, Real.negMulLog (p i) | |
| def maxMatchingEntropy (G : LooplessGraph V E) (y : E β β) : β := | |
| sSup (entropy '' G.feasibleLaws y) | |
| namespace Refined | |
| def complementEntropy (x : E β β) : β := entropy (fun e => 1 - x e) | |
| end Refined | |
| end MatchingEntropyBounds | |
| end | |
| end OAI | |