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

polyrith fails if expression is an equality of numerals #17141

Open
eric-wieser opened this issue Oct 24, 2022 · 0 comments
Open

polyrith fails if expression is an equality of numerals #17141

eric-wieser opened this issue Oct 24, 2022 · 0 comments
Labels
bug t-meta Tactics, attributes or user commands

Comments

@eric-wieser
Copy link
Member

eric-wieser commented Oct 24, 2022

This doesn't work, because the translation to python forgets to promote 2 and 0 to sage polynomial objects

import tactic.polyrith
import algebra.char_p.basic

example {R} [comm_ring R] [char_p R 2] (x : R) : x + x = 0 :=
begin
  have : (2 : R) = 0,
  { convert char_p.cast_eq_zero R 2, norm_cast },
  polyrith,
end
polyrith failed to retrieve a solution from Sage! TypeError: object of type 'Ideal_pid' has no len()
state:
R : Type ?,
_inst_1 : comm_ring R,
_inst_2 : char_p R 2,
x : R,
this : 2 = 0
⊢ x + x = 0

Adding a silly *x term resolves the issue

import tactic.polyrith
import algebra.char_p.basic

example {R} [comm_ring R] [char_p R 2] (x : R) : x + x = 0 :=
begin
  have : (2 : R) = 0*x,
  { simp, convert char_p.cast_eq_zero R 2, norm_cast },
  polyrith,
end
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug t-meta Tactics, attributes or user commands
Projects
None yet
1 participant