Skip to content

Commit 0a718a1

Browse files
Address product image review findings
1 parent ee72877 commit 0a718a1

6 files changed

Lines changed: 43 additions & 78 deletions

File tree

OrdvecFormalization/FiniteProductQuotient.lean

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -323,14 +323,7 @@ theorem card_productImageQuotientRules
323323
(Q₁ : Ω₁ → Z₁) (Q₂ : Ω₂ → Z₂) :
324324
Fintype.card (QuotientImageBucket (productMap Q₁ Q₂) → A) =
325325
Fintype.card A ^ (QuotientImageFinset (productMap Q₁ Q₂)).card := by
326-
classical
327-
letI : Fintype (QuotientImageBucket (productMap Q₁ Q₂)) :=
328-
Fintype.ofFinset (QuotientImageFinset (productMap Q₁ Q₂)) (by
329-
intro z
330-
constructor <;> intro hz <;> exact hz)
331-
rw [Fintype.card_fun]
332-
congr
333-
simp [QuotientImageBucket]
326+
exact card_quotientImageRules (productMap Q₁ Q₂)
334327

335328
/--
336329
Rules on the reachable product image have search-space size
@@ -422,7 +415,7 @@ def comparisonObsEquivProd (Ω₁ Ω₂ : Type) :
422415
cases x
423416
rfl
424417

425-
noncomputable instance comparisonObsFintype {Ω₁ Ω₂ : Type}
418+
instance comparisonObsFintype {Ω₁ Ω₂ : Type}
426419
[Fintype Ω₁] [Fintype Ω₂] : Fintype (ComparisonObs Ω₁ Ω₂) :=
427420
Fintype.ofEquiv (Ω₁ × Ω₂ × Ω₂) (comparisonObsEquivProd Ω₁ Ω₂).symm
428421

@@ -621,14 +614,7 @@ theorem card_comparisonImageQuotientRules
621614
(Q₁ : Ω₁ → Z₁) (Q₂ : Ω₂ → Z₂) :
622615
Fintype.card (QuotientImageBucket (comparisonMap Q₁ Q₂) → A) =
623616
Fintype.card A ^ (QuotientImageFinset (comparisonMap Q₁ Q₂)).card := by
624-
classical
625-
letI : Fintype (QuotientImageBucket (comparisonMap Q₁ Q₂)) :=
626-
Fintype.ofFinset (QuotientImageFinset (comparisonMap Q₁ Q₂)) (by
627-
intro z
628-
constructor <;> intro hz <;> exact hz)
629-
rw [Fintype.card_fun]
630-
congr
631-
simp [QuotientImageBucket]
617+
exact card_quotientImageRules (comparisonMap Q₁ Q₂)
632618

633619
/--
634620
Rules on the reachable comparison image have search-space size

OrdvecFormalization/FiniteQuotientSearch.lean

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,23 @@ abbrev QuotientImageBucket {Ω Ωq : Type} [Fintype Ω] [DecidableEq Ωq]
174174
(Q : Ω → Ωq) : Type :=
175175
{z : Ωq // z ∈ QuotientImageFinset Q}
176176

177+
/--
178+
Rules on a finite reachable image have search-space size
179+
`|A| ^ |image Q|`.
180+
-/
181+
theorem card_quotientImageRules {Ω Ωq A : Type}
182+
[Fintype Ω] [DecidableEq Ωq] [Fintype A] (Q : Ω → Ωq) :
183+
Fintype.card (QuotientImageBucket Q → A) =
184+
Fintype.card A ^ (QuotientImageFinset Q).card := by
185+
classical
186+
letI : Fintype (QuotientImageBucket Q) :=
187+
Fintype.ofFinset (QuotientImageFinset Q) (by
188+
intro z
189+
constructor <;> intro hz <;> exact hz)
190+
rw [Fintype.card_fun]
191+
congr
192+
simp [QuotientImageBucket]
193+
177194
/-- Reachable quotient buckets that have not appeared in a finite sample. -/
178195
abbrev UnobservedReachableQuotients {Ω Ωq : Type}
179196
[Fintype Ω] [DecidableEq Ωq]

OrdvecFormalization/Verify.lean

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ namespace OrdvecFormalization
119119
#check @sampleConsistent_iff_exists_quotientRuleFitsSample
120120
#check @QuotientImageFinset
121121
#check @QuotientImageBucket
122+
#check @card_quotientImageRules
122123
#check @UnobservedReachableQuotients
123124
#check @restrictRuleToImage
124125
#check @imageRuleToFullTarget
@@ -453,6 +454,7 @@ namespace OrdvecFormalization
453454
#print axioms extendWithUnobserved_fits_sample
454455
#print axioms card_fullTargets
455456
#print axioms card_quotientRules
457+
#print axioms card_quotientImageRules
456458
#print axioms quotientCompatible_search_space_bound
457459
#print axioms card_unobserved_assignments
458460
#print axioms card_unobserved_bool_assignments

docs/paper/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ Rebuild from this directory with:
1313

1414
```sh
1515
latexmk -pdf -interaction=nonstopmode -halt-on-error ordvec_formalization_paper.tex
16-
pdftotext ordvec_formalization_paper.pdf ordvec_formalization_paper.txt
16+
pdftotext -nopgbrk ordvec_formalization_paper.pdf ordvec_formalization_paper.txt
17+
perl -0pi -e 's/^\d+\n//mg' ordvec_formalization_paper.txt
1718
```
1819

1920
LaTeX intermediate files are ignored locally.

0 commit comments

Comments
 (0)