Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ⟪x, y⟫_ℝ instead of Matrix.dotProduct #233

Merged
merged 2 commits into from
Oct 22, 2024

Conversation

eric-wieser
Copy link
Contributor

@eric-wieser eric-wieser commented Oct 21, 2024

Strictly dotProduct is for plain functions, not for elements of EuclideanSpace.

The original phrasing was still mathematically correct, as shown by EuclideanSpace.inner_eq_star_dotProduct (and star x = x on the real numbers); but it is using "evil" casting between EuclideanSpace and Function.

@@ -13,6 +14,6 @@ theorem putnam_1998_a6
(hint : ∀ i : Fin 2, ∃ a b c : ℤ, A i = a ∧ B i = b ∧ C i = c)
(htriangle : A ≠ B ∧ A ≠ C ∧ B ≠ C)
(harea : (dist A B + dist B C) ^ 2 < 8 * (MeasureTheory.volume (convexHull ℝ {A, B, C})).toReal + 1)
(threesquare : (EuclideanSpace ℝ (Fin 2))(EuclideanSpace ℝ (Fin 2))(EuclideanSpace ℝ (Fin 2)) → Prop := fun P Q R ↦ dist Q P = dist Q R ∧ Matrix.dotProduct (P - Q) (R - Q) = 0)
(threesquare : EuclideanSpace ℝ (Fin 2) → EuclideanSpace ℝ (Fin 2) → EuclideanSpace ℝ (Fin 2) → Prop := fun P Q R ↦ dist Q P = dist Q R ∧ P - Q, R - Q⟫_ℝ = 0)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you clarify why using Matrix.dotProduct is error free? Also, looks like this is also an optParam, must have missed it earlier. Could you modify that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch, this is indeed an optParam!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#236 finds two other stray optParams

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you clarify why using Matrix.dotProduct is error free?

I've expanded the PR description.

@GeorgeTsoukalas GeorgeTsoukalas merged commit 380dfe6 into trishullab:main Oct 22, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants