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

Adapt to math-comp/math-comp#1125 #1271

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions theories/derive.v
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ apply/ler_gtP => _ /posnumP[e]; rewrite ler_pdivrMr //.
have /oid /nbhs_ballP [_ /posnumP[d] dfe] := !! gt0 e.
set k := ((d%:num / 2) / (PosNum xn0)%:num)^-1.
rewrite -{1}(@scalerKV _ _ k _ x) /k // linearZZ normrZ.
rewrite -ler_pdivlMl; last by rewrite gtr0_norm.
rewrite -ler_pdivlMl; last by rewrite gtr0_norm invr_gt0.
Copy link
Member Author

Choose a reason for hiding this comment

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

Well, the actual source of the issue I have is that the goal after rewrite gtr0_norm is now:

0 < idfun (d%:num / 2 / (PosNum xn0)%:num)^-1

where idfun is actually a homomorphism application:

GRing.RMorphism.sort (reverse_coercion (GRing.ssrfun_idfun__canonical__GRing_RMorphism ...) idfun)

simpl unfolds (PosNum xn0)%:num and thus is too aggressive here. Declaring a signed instance for homomorphisms would require the structures of order-preserving additive functions and ring homomorphisms, which we don't have in Mathcomp yet.

Copy link
Member Author

Choose a reason for hiding this comment

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

I also expected the canonical structure inference to unfold this homomorphism application automatically, but is it because of the presence of a default instance that it does not happen?

rewrite mulrCA (@le_trans _ _ (e%:num * `|k^-1 *: x|)) //; last first.
by rewrite ler_pM // normrZ normfV.
apply: dfe; rewrite -ball_normE /= sub0r normrN normrZ.
Expand Down Expand Up @@ -773,9 +773,9 @@ rewrite -[`|u|]/((PosNum un0)%:num) -[`|v|]/((PosNum vn0)%:num).
set ku := 2 / e%:num * (PosNum un0)%:num.
set kv := 2 / e%:num * (PosNum vn0)%:num.
rewrite -[X in f X](@scalerKV _ _ ku) /ku // linearZl_LR normrZ.
rewrite gtr0_norm // -ler_pdivlMl //.
rewrite gtr0_norm ?mulr_gt0 //= -ler_pdivlMl ?mulr_gt0 //=.
rewrite -[X in f _ X](@scalerKV _ _ kv) /kv // linearZr_LR normrZ.
rewrite gtr0_norm // -ler_pdivlMl //.
rewrite gtr0_norm ?mulr_gt0 // -ler_pdivlMl ?mulr_gt0 //=.
suff /he : ball 0 e%:num (ku^-1 *: u, kv^-1 *: v).
rewrite -ball_normE /= distrC subr0 => /ltW /le_trans; apply.
rewrite ler_pdivlMl 1?pmulr_lgt0// mulr1 ler_pdivlMl 1?pmulr_lgt0//.
Expand Down
Loading