rewrite > (sym_times q (a1*p)).
rewrite > (assoc_times a1).
elim H1.
- (*
- rewrite > H6.
- applyS (witness n (n*(q*a-a1*n2)) (q*a-a1*n2))
- reflexivity. *);
applyS (witness n ? ? (refl_eq ? ?)) (* timeout=50 *).
(*
rewrite < (sym_times n).rewrite < assoc_times.
rewrite > (sym_times q (a1*p)).
rewrite > (assoc_times a1).
elim H1.rewrite > H6.
+ applyS (witness n ? ? (refl_eq ? ?)) (* timeout=50 *).
+ (*
rewrite < sym_times.rewrite > assoc_times.
rewrite < (assoc_times q).
rewrite < (sym_times n).
rewrite < distr_times_minus.
apply (witness ? ? (n1*a1-q*a)).reflexivity
+ *)
](* end second case *)
|rewrite < (prime_to_gcd_SO n p)
[apply eq_minus_gcd|assumption|assumption
rewrite > distr_times_minus.
rewrite > (sym_times p (a1*m)).
rewrite > (assoc_times a1).
- elim H2.
+ elim H2.rewrite > H7.
applyS (witness n ? ? (refl_eq ? ?)) (* timeout=50 *).
|(* second case *)
rewrite > (times_n_SO p).rewrite < H6.
rewrite > distr_times_minus.
rewrite > (sym_times p (a1*m)).
rewrite > (assoc_times a1).
- elim H2.
+ elim H2.rewrite > H7.
applyS (witness n ? ? (refl_eq ? ?)).
](* end second case *)
|rewrite < H1.apply eq_minus_gcd.