math / data /lean /OAI /Computability /PerfectCompleteness /Machines /CanonicalCoarseningEncoding.lean
Download data/lean/OAI/Computability/PerfectCompleteness/Machines/CanonicalCoarseningEncoding.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 8.92 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Computability/PerfectCompleteness/Machines/CanonicalCoarseningEncoding.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Computability/PerfectCompleteness/Machines/CanonicalCoarseningEncoding.lean
-
curl -L -o CanonicalCoarseningEncoding.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Computability/PerfectCompleteness/Machines/CanonicalCoarseningEncoding.lean
8.92 kB
| import OAI.Computability.PerfectCompleteness.Foundations.CanonicalEdgesLemmas | |
| import OAI.Computability.PerfectCompleteness.Foundations.QuotientTableAgreementLemmas | |
| import OAI.Computability.PerfectCompleteness.Machines.CanonicalLabelEncoding | |
| namespace OAI | |
| section | |
| namespace PerfectCompleteness.CanonicalCoarseningEncoding | |
| open MixedSupport CanonicalKeys CanonicalEdges | |
| noncomputable section | |
| universe uY uY' uZ uZ' | |
| variable {n : Nat} {Y : Type uY} {Y' : Type uY'} {Z : Type uZ} {Z' : Type uZ'} | |
| theorem fineKernel (slots : Fin n β Slot) (f : Assignment slots β Y) | |
| (eL : Y β Y') (heL : Function.Injective eL) : | |
| β x x', f x = f x' β (eL β f) x = (eL β f) x' := by | |
| intro x x' | |
| exact β¨fun h => congrArg eL h, fun h => heL hβ© | |
| theorem coarseKernel (slots : Fin n β Slot) (f : Assignment slots β Y) | |
| (p : Y β Z) (eL : Y β Y') (eR : Z β Z') (p' : Y' β Z') | |
| (heR : Function.Injective eR) (commutes : β y, p' (eL y) = eR (p y)) : | |
| β x x', (p β f) x = (p β f) x' β | |
| (p' β (eL β f)) x = (p' β (eL β f)) x' := by | |
| intro x x' | |
| change p (f x) = p (f x') β p' (eL (f x)) = p' (eL (f x')) | |
| rw [commutes (f x), commutes (f x')] | |
| exact β¨fun h => congrArg eR h, fun h => heR hβ© | |
| theorem key_fine (side : Side) (slots : Fin n β Slot) (f : Assignment slots β Y) | |
| (eL : Y β Y') (heL : Function.Injective eL) : | |
| key side slots (eL β f) = key side slots f := | |
| key_postcomp_injective side slots f eL heL | |
| theorem key_coarse (side : Side) (slots : Fin n β Slot) (f : Assignment slots β Y) | |
| (p : Y β Z) (eL : Y β Y') (eR : Z β Z') (p' : Y' β Z') | |
| (heR : Function.Injective eR) (commutes : β y, p' (eL y) = eR (p y)) : | |
| key side slots (p' β (eL β f)) = key side slots (p β f) := | |
| (key_kernel_invariant side slots (p β f) (p' β (eL β f)) | |
| (coarseKernel slots f p eL eR p' heR commutes)).symm | |
| def transportFine (slots : Fin n β Slot) (f : Assignment slots β Y) | |
| (eL : Y β Y') (heL : Function.Injective eL) (P : Label slots f) : | |
| Label slots (eL β f) := | |
| transportKernel slots f (eL β f) (fineKernel slots f eL heL) P | |
| def transportCoarse (slots : Fin n β Slot) (f : Assignment slots β Y) | |
| (p : Y β Z) (eL : Y β Y') (eR : Z β Z') (p' : Y' β Z') | |
| (heR : Function.Injective eR) (commutes : β y, p' (eL y) = eR (p y)) | |
| (Q : Label slots (p β f)) : Label slots (p' β (eL β f)) := | |
| transportKernel slots (p β f) (p' β (eL β f)) | |
| (coarseKernel slots f p eL eR p' heR commutes) Q | |
| @[simp] theorem transportFine_val (slots : Fin n β Slot) (f : Assignment slots β Y) | |
| (eL : Y β Y') (heL : Function.Injective eL) (P : Label slots f) : | |
| (transportFine slots f eL heL P).val = P.val := rfl | |
| @[simp] theorem transportCoarse_val (slots : Fin n β Slot) (f : Assignment slots β Y) | |
| (p : Y β Z) (eL : Y β Y') (eR : Z β Z') (p' : Y' β Z') | |
| (heR : Function.Injective eR) (commutes : β y, p' (eL y) = eR (p y)) | |
| (Q : Label slots (p β f)) : | |
| (transportCoarse slots f p eL eR p' heR commutes Q).val = Q.val := rfl | |
| theorem transportFine_bijective (slots : Fin n β Slot) (f : Assignment slots β Y) | |
| (eL : Y β Y') (heL : Function.Injective eL) : | |
| Function.Bijective (transportFine slots f eL heL) := | |
| transportKernel_bijective slots f (eL β f) (fineKernel slots f eL heL) | |
| theorem restore_transportFine (slots : Fin n β Slot) (f : Assignment slots β Y) | |
| (eL : Y β Y') (heL : Function.Injective eL) (P : Label slots f) : | |
| restore slots (eL β f) (transportFine slots f eL heL P) = eL (restore slots f P) := | |
| restore_transportKernel slots f (eL β f) (fineKernel slots f eL heL) | |
| eL (fun _ => rfl) P | |
| theorem restore_transportCoarse (slots : Fin n β Slot) (f : Assignment slots β Y) | |
| (p : Y β Z) (eL : Y β Y') (eR : Z β Z') (p' : Y' β Z') | |
| (heR : Function.Injective eR) (commutes : β y, p' (eL y) = eR (p y)) | |
| (Q : Label slots (p β f)) : | |
| restore slots (p' β (eL β f)) (transportCoarse slots f p eL eR p' heR commutes Q) = | |
| eR (restore slots (p β f) Q) := | |
| restore_transportKernel slots (p β f) (p' β (eL β f)) | |
| (coarseKernel slots f p eL eR p' heR commutes) eR (fun x => commutes (f x)) Q | |
| theorem coarsen_transport (slots : Fin n β Slot) (f : Assignment slots β Y) | |
| (p : Y β Z) (eL : Y β Y') (eR : Z β Z') (p' : Y' β Z') | |
| (heL : Function.Injective eL) (heR : Function.Injective eR) | |
| (commutes : β y, p' (eL y) = eR (p y)) (P : Label slots f) : | |
| transportCoarse slots f p eL eR p' heR commutes (coarsen slots f p P) = | |
| coarsen slots (eL β f) p' (transportFine slots f eL heL P) := by | |
| apply restore_injective slots (p' β (eL β f)) | |
| calc | |
| restore slots (p' β (eL β f)) | |
| (transportCoarse slots f p eL eR p' heR commutes (coarsen slots f p P)) = | |
| eR (restore slots (p β f) (coarsen slots f p P)) := | |
| restore_transportCoarse slots f p eL eR p' heR commutes (coarsen slots f p P) | |
| _ = eR (p (restore slots f P)) := congrArg eR (restore_coarsen slots f p P) | |
| _ = p' (eL (restore slots f P)) := (commutes (restore slots f P)).symm | |
| _ = p' (restore slots (eL β f) (transportFine slots f eL heL P)) := | |
| congrArg p' (restore_transportFine slots f eL heL P).symm | |
| _ = restore slots (p' β (eL β f)) | |
| (coarsen slots (eL β f) p' (transportFine slots f eL heL P)) := | |
| (restore_coarsen slots (eL β f) p' (transportFine slots f eL heL P)).symm | |
| theorem coarsen_val (slots : Fin n β Slot) (f : Assignment slots β Y) | |
| (p : Y β Z) (eL : Y β Y') (eR : Z β Z') (p' : Y' β Z') | |
| (heL : Function.Injective eL) (heR : Function.Injective eR) | |
| (commutes : β y, p' (eL y) = eR (p y)) (P : Label slots f) : | |
| (coarsen slots f p P).val = | |
| (coarsen slots (eL β f) p' (transportFine slots f eL heL P)).val := | |
| congrArg Subtype.val (coarsen_transport slots f p eL eR p' heL heR commutes P) | |
| @[simp] theorem partIndex_transportFine (slots : Fin n β Slot) (f : Assignment slots β Y) | |
| (eL : Y β Y') (heL : Function.Injective eL) (P : Label slots f) : | |
| CanonicalKeyEncoding.partEnum n (transportFine slots f eL heL P).val = | |
| CanonicalKeyEncoding.partEnum n P.val := rfl | |
| theorem partIndex_coarsen (slots : Fin n β Slot) (f : Assignment slots β Y) | |
| (p : Y β Z) (eL : Y β Y') (eR : Z β Z') (p' : Y' β Z') | |
| (heL : Function.Injective eL) (heR : Function.Injective eR) | |
| (commutes : β y, p' (eL y) = eR (p y)) (P : Label slots f) : | |
| CanonicalKeyEncoding.partEnum n (coarsen slots f p P).val = | |
| CanonicalKeyEncoding.partEnum n | |
| (coarsen slots (eL β f) p' (transportFine slots f eL heL P)).val := | |
| congrArg (CanonicalKeyEncoding.partEnum n) | |
| (coarsen_val slots f p eL eR p' heL heR commutes P) | |
| theorem labelIndex_coarsen (side : Side) (slots : Fin n β Slot) | |
| (f : Assignment slots β Y) (p : Y β Z) (eL : Y β Y') (eR : Z β Z') (p' : Y' β Z') | |
| (heL : Function.Injective eL) (heR : Function.Injective eR) | |
| (commutes : β y, p' (eL y) = eR (p y)) (P : Label slots f) : | |
| CanonicalLabelEncoding.labelIndex (key side slots (p β f)) (coarsen slots f p P) = | |
| CanonicalLabelEncoding.labelIndex (key side slots (p' β (eL β f))) | |
| (coarsen slots (eL β f) p' (transportFine slots f eL heL P)) := | |
| partIndex_coarsen slots f p eL eR p' heL heR commutes P | |
| @[simp] theorem labelEmbedding_transportFine {q : Nat} (side : Side) | |
| (large : CanonicalKeyEncoding.partitionWidth n β€ q) | |
| (slots : Fin n β Slot) (f : Assignment slots β Y) | |
| (eL : Y β Y') (heL : Function.Injective eL) (P : Label slots f) : | |
| CanonicalLabelEncoding.labelEmbedding (key side slots (eL β f)) large | |
| (transportFine slots f eL heL P) = | |
| CanonicalLabelEncoding.labelEmbedding (key side slots f) large P := rfl | |
| theorem labelEmbedding_coarsen {q : Nat} (side : Side) | |
| (large : CanonicalKeyEncoding.partitionWidth n β€ q) | |
| (slots : Fin n β Slot) (f : Assignment slots β Y) | |
| (p : Y β Z) (eL : Y β Y') (eR : Z β Z') (p' : Y' β Z') | |
| (heL : Function.Injective eL) (heR : Function.Injective eR) | |
| (commutes : β y, p' (eL y) = eR (p y)) (P : Label slots f) : | |
| CanonicalLabelEncoding.labelEmbedding (key side slots (p β f)) large | |
| (coarsen slots f p P) = | |
| CanonicalLabelEncoding.labelEmbedding (key side slots (p' β (eL β f))) large | |
| (coarsen slots (eL β f) p' (transportFine slots f eL heL P)) := by | |
| apply Fin.ext | |
| change (CanonicalKeyEncoding.partEnum n (coarsen slots f p P).val).val = | |
| (CanonicalKeyEncoding.partEnum n | |
| (coarsen slots (eL β f) p' (transportFine slots f eL heL P)).val).val | |
| exact congrArg (fun i : Fin (CanonicalKeyEncoding.partitionWidth n) => i.val) | |
| (partIndex_coarsen slots f p eL eR p' heL heR commutes P) | |
| end | |
| end PerfectCompleteness.CanonicalCoarseningEncoding | |
| end | |
| end OAI | |