@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
44Authors: Nelson Spence
55-/
66
7- import OrdvecFormalization.FiniteQuotientSearch
7+ import OrdvecFormalization.FiniteProductQuotient
88
99namespace 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]
2525theorem 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/--
4137A 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 with ⟨targetq, htarget ⟩
52- rw [htarget pair₁, htarget pair₂]
53- exact congrArg targetq (Prod.ext hq hd)
47+ rcases pair₁ with ⟨q₁, d₁ ⟩
48+ rcases pair₂ with ⟨q₂, d₂⟩
49+ exact ruleFactorsThrough_product_fiberInvariant Cq Cd target hfac hq hd
5450
5551/--
5652If two sampled query/document pairs have the same product quotient but
0 commit comments