Skip to content

Commit 2d6229e

Browse files
Merge pull request #14 from Fieldnote-Echo/codex/finite-product-quotient
[codex] Add finite product quotient layer
2 parents 89cff6b + 0a3b131 commit 2d6229e

12 files changed

Lines changed: 804 additions & 155 deletions

OrdvecFormalization.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import OrdvecFormalization.QuotientConstraints
55
import OrdvecFormalization.FiniteQuotientImage
66
import OrdvecFormalization.QuotientKernel
77
import OrdvecFormalization.FiniteFiberTopology
8+
import OrdvecFormalization.FiniteProductQuotient
89
import OrdvecFormalization.FinitePairQuotient
910
import OrdvecFormalization.QuotientRefinementKernel
1011
import OrdvecFormalization.FiniteObservationWindow

OrdvecFormalization/FinitePairQuotient.lean

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Nelson Spence
55
-/
66

7-
import OrdvecFormalization.FiniteQuotientSearch
7+
import OrdvecFormalization.FiniteProductQuotient
88

99
namespace OrdvecFormalization
1010

@@ -17,9 +17,9 @@ same-compressed-pair invariance/falsifier theorems.
1717
-/
1818

1919
/-- Product quotient for query/document pairs. -/
20-
def pairQuotient {Ωq Ωd Zq Zd : Type}
20+
abbrev pairQuotient {Ωq Ωd Zq Zd : Type}
2121
(Cq : Ωq → Zq) (Cd : Ωd → Zd) : Ωq × Ωd → Zq × Zd :=
22-
fun pair => (Cq pair.1, Cd pair.2)
22+
productMap Cq Cd
2323

2424
@[simp]
2525
theorem pairQuotient_apply {Ωq Ωd Zq Zd : Type}
@@ -30,12 +30,8 @@ theorem pairQuotient_eq_iff {Ωq Ωd Zq Zd : Type}
3030
(Cq : Ωq → Zq) (Cd : Ωd → Zd)
3131
(pair₁ pair₂ : Ωq × Ωd) :
3232
pairQuotient Cq Cd pair₁ = pairQuotient Cq Cd pair₂ ↔
33-
Cq pair₁.1 = Cq pair₂.1 ∧ Cd pair₁.2 = Cd pair₂.2 := by
34-
constructor
35-
· intro h
36-
exact ⟨congrArg Prod.fst h, congrArg Prod.snd h⟩
37-
· rintro ⟨hq, hd⟩
38-
exact Prod.ext hq hd
33+
Cq pair₁.1 = Cq pair₂.1 ∧ Cd pair₁.2 = Cd pair₂.2 :=
34+
productMap_eq_iff Cq Cd pair₁ pair₂
3935

4036
/--
4137
A pairwise target that factors through the product quotient is invariant under
@@ -48,9 +44,9 @@ theorem pairRuleFactorsThrough_same_on_quotient_fibers {Ωq Ωd Zq Zd A : Type}
4844
(hq : Cq pair₁.1 = Cq pair₂.1)
4945
(hd : Cd pair₁.2 = Cd pair₂.2) :
5046
target pair₁ = target pair₂ := by
51-
rcases hfac withtargetq, htarget
52-
rw [htarget pair₁, htarget pair₂]
53-
exact congrArg targetq (Prod.ext hq hd)
47+
rcases pair₁ withq₁, d₁
48+
rcases pairwith ⟨q₂, d₂⟩
49+
exact ruleFactorsThrough_product_fiberInvariant Cq Cd target hfac hq hd
5450

5551
/--
5652
If two sampled query/document pairs have the same product quotient but

0 commit comments

Comments
 (0)