Download data/lean/OAI/Computability/PerfectCompleteness/Foundations/KeyFiniteness.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 3.56 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Computability/PerfectCompleteness/Foundations/KeyFiniteness.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Computability/PerfectCompleteness/Foundations/KeyFiniteness.lean
-
curl -L -o KeyFiniteness.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Computability/PerfectCompleteness/Foundations/KeyFiniteness.lean
3.56 kB
| import Mathlib.Algebra.Order.BigOperators.Group.Finset | |
| import OAI.Computability.PerfectCompleteness.Construction.TreeSourceSpaces | |
| import OAI.Computability.PerfectCompleteness.Foundations.CanonicalKeys | |
| import OAI.Computability.PerfectCompleteness.Reduction.SourceGame | |
| namespace OAI | |
| section | |
| namespace PerfectCompleteness.CanonicalKeys | |
| open ClauseSupport MixedSupport | |
| open scoped BigOperators | |
| variable {n : Nat} {Y : Type*} | |
| abbrev KeyLabel (k : Key n) := β₯k.partition | |
| instance KeyLabel_finite (k : Key n) : Finite (KeyLabel k) := by | |
| let : Finite ReducedValue := ReducedDomains.reducedValue_finite | |
| exact Finite.of_injective (fun P : KeyLabel k => P.val) Subtype.val_injective | |
| instance keyLabel_nonempty (side : Side) (slots : Fin n β Slot) | |
| (f : Assignment slots β Y) : Nonempty (KeyLabel (key side slots f)) := by | |
| change Nonempty (Label slots f) | |
| infer_instance | |
| theorem label_finite (slots : Fin n β Slot) (f : Assignment slots β Y) : | |
| Finite (Label slots f) := by | |
| infer_instance | |
| theorem label_nonempty (slots : Fin n β Slot) (f : Assignment slots β Y) : | |
| Nonempty (Label slots f) := by | |
| infer_instance | |
| theorem card_label_le_output [Finite Y] (slots : Fin n β Slot) | |
| (f : Assignment slots β Y) : Nat.card (Label slots f) β€ Nat.card Y := | |
| Nat.card_le_card_of_injective (restore slots f) (restore_injective slots f) | |
| theorem card_label_le_assignment (slots : Fin n β Slot) (f : Assignment slots β Y) : | |
| Nat.card (Label slots f) β€ Nat.card (Assignment slots) := | |
| ReducedPartition.card_parts_le (reduction slots f) f | |
| def answerEquivFinSeven (signs : SourceClause.Triple) : Answer signs β Fin 7 where | |
| toFun u := SourceGame.encodeLabel signs u.val | |
| ((SourceClause.mem_satisfyingTriples signs u.val).mp u.property) | |
| invFun i := β¨SourceGame.decodeLabel signs i, SourceGame.decodeLabel_mem signs iβ© | |
| left_inv u := by | |
| apply Subtype.ext | |
| exact SourceGame.decodeLabel_encodeLabel signs u.val _ | |
| right_inv i := by | |
| apply SourceGame.decodeLabel_injective signs | |
| exact SourceGame.decodeLabel_encodeLabel signs (SourceGame.decodeLabel signs i) _ | |
| theorem card_answer (signs : SourceClause.Triple) : Nat.card (Answer signs) = 7 := by | |
| simpa only [Nat.card_fin] using Nat.card_congr (answerEquivFinSeven signs) | |
| theorem card_slotDomain_le_seven (s : Slot) : Nat.card s.Domain β€ 7 := by | |
| cases s with | |
| | clause occurrence variableIDs signs => exact (card_answer signs).le | |
| | bit variableID => | |
| change Nat.card Bool β€ 7 | |
| simp | |
| theorem card_assignment_le_seven_pow (slots : Fin n β Slot) : | |
| Nat.card (Assignment slots) β€ 7 ^ n := by | |
| change Nat.card (β i : Fin n, (slots i).Domain) β€ _ | |
| rw [Nat.card_pi] | |
| calc | |
| (β i : Fin n, Nat.card (slots i).Domain) β€ β _i : Fin n, (7 : Nat) := | |
| Finset.prod_le_prod (fun i _ => card_slotDomain_le_seven (slots i)) | |
| _ = 7 ^ n := by simp | |
| theorem card_label_le_seven_pow (slots : Fin n β Slot) (f : Assignment slots β Y) : | |
| Nat.card (Label slots f) β€ 7 ^ n := | |
| (card_label_le_assignment slots f).trans (card_assignment_le_seven_pow slots) | |
| theorem card_keyLabel_le_output [Finite Y] (side : Side) (slots : Fin n β Slot) | |
| (f : Assignment slots β Y) : Nat.card (KeyLabel (key side slots f)) β€ Nat.card Y := | |
| card_label_le_output slots f | |
| theorem card_keyLabel_le_seven_pow (side : Side) (slots : Fin n β Slot) | |
| (f : Assignment slots β Y) : Nat.card (KeyLabel (key side slots f)) β€ 7 ^ n := | |
| card_label_le_seven_pow slots f | |
| end PerfectCompleteness.CanonicalKeys | |
| end | |
| end OAI | |