Skip to content

Commit

Permalink
minor liftabale changes
Browse files Browse the repository at this point in the history
  • Loading branch information
pzinn committed Oct 7, 2024
1 parent 28bee55 commit 309161a
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion M2/Macaulay2/m2/quotring.m2
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ char QuotientRing := (stashValue symbol char) ((S) -> (
g := generators gb relns;
if g == 0 then return char ring g;
m := g_(0,0);
if liftable(m,ZZ) then lift(m,ZZ) else 0))
lift(m,ZZ,Verify=>false) ?? 0))

singularLocus = method()
singularLocus(Ring) := QuotientRing => (R) -> (
Expand Down
1 change: 0 additions & 1 deletion M2/Macaulay2/m2/rationals.m2
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ assert (hash ZZ < hash QQ)
lift(QQ,ZZ) := opts -> (r,o) -> if denominator r === 1 then numerator r else if opts.Verify then error "rational number is not an integer"
liftable(QQ,ZZ) := (r,o) -> denominator r === 1
lift(QQ,QQ) := opts -> (r,QQ) -> r
liftable(QQ,QQ) := (QQ,QQ) -> true

QQ.degreeLength = 0
isUnit Number := x -> x != 0
Expand Down
3 changes: 2 additions & 1 deletion M2/Macaulay2/m2/rings.m2
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,13 @@ toExternalString Ring := toString @@ describe
-- promote, lift, liftable, and isConstant
-----------------------------------------------------------------------------

-- TODO rename isLiftable; currently impossible due to conflict with Varieties::isLiftable
-- some remnants from lift and promote, version 2
liftable = method(TypicalValue => Boolean, Dispatch => {Thing, Type, Type})
liftable(Number, Number) :=
liftable(Number, RingElement) :=
liftable(RingElement, Number) :=
liftable(RingElement, RingElement) := (f, R) -> null =!= lift(f, R, Verify => false)
liftable(RingElement, RingElement) := (f, R) -> lookup(lift,class f,R) =!= null and null =!= lift(f, R, Verify => false)

isConstant = method(TypicalValue => Boolean)
isConstant RingElement := r -> liftable(r, coefficientRing ring r)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

undocumented {(liftable, Number, Number), (liftable, Number, RingElement),
(liftable, RingElement, Number), (liftable, RingElement, RingElement),
(liftable, QQ, QQ), (liftable, QQ, ZZ),
(liftable, QQ, ZZ),
(lift, Matrix, InexactNumber),
(lift,Matrix,InexactNumber'),(lift, Number, InexactNumber),
(liftable, Number, InexactNumber),
Expand Down

0 comments on commit 309161a

Please sign in to comment.