Lemma carryandone : carry p ( isaprimetoneq0 is ) 1 = 1. Proof. intros. unfold carry. rewrite precarryandone. assert ( forall n : nat, (fun n : nat => hzremaindermod p (isaprimetoneq0 is) ( @ringunel2 ( fpscommring hz ) n)) n = @ringunel2 ( fpscommring hz ) n ) as f. { intros n. destruct n. - change ( @ringunel2 ( fpscommring hz ) 0%nat ) with 1%hz. rewrite hzqrand1r. apply idpath. - change ( @ringunel2 ( fpscommring hz ) ( S n ) ) with 0%hz. rewrite hzqrand0r. apply idpath. } apply ( funextfun _ _ f ). Defined.
Require Import UniMath.PAdics.lemmas. Require Import UniMath.PAdics.fps. Require Import UniMath.PAdics.frac. Require Import UniMath.PAdics.z_mod_p. Require Import UniMath.NumberSystems.Integers.