Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

let linear_combination solve goals #12685

Open
hrmacbeth opened this issue Mar 14, 2022 · 0 comments
Open

let linear_combination solve goals #12685

hrmacbeth opened this issue Mar 14, 2022 · 0 comments
Labels
feature-request This issue is a feature request, either for mathematics, tactics, or CI modifies-tactic-syntax This PR adds a new interactive tactic or modifies the syntax of an existing tactic. t-meta Tactics, attributes or user commands

Comments

@hrmacbeth
Copy link
Member

Goals a ≠ b turn up quite often when working over general fields, notably goals a ≠ 0 to allow for the use of field_simp with a denominator a.

Often this can be solved by contrapose! followed by linear_combination. It would be nice to fold the contrapose! into a preprocessing step of linear_combination.

Example:

example {x y z : K} (h₁ : (x - y) ^ 20) (h₂ : y = z) : -x ^ 2 + 2 * x * z ≠ y ^ 2 :=
begin
  contrapose! h₁,
  linear_combination (h₁, -1) (h₂, - 2 * x),
end

(current mathlib) should become

example {x y z : K} (h₁ : (x - y) ^ 20) (h₂ : y = z) : -x ^ 2 + 2 * x * z ≠ y ^ 2 :=
by linear_combination (h₁, -1) (h₂, - 2 * x)

https://leanprover.zulipchat.com/#narrow/stream/116395-maths/topic/.60linear_combination.60.20for.20.20.E2.89.A0.20goals

@hrmacbeth hrmacbeth added t-meta Tactics, attributes or user commands feature-request This issue is a feature request, either for mathematics, tactics, or CI modifies-tactic-syntax This PR adds a new interactive tactic or modifies the syntax of an existing tactic. labels Mar 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request This issue is a feature request, either for mathematics, tactics, or CI modifies-tactic-syntax This PR adds a new interactive tactic or modifies the syntax of an existing tactic. t-meta Tactics, attributes or user commands
Projects
None yet
Development

No branches or pull requests

1 participant