Theorem: Groth16TypeIII.is_sound (FormalSnarksProject/SNARKs/Groth16TypeIII/Soundness.lean)

State before:
case intro
F : Type
inst✝ : Field F
n_stmt n_wit n_var : ℕ
u_stmt : Fin n_stmt → Polynomial F
u_wit : Fin n_wit → Polynomial F
v_stmt : Fin n_stmt → Polynomial F
v_wit : Fin n_wit → Polynomial F
w_stmt : Fin n_stmt → Polynomial F
w_wit : Fin n_wit → Polynomial F
r : Fin n_wit → F
stmt : Groth16TypeIII.Stmt
prover : Prover F Groth16TypeIII
t : Polynomial F := ∏ i : Fin n_wit, (Polynomial.X - Polynomial.C (r i))
eqn :
  [[C 1 *
                    ([C (prover.1 Proof_G1_Idx.A SRS_Elements_G1_Idx.α) *
                                      (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.α))] ++
                                  [C (prover.1 Proof_G1_Idx.A SRS_Elements_G1_Idx.β) *
                                      (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.β))] ++
                                [C (prover.1 Proof_G1_Idx.A SRS_Elements_G1_Idx.δ) *
                                    (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.δ))] ++
                              List.map
                                (fun x =>
                                  C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.x_pow x)) *
                                    (X (some Vars.γ) * X (some Vars.δ) * X none ^ ↑x))
                                (List.finRange n_var) ++
                            List.map
                              (fun x =>
                                C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.x_pow_times_t x)) *
                                  (X (some Vars.γ) * X none ^ ↑x *
                                    (to_MvPolynomial_Option Vars)
                                      (∏ i : Fin n_wit, (Polynomial.X - Polynomial.C (r i)))))
                              (List.finRange (n_var - 1)) ++
                          List.map
                            (fun x =>
                              C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.y x)) *
                                    (X (some Vars.β) * X (some Vars.δ) * (to_MvPolynomial_Option Vars) (u_stmt x)) +
                                  C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.y x)) *
                                    (X (some Vars.α) * X (some Vars.δ) * (to_MvPolynomial_Option Vars) (v_stmt x)) +
                                C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.y x)) *
                                  (X (some Vars.δ) * (to_MvPolynomial_Option Vars) (w_stmt x)))
                            (List.finRange n_stmt) ++
                        List.map
                          (fun x =>
                            C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.q x)) *
                                  (X (some Vars.β) * X (some Vars.γ) * (to_MvPolynomial_Option Vars) (u_wit x)) +
                                C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.q x)) *
                                  (X (some Vars.α) * X (some Vars.γ) * (to_MvPolynomial_Option Vars) (v_wit x)) +
                              C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.q x)) *
                                (X (some Vars.γ) * (to_MvPolynomial_Option Vars) (w_wit x)))
                          (List.finRange n_wit)).sum,
                  C 0 *
                    ([C (prover.1 Proof_G1_Idx.C SRS_Elements_G1_Idx.α) *
                                      (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.α))] ++
                                  [C (prover.1 Proof_G1_Idx.C SRS_Elements_G1_Idx.β) *
                                      (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.β))] ++
                                [C (prover.1 Proof_G1_Idx.C SRS_Elements_G1_Idx.δ) *
                                    (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.δ))] ++
                              List.map
                                (fun x =>
                                  C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.x_pow x)) *
                                    (X (some Vars.γ) * X (some Vars.δ) * X none ^ ↑x))
                                (List.finRange n_var) ++
                            List.map
                              (fun x =>
                                C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.x_pow_times_t x)) *
                                  (X (some Vars.γ) * X none ^ ↑x *
                                    (to_MvPolynomial_Option Vars)
                                      (∏ i : Fin n_wit, (Polynomial.X - Polynomial.C (r i)))))
                              (List.finRange (n_var - 1)) ++
                          List.map
                            (fun x =>
                              C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.y x)) *
                                    (X (some Vars.β) * X (some Vars.δ) * (to_MvPolynomial_Option Vars) (u_stmt x)) +
                                  C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.y x)) *
                                    (X (some Vars.α) * X (some Vars.δ) * (to_MvPolynomial_Option Vars) (v_stmt x)) +
                                C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.y x)) *
                                  (X (some Vars.δ) * (to_MvPolynomial_Option Vars) (w_stmt x)))
                            (List.finRange n_stmt) ++
                        List.map
                          (fun x =>
                            C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q x)) *
                                  (X (some Vars.β) * X (some Vars.γ) * (to_MvPolynomial_Option Vars) (u_wit x)) +
                                C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q x)) *
                                  (X (some Vars.α) * X (some Vars.γ) * (to_MvPolynomial_Option Vars) (v_wit x)) +
                              C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q x)) *
                                (X (some Vars.γ) * (to_MvPolynomial_Option Vars) (w_wit x)))
                          (List.finRange n_wit)).sum].sum *
              [C (-1) *
                    ([C (prover.2 Proof_G2_Idx.B SRS_Elements_G2_Idx.β) *
                                (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.β))] ++
                            [C (prover.2 Proof_G2_Idx.B SRS_Elements_G2_Idx.γ) *
                                (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.γ))] ++
                          [C (prover.2 Proof_G2_Idx.B SRS_Elements_G2_Idx.δ) *
                              (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.δ))] ++
                        List.map
                          (fun x =>
                            C (prover.2 Proof_G2_Idx.B (SRS_Elements_G2_Idx.x_pow x)) *
                              (X (some Vars.γ) * X (some Vars.δ) * X none ^ ↑x))
                          (List.finRange n_var)).sum].sum +
            ([C 0 * (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.α))] ++
                            [C 0 * (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.β))] ++
                          [C 0 * (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.δ))] ++
                        List.map (fun x => C 0 * (X (some Vars.γ) * X (some Vars.δ) * X none ^ ↑x))
                          (List.finRange n_var) ++
                      List.map
                        (fun x =>
                          C 0 *
                            (X (some Vars.γ) * X none ^ ↑x *
                              (to_MvPolynomial_Option Vars) (∏ i : Fin n_wit, (Polynomial.X - Polynomial.C (r i)))))
                        (List.finRange (n_var - 1)) ++
                    List.map
                      (fun x =>
                        C 0 * (X (some Vars.β) * X (some Vars.δ) * (to_MvPolynomial_Option Vars) (u_stmt x)) +
                            C 0 * (X (some Vars.α) * X (some Vars.δ) * (to_MvPolynomial_Option Vars) (v_stmt x)) +
                          C 0 * (X (some Vars.δ) * (to_MvPolynomial_Option Vars) (w_stmt x)))
                      (List.finRange n_stmt) ++
                  List.map
                    (fun x =>
                      C 0 * (X (some Vars.β) * X (some Vars.γ) * (to_MvPolynomial_Option Vars) (u_wit x)) +
                          C 0 * (X (some Vars.α) * X (some Vars.γ) * (to_MvPolynomial_Option Vars) (v_wit x)) +
                        C 0 * (X (some Vars.γ) * (to_MvPolynomial_Option Vars) (w_wit x)))
                    (List.finRange n_wit)).sum *
              [C (-1) *
                    ([C (prover.2 Proof_G2_Idx.B SRS_Elements_G2_Idx.β) *
                                (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.β))] ++
                            [C (prover.2 Proof_G2_Idx.B SRS_Elements_G2_Idx.γ) *
                                (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.γ))] ++
                          [C (prover.2 Proof_G2_Idx.B SRS_Elements_G2_Idx.δ) *
                              (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.δ))] ++
                        List.map
                          (fun x =>
                            C (prover.2 Proof_G2_Idx.B (SRS_Elements_G2_Idx.x_pow x)) *
                              (X (some Vars.γ) * X (some Vars.δ) * X none ^ ↑x))
                          (List.finRange n_var)).sum].sum +
          ([C 1 *
                    ([C (prover.1 Proof_G1_Idx.A SRS_Elements_G1_Idx.α) *
                                      (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.α))] ++
                                  [C (prover.1 Proof_G1_Idx.A SRS_Elements_G1_Idx.β) *
                                      (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.β))] ++
                                [C (prover.1 Proof_G1_Idx.A SRS_Elements_G1_Idx.δ) *
                                    (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.δ))] ++
                              List.map
                                (fun x =>
                                  C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.x_pow x)) *
                                    (X (some Vars.γ) * X (some Vars.δ) * X none ^ ↑x))
                                (List.finRange n_var) ++
                            List.map
                              (fun x =>
                                C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.x_pow_times_t x)) *
                                  (X (some Vars.γ) * X none ^ ↑x *
                                    (to_MvPolynomial_Option Vars)
                                      (∏ i : Fin n_wit, (Polynomial.X - Polynomial.C (r i)))))
                              (List.finRange (n_var - 1)) ++
                          List.map
                            (fun x =>
                              C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.y x)) *
                                    (X (some Vars.β) * X (some Vars.δ) * (to_MvPolynomial_Option Vars) (u_stmt x)) +
                                  C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.y x)) *
                                    (X (some Vars.α) * X (some Vars.δ) * (to_MvPolynomial_Option Vars) (v_stmt x)) +
                                C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.y x)) *
                                  (X (some Vars.δ) * (to_MvPolynomial_Option Vars) (w_stmt x)))
                            (List.finRange n_stmt) ++
                        List.map
                          (fun x =>
                            C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.q x)) *
                                  (X (some Vars.β) * X (some Vars.γ) * (to_MvPolynomial_Option Vars) (u_wit x)) +
                                C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.q x)) *
                                  (X (some Vars.α) * X (some Vars.γ) * (to_MvPolynomial_Option Vars) (v_wit x)) +
                              C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.q x)) *
                                (X (some Vars.γ) * (to_MvPolynomial_Option Vars) (w_wit x)))
                          (List.finRange n_wit)).sum,
                  C 0 *
                    ([C (prover.1 Proof_G1_Idx.C SRS_Elements_G1_Idx.α) *
                                      (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.α))] ++
                                  [C (prover.1 Proof_G1_Idx.C SRS_Elements_G1_Idx.β) *
                                      (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.β))] ++
                                [C (prover.1 Proof_G1_Idx.C SRS_Elements_G1_Idx.δ) *
                                    (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.δ))] ++
                              List.map
                                (fun x =>
                                  C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.x_pow x)) *
                                    (X (some Vars.γ) * X (some Vars.δ) * X none ^ ↑x))
                                (List.finRange n_var) ++
                            List.map
                              (fun x =>
                                C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.x_pow_times_t x)) *
                                  (X (some Vars.γ) * X none ^ ↑x *
                                    (to_MvPolynomial_Option Vars)
                                      (∏ i : Fin n_wit, (Polynomial.X - Polynomial.C (r i)))))
                              (List.finRange (n_var - 1)) ++
                          List.map
                            (fun x =>
                              C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.y x)) *
                                    (X (some Vars.β) * X (some Vars.δ) * (to_MvPolynomial_Option Vars) (u_stmt x)) +
                                  C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.y x)) *
                                    (X (some Vars.α) * X (some Vars.δ) * (to_MvPolynomial_Option Vars) (v_stmt x)) +
                                C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.y x)) *
                                  (X (some Vars.δ) * (to_MvPolynomial_Option Vars) (w_stmt x)))
                            (List.finRange n_stmt) ++
                        List.map
                          (fun x =>
                            C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q x)) *
                                  (X (some Vars.β) * X (some Vars.γ) * (to_MvPolynomial_Option Vars) (u_wit x)) +
                                C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q x)) *
                                  (X (some Vars.α) * X (some Vars.γ) * (to_MvPolynomial_Option Vars) (v_wit x)) +
                              C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q x)) *
                                (X (some Vars.γ) * (to_MvPolynomial_Option Vars) (w_wit x)))
                          (List.finRange n_wit)).sum].sum *
              ([C 0 * (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.β))] ++
                      [C 0 * (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.γ))] ++
                    [C 0 * (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.δ))] ++
                  List.map (fun x => C 0 * (X (some Vars.γ) * X (some Vars.δ) * X none ^ ↑x))
                    (List.finRange n_var)).sum +
            ([C 0 * (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.α))] ++
                            [C 0 * (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.β))] ++
                          [C 0 * (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.δ))] ++
                        List.map (fun x => C 0 * (X (some Vars.γ) * X (some Vars.δ) * X none ^ ↑x))
                          (List.finRange n_var) ++
                      List.map
                        (fun x =>
                          C 0 *
                            (X (some Vars.γ) * X none ^ ↑x *
                              (to_MvPolynomial_Option Vars) (∏ i : Fin n_wit, (Polynomial.X - Polynomial.C (r i)))))
                        (List.finRange (n_var - 1)) ++
                    List.map
                      (fun x =>
                        C 0 * (X (some Vars.β) * X (some Vars.δ) * (to_MvPolynomial_Option Vars) (u_stmt x)) +
                            C 0 * (X (some Vars.α) * X (some Vars.δ) * (to_MvPolynomial_Option Vars) (v_stmt x)) +
                          C 0 * (X (some Vars.δ) * (to_MvPolynomial_Option Vars) (w_stmt x)))
                      (List.finRange n_stmt) ++
                  List.map
                    (fun x =>
                      C 0 * (X (some Vars.β) * X (some Vars.γ) * (to_MvPolynomial_Option Vars) (u_wit x)) +
                          C 0 * (X (some Vars.α) * X (some Vars.γ) * (to_MvPolynomial_Option Vars) (v_wit x)) +
                        C 0 * (X (some Vars.γ) * (to_MvPolynomial_Option Vars) (w_wit x)))
                    (List.finRange n_wit)).sum *
              ([C 0 * (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.β))] ++
                      [C 0 * (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.γ))] ++
                    [C 0 * (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.δ))] ++
                  List.map (fun x => C 0 * (X (some Vars.γ) * X (some Vars.δ) * X none ^ ↑x))
                    (List.finRange n_var)).sum),
        [C 0 *
                    ([C (prover.1 Proof_G1_Idx.A SRS_Elements_G1_Idx.α) *
                                      (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.α))] ++
                                  [C (prover.1 Proof_G1_Idx.A SRS_Elements_G1_Idx.β) *
                                      (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.β))] ++
                                [C (prover.1 Proof_G1_Idx.A SRS_Elements_G1_Idx.δ) *
                                    (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.δ))] ++
                              List.map
                                (fun x =>
                                  C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.x_pow x)) *
                                    (X (some Vars.γ) * X (some Vars.δ) * X none ^ ↑x))
                                (List.finRange n_var) ++
                            List.map
                              (fun x =>
                                C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.x_pow_times_t x)) *
                                  (X (some Vars.γ) * X none ^ ↑x *
                                    (to_MvPolynomial_Option Vars)
                                      (∏ i : Fin n_wit, (Polynomial.X - Polynomial.C (r i)))))
                              (List.finRange (n_var - 1)) ++
                          List.map
                            (fun x =>
                              C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.y x)) *
                                    (X (some Vars.β) * X (some Vars.δ) * (to_MvPolynomial_Option Vars) (u_stmt x)) +
                                  C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.y x)) *
                                    (X (some Vars.α) * X (some Vars.δ) * (to_MvPolynomial_Option Vars) (v_stmt x)) +
                                C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.y x)) *
                                  (X (some Vars.δ) * (to_MvPolynomial_Option Vars) (w_stmt x)))
                            (List.finRange n_stmt) ++
                        List.map
                          (fun x =>
                            C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.q x)) *
                                  (X (some Vars.β) * X (some Vars.γ) * (to_MvPolynomial_Option Vars) (u_wit x)) +
                                C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.q x)) *
                                  (X (some Vars.α) * X (some Vars.γ) * (to_MvPolynomial_Option Vars) (v_wit x)) +
                              C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.q x)) *
                                (X (some Vars.γ) * (to_MvPolynomial_Option Vars) (w_wit x)))
                          (List.finRange n_wit)).sum,
                  C 0 *
                    ([C (prover.1 Proof_G1_Idx.C SRS_Elements_G1_Idx.α) *
                                      (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.α))] ++
                                  [C (prover.1 Proof_G1_Idx.C SRS_Elements_G1_Idx.β) *
                                      (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.β))] ++
                                [C (prover.1 Proof_G1_Idx.C SRS_Elements_G1_Idx.δ) *
                                    (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.δ))] ++
                              List.map
                                (fun x =>
                                  C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.x_pow x)) *
                                    (X (some Vars.γ) * X (some Vars.δ) * X none ^ ↑x))
                                (List.finRange n_var) ++
                            List.map
                              (fun x =>
                                C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.x_pow_times_t x)) *
                                  (X (some Vars.γ) * X none ^ ↑x *
                                    (to_MvPolynomial_Option Vars)
                                      (∏ i : Fin n_wit, (Polynomial.X - Polynomial.C (r i)))))
                              (List.finRange (n_var - 1)) ++
                          List.map
                            (fun x =>
                              C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.y x)) *
                                    (X (some Vars.β) * X (some Vars.δ) * (to_MvPolynomial_Option Vars) (u_stmt x)) +
                                  C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.y x)) *
                                    (X (some Vars.α) * X (some Vars.δ) * (to_MvPolynomial_Option Vars) (v_stmt x)) +
                                C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.y x)) *
                                  (X (some Vars.δ) * (to_MvPolynomial_Option Vars) (w_stmt x)))
                            (List.finRange n_stmt) ++
                        List.map
                          (fun x =>
                            C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q x)) *
                                  (X (some Vars.β) * X (some Vars.γ) * (to_MvPolynomial_Option Vars) (u_wit x)) +
                                C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q x)) *
                                  (X (some Vars.α) * X (some Vars.γ) * (to_MvPolynomial_Option Vars) (v_wit x)) +
                              C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q x)) *
                                (X (some Vars.γ) * (to_MvPolynomial_Option Vars) (w_wit x)))
                          (List.finRange n_wit)).sum].sum *
              [C 0 *
                    ([C (prover.2 Proof_G2_Idx.B SRS_Elements_G2_Idx.β) *
                                (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.β))] ++
                            [C (prover.2 Proof_G2_Idx.B SRS_Elements_G2_Idx.γ) *
                                (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.γ))] ++
                          [C (prover.2 Proof_G2_Idx.B SRS_Elements_G2_Idx.δ) *
                              (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.δ))] ++
                        List.map
                          (fun x =>
                            C (prover.2 Proof_G2_Idx.B (SRS_Elements_G2_Idx.x_pow x)) *
                              (X (some Vars.γ) * X (some Vars.δ) * X none ^ ↑x))
                          (List.finRange n_var)).sum].sum +
            ([C 1 * (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.α))] ++
                            [C 0 * (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.β))] ++
                          [C 0 * (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.δ))] ++
                        List.map (fun x => C 0 * (X (some Vars.γ) * X (some Vars.δ) * X none ^ ↑x))
                          (List.finRange n_var) ++
                      List.map
                        (fun x =>
                          C 0 *
                            (X (some Vars.γ) * X none ^ ↑x *
                              (to_MvPolynomial_Option Vars) (∏ i : Fin n_wit, (Polynomial.X - Polynomial.C (r i)))))
                        (List.finRange (n_var - 1)) ++
                    List.map
                      (fun x =>
                        C 0 * (X (some Vars.β) * X (some Vars.δ) * (to_MvPolynomial_Option Vars) (u_stmt x)) +
                            C 0 * (X (some Vars.α) * X (some Vars.δ) * (to_MvPolynomial_Option Vars) (v_stmt x)) +
                          C 0 * (X (some Vars.δ) * (to_MvPolynomial_Option Vars) (w_stmt x)))
                      (List.finRange n_stmt) ++
                  List.map
                    (fun x =>
                      C 0 * (X (some Vars.β) * X (some Vars.γ) * (to_MvPolynomial_Option Vars) (u_wit x)) +
                          C 0 * (X (some Vars.α) * X (some Vars.γ) * (to_MvPolynomial_Option Vars) (v_wit x)) +
                        C 0 * (X (some Vars.γ) * (to_MvPolynomial_Option Vars) (w_wit x)))
                    (List.finRange n_wit)).sum *
              [C 0 *
                    ([C (prover.2 Proof_G2_Idx.B SRS_Elements_G2_Idx.β) *
                                (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.β))] ++
                            [C (prover.2 Proof_G2_Idx.B SRS_Elements_G2_Idx.γ) *
                                (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.γ))] ++
                          [C (prover.2 Proof_G2_Idx.B SRS_Elements_G2_Idx.δ) *
                              (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.δ))] ++
                        List.map
                          (fun x =>
                            C (prover.2 Proof_G2_Idx.B (SRS_Elements_G2_Idx.x_pow x)) *
                              (X (some Vars.γ) * X (some Vars.δ) * X none ^ ↑x))
                          (List.finRange n_var)).sum].sum +
          ([C 0 *
                    ([C (prover.1 Proof_G1_Idx.A SRS_Elements_G1_Idx.α) *
                                      (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.α))] ++
                                  [C (prover.1 Proof_G1_Idx.A SRS_Elements_G1_Idx.β) *
                                      (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.β))] ++
                                [C (prover.1 Proof_G1_Idx.A SRS_Elements_G1_Idx.δ) *
                                    (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.δ))] ++
                              List.map
                                (fun x =>
                                  C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.x_pow x)) *
                                    (X (some Vars.γ) * X (some Vars.δ) * X none ^ ↑x))
                                (List.finRange n_var) ++
                            List.map
                              (fun x =>
                                C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.x_pow_times_t x)) *
                                  (X (some Vars.γ) * X none ^ ↑x *
                                    (to_MvPolynomial_Option Vars)
                                      (∏ i : Fin n_wit, (Polynomial.X - Polynomial.C (r i)))))
                              (List.finRange (n_var - 1)) ++
                          List.map
                            (fun x =>
                              C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.y x)) *
                                    (X (some Vars.β) * X (some Vars.δ) * (to_MvPolynomial_Option Vars) (u_stmt x)) +
                                  C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.y x)) *
                                    (X (some Vars.α) * X (some Vars.δ) * (to_MvPolynomial_Option Vars) (v_stmt x)) +
                                C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.y x)) *
                                  (X (some Vars.δ) * (to_MvPolynomial_Option Vars) (w_stmt x)))
                            (List.finRange n_stmt) ++
                        List.map
                          (fun x =>
                            C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.q x)) *
                                  (X (some Vars.β) * X (some Vars.γ) * (to_MvPolynomial_Option Vars) (u_wit x)) +
                                C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.q x)) *
                                  (X (some Vars.α) * X (some Vars.γ) * (to_MvPolynomial_Option Vars) (v_wit x)) +
                              C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.q x)) *
                                (X (some Vars.γ) * (to_MvPolynomial_Option Vars) (w_wit x)))
                          (List.finRange n_wit)).sum,
                  C 0 *
                    ([C (prover.1 Proof_G1_Idx.C SRS_Elements_G1_Idx.α) *
                                      (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.α))] ++
                                  [C (prover.1 Proof_G1_Idx.C SRS_Elements_G1_Idx.β) *
                                      (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.β))] ++
                                [C (prover.1 Proof_G1_Idx.C SRS_Elements_G1_Idx.δ) *
                                    (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.δ))] ++
                              List.map
                                (fun x =>
                                  C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.x_pow x)) *
                                    (X (some Vars.γ) * X (some Vars.δ) * X none ^ ↑x))
                                (List.finRange n_var) ++
                            List.map
                              (fun x =>
                                C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.x_pow_times_t x)) *
                                  (X (some Vars.γ) * X none ^ ↑x *
                                    (to_MvPolynomial_Option Vars)
                                      (∏ i : Fin n_wit, (Polynomial.X - Polynomial.C (r i)))))
                              (List.finRange (n_var - 1)) ++
                          List.map
                            (fun x =>
                              C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.y x)) *
                                    (X (some Vars.β) * X (some Vars.δ) * (to_MvPolynomial_Option Vars) (u_stmt x)) +
                                  C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.y x)) *
                                    (X (some Vars.α) * X (some Vars.δ) * (to_MvPolynomial_Option Vars) (v_stmt x)) +
                                C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.y x)) *
                                  (X (some Vars.δ) * (to_MvPolynomial_Option Vars) (w_stmt x)))
                            (List.finRange n_stmt) ++
                        List.map
                          (fun x =>
                            C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q x)) *
                                  (X (some Vars.β) * X (some Vars.γ) * (to_MvPolynomial_Option Vars) (u_wit x)) +
                                C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q x)) *
                                  (X (some Vars.α) * X (some Vars.γ) * (to_MvPolynomial_Option Vars) (v_wit x)) +
                              C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q x)) *
                                (X (some Vars.γ) * (to_MvPolynomial_Option Vars) (w_wit x)))
                          (List.finRange n_wit)).sum].sum *
              ([C 1 * (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.β))] ++
                      [C 0 * (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.γ))] ++
                    [C 0 * (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.δ))] ++
                  List.map (fun x => C 0 * (X (some Vars.γ) * X (some Vars.δ) * X none ^ ↑x))
                    (List.finRange n_var)).sum +
            ([C 1 * (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.α))] ++
                            [C 0 * (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.β))] ++
                          [C 0 * (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.δ))] ++
                        List.map (fun x => C 0 * (X (some Vars.γ) * X (some Vars.δ) * X none ^ ↑x))
                          (List.finRange n_var) ++
                      List.map
                        (fun x =>
                          C 0 *
                            (X (some Vars.γ) * X none ^ ↑x *
                              (to_MvPolynomial_Option Vars) (∏ i : Fin n_wit, (Polynomial.X - Polynomial.C (r i)))))
                        (List.finRange (n_var - 1)) ++
                    List.map
                      (fun x =>
                        C 0 * (X (some Vars.β) * X (some Vars.δ) * (to_MvPolynomial_Option Vars) (u_stmt x)) +
                            C 0 * (X (some Vars.α) * X (some Vars.δ) * (to_MvPolynomial_Option Vars) (v_stmt x)) +
                          C 0 * (X (some Vars.δ) * (to_MvPolynomial_Option Vars) (w_stmt x)))
                      (List.finRange n_stmt) ++
                  List.map
                    (fun x =>
                      C 0 * (X (some Vars.β) * X (some Vars.γ) * (to_MvPolynomial_Option Vars) (u_wit x)) +
                          C 0 * (X (some Vars.α) * X (some Vars.γ) * (to_MvPolynomial_Option Vars) (v_wit x)) +
                        C 0 * (X (some Vars.γ) * (to_MvPolynomial_Option Vars) (w_wit x)))
                    (List.finRange n_wit)).sum *
              ([C 1 * (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.β))] ++
                      [C 0 * (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.γ))] ++
                    [C 0 * (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.δ))] ++
                  List.map (fun x => C 0 * (X (some Vars.γ) * X (some Vars.δ) * X none ^ ↑x))
                    (List.finRange n_var)).sum),
        [C 0 *
                    ([C (prover.1 Proof_G1_Idx.A SRS_Elements_G1_Idx.α) *
                                      (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.α))] ++
                                  [C (prover.1 Proof_G1_Idx.A SRS_Elements_G1_Idx.β) *
                                      (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.β))] ++
                                [C (prover.1 Proof_G1_Idx.A SRS_Elements_G1_Idx.δ) *
                                    (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.δ))] ++
                              List.map
                                (fun x =>
                                  C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.x_pow x)) *
                                    (X (some Vars.γ) * X (some Vars.δ) * X none ^ ↑x))
                                (List.finRange n_var) ++
                            List.map
                              (fun x =>
                                C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.x_pow_times_t x)) *
                                  (X (some Vars.γ) * X none ^ ↑x *
                                    (to_MvPolynomial_Option Vars)
                                      (∏ i : Fin n_wit, (Polynomial.X - Polynomial.C (r i)))))
                              (List.finRange (n_var - 1)) ++
                          List.map
                            (fun x =>
                              C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.y x)) *
                                    (X (some Vars.β) * X (some Vars.δ) * (to_MvPolynomial_Option Vars) (u_stmt x)) +
                                  C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.y x)) *
                                    (X (some Vars.α) * X (some Vars.δ) * (to_MvPolynomial_Option Vars) (v_stmt x)) +
                                C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.y x)) *
                                  (X (some Vars.δ) * (to_MvPolynomial_Option Vars) (w_stmt x)))
                            (List.finRange n_stmt) ++
                        List.map
                          (fun x =>
                            C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.q x)) *
                                  (X (some Vars.β) * X (some Vars.γ) * (to_MvPolynomial_Option Vars) (u_wit x)) +
                                C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.q x)) *
                                  (X (some Vars.α) * X (some Vars.γ) * (to_MvPolynomial_Option Vars) (v_wit x)) +
                              C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.q x)) *
                                (X (some Vars.γ) * (to_MvPolynomial_Option Vars) (w_wit x)))
                          (List.finRange n_wit)).sum,
                  C 0 *
                    ([C (prover.1 Proof_G1_Idx.C SRS_Elements_G1_Idx.α) *
                                      (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.α))] ++
                                  [C (prover.1 Proof_G1_Idx.C SRS_Elements_G1_Idx.β) *
                                      (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.β))] ++
                                [C (prover.1 Proof_G1_Idx.C SRS_Elements_G1_Idx.δ) *
                                    (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.δ))] ++
                              List.map
                                (fun x =>
                                  C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.x_pow x)) *
                                    (X (some Vars.γ) * X (some Vars.δ) * X none ^ ↑x))
                                (List.finRange n_var) ++
                            List.map
                              (fun x =>
                                C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.x_pow_times_t x)) *
                                  (X (some Vars.γ) * X none ^ ↑x *
                                    (to_MvPolynomial_Option Vars)
                                      (∏ i : Fin n_wit, (Polynomial.X - Polynomial.C (r i)))))
                              (List.finRange (n_var - 1)) ++
                          List.map
                            (fun x =>
                              C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.y x)) *
                                    (X (some Vars.β) * X (some Vars.δ) * (to_MvPolynomial_Option Vars) (u_stmt x)) +
                                  C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.y x)) *
                                    (X (some Vars.α) * X (some Vars.δ) * (to_MvPolynomial_Option Vars) (v_stmt x)) +
                                C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.y x)) *
                                  (X (some Vars.δ) * (to_MvPolynomial_Option Vars) (w_stmt x)))
                            (List.finRange n_stmt) ++
                        List.map
                          (fun x =>
                            C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q x)) *
                                  (X (some Vars.β) * X (some Vars.γ) * (to_MvPolynomial_Option Vars) (u_wit x)) +
                                C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q x)) *
                                  (X (some Vars.α) * X (some Vars.γ) * (to_MvPolynomial_Option Vars) (v_wit x)) +
                              C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q x)) *
                                (X (some Vars.γ) * (to_MvPolynomial_Option Vars) (w_wit x)))
                          (List.finRange n_wit)).sum].sum *
              [C 0 *
                    ([C (prover.2 Proof_G2_Idx.B SRS_Elements_G2_Idx.β) *
                                (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.β))] ++
                            [C (prover.2 Proof_G2_Idx.B SRS_Elements_G2_Idx.γ) *
                                (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.γ))] ++
                          [C (prover.2 Proof_G2_Idx.B SRS_Elements_G2_Idx.δ) *
                              (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.δ))] ++
                        List.map
                          (fun x =>
                            C (prover.2 Proof_G2_Idx.B (SRS_Elements_G2_Idx.x_pow x)) *
                              (X (some Vars.γ) * X (some Vars.δ) * X none ^ ↑x))
                          (List.finRange n_var)).sum].sum +
            ([C 0 * (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.α))] ++
                            [C 0 * (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.β))] ++
                          [C 0 * (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.δ))] ++
                        List.map (fun x => C 0 * (X (some Vars.γ) * X (some Vars.δ) * X none ^ ↑x))
                          (List.finRange n_var) ++
                      List.map
                        (fun x =>
                          C 0 *
                            (X (some Vars.γ) * X none ^ ↑x *
                              (to_MvPolynomial_Option Vars) (∏ i : Fin n_wit, (Polynomial.X - Polynomial.C (r i)))))
                        (List.finRange (n_var - 1)) ++
                    List.map
                      (fun x =>
                        C (stmt x) * (X (some Vars.β) * X (some Vars.δ) * (to_MvPolynomial_Option Vars) (u_stmt x)) +
                            C (stmt x) *
                              (X (some Vars.α) * X (some Vars.δ) * (to_MvPolynomial_Option Vars) (v_stmt x)) +
                          C (stmt x) * (X (some Vars.δ) * (to_MvPolynomial_Option Vars) (w_stmt x)))
                      (List.finRange n_stmt) ++
                  List.map
                    (fun x =>
                      C 0 * (X (some Vars.β) * X (some Vars.γ) * (to_MvPolynomial_Option Vars) (u_wit x)) +
                          C 0 * (X (some Vars.α) * X (some Vars.γ) * (to_MvPolynomial_Option Vars) (v_wit x)) +
                        C 0 * (X (some Vars.γ) * (to_MvPolynomial_Option Vars) (w_wit x)))
                    (List.finRange n_wit)).sum *
              [C 0 *
                    ([C (prover.2 Proof_G2_Idx.B SRS_Elements_G2_Idx.β) *
                                (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.β))] ++
                            [C (prover.2 Proof_G2_Idx.B SRS_Elements_G2_Idx.γ) *
                                (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.γ))] ++
                          [C (prover.2 Proof_G2_Idx.B SRS_Elements_G2_Idx.δ) *
                              (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.δ))] ++
                        List.map
                          (fun x =>
                            C (prover.2 Proof_G2_Idx.B (SRS_Elements_G2_Idx.x_pow x)) *
                              (X (some Vars.γ) * X (some Vars.δ) * X none ^ ↑x))
                          (List.finRange n_var)).sum].sum +
          ([C 0 *
                    ([C (prover.1 Proof_G1_Idx.A SRS_Elements_G1_Idx.α) *
                                      (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.α))] ++
                                  [C (prover.1 Proof_G1_Idx.A SRS_Elements_G1_Idx.β) *
                                      (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.β))] ++
                                [C (prover.1 Proof_G1_Idx.A SRS_Elements_G1_Idx.δ) *
                                    (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.δ))] ++
                              List.map
                                (fun x =>
                                  C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.x_pow x)) *
                                    (X (some Vars.γ) * X (some Vars.δ) * X none ^ ↑x))
                                (List.finRange n_var) ++
                            List.map
                              (fun x =>
                                C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.x_pow_times_t x)) *
                                  (X (some Vars.γ) * X none ^ ↑x *
                                    (to_MvPolynomial_Option Vars)
                                      (∏ i : Fin n_wit, (Polynomial.X - Polynomial.C (r i)))))
                              (List.finRange (n_var - 1)) ++
                          List.map
                            (fun x =>
                              C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.y x)) *
                                    (X (some Vars.β) * X (some Vars.δ) * (to_MvPolynomial_Option Vars) (u_stmt x)) +
                                  C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.y x)) *
                                    (X (some Vars.α) * X (some Vars.δ) * (to_MvPolynomial_Option Vars) (v_stmt x)) +
                                C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.y x)) *
                                  (X (some Vars.δ) * (to_MvPolynomial_Option Vars) (w_stmt x)))
                            (List.finRange n_stmt) ++
                        List.map
                          (fun x =>
                            C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.q x)) *
                                  (X (some Vars.β) * X (some Vars.γ) * (to_MvPolynomial_Option Vars) (u_wit x)) +
                                C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.q x)) *
                                  (X (some Vars.α) * X (some Vars.γ) * (to_MvPolynomial_Option Vars) (v_wit x)) +
                              C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.q x)) *
                                (X (some Vars.γ) * (to_MvPolynomial_Option Vars) (w_wit x)))
                          (List.finRange n_wit)).sum,
                  C 0 *
                    ([C (prover.1 Proof_G1_Idx.C SRS_Elements_G1_Idx.α) *
                                      (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.α))] ++
                                  [C (prover.1 Proof_G1_Idx.C SRS_Elements_G1_Idx.β) *
                                      (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.β))] ++
                                [C (prover.1 Proof_G1_Idx.C SRS_Elements_G1_Idx.δ) *
                                    (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.δ))] ++
                              List.map
                                (fun x =>
                                  C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.x_pow x)) *
                                    (X (some Vars.γ) * X (some Vars.δ) * X none ^ ↑x))
                                (List.finRange n_var) ++
                            List.map
                              (fun x =>
                                C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.x_pow_times_t x)) *
                                  (X (some Vars.γ) * X none ^ ↑x *
                                    (to_MvPolynomial_Option Vars)
                                      (∏ i : Fin n_wit, (Polynomial.X - Polynomial.C (r i)))))
                              (List.finRange (n_var - 1)) ++
                          List.map
                            (fun x =>
                              C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.y x)) *
                                    (X (some Vars.β) * X (some Vars.δ) * (to_MvPolynomial_Option Vars) (u_stmt x)) +
                                  C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.y x)) *
                                    (X (some Vars.α) * X (some Vars.δ) * (to_MvPolynomial_Option Vars) (v_stmt x)) +
                                C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.y x)) *
                                  (X (some Vars.δ) * (to_MvPolynomial_Option Vars) (w_stmt x)))
                            (List.finRange n_stmt) ++
                        List.map
                          (fun x =>
                            C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q x)) *
                                  (X (some Vars.β) * X (some Vars.γ) * (to_MvPolynomial_Option Vars) (u_wit x)) +
                                C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q x)) *
                                  (X (some Vars.α) * X (some Vars.γ) * (to_MvPolynomial_Option Vars) (v_wit x)) +
                              C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q x)) *
                                (X (some Vars.γ) * (to_MvPolynomial_Option Vars) (w_wit x)))
                          (List.finRange n_wit)).sum].sum *
              ([C 0 * (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.β))] ++
                      [C 1 * (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.γ))] ++
                    [C 0 * (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.δ))] ++
                  List.map (fun x => C 0 * (X (some Vars.γ) * X (some Vars.δ) * X none ^ ↑x))
                    (List.finRange n_var)).sum +
            ([C 0 * (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.α))] ++
                            [C 0 * (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.β))] ++
                          [C 0 * (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.δ))] ++
                        List.map (fun x => C 0 * (X (some Vars.γ) * X (some Vars.δ) * X none ^ ↑x))
                          (List.finRange n_var) ++
                      List.map
                        (fun x =>
                          C 0 *
                            (X (some Vars.γ) * X none ^ ↑x *
                              (to_MvPolynomial_Option Vars) (∏ i : Fin n_wit, (Polynomial.X - Polynomial.C (r i)))))
                        (List.finRange (n_var - 1)) ++
                    List.map
                      (fun x =>
                        C (stmt x) * (X (some Vars.β) * X (some Vars.δ) * (to_MvPolynomial_Option Vars) (u_stmt x)) +
                            C (stmt x) *
                              (X (some Vars.α) * X (some Vars.δ) * (to_MvPolynomial_Option Vars) (v_stmt x)) +
                          C (stmt x) * (X (some Vars.δ) * (to_MvPolynomial_Option Vars) (w_stmt x)))
                      (List.finRange n_stmt) ++
                  List.map
                    (fun x =>
                      C 0 * (X (some Vars.β) * X (some Vars.γ) * (to_MvPolynomial_Option Vars) (u_wit x)) +
                          C 0 * (X (some Vars.α) * X (some Vars.γ) * (to_MvPolynomial_Option Vars) (v_wit x)) +
                        C 0 * (X (some Vars.γ) * (to_MvPolynomial_Option Vars) (w_wit x)))
                    (List.finRange n_wit)).sum *
              ([C 0 * (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.β))] ++
                      [C 1 * (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.γ))] ++
                    [C 0 * (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.δ))] ++
                  List.map (fun x => C 0 * (X (some Vars.γ) * X (some Vars.δ) * X none ^ ↑x))
                    (List.finRange n_var)).sum),
        [C 0 *
                    ([C (prover.1 Proof_G1_Idx.A SRS_Elements_G1_Idx.α) *
                                      (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.α))] ++
                                  [C (prover.1 Proof_G1_Idx.A SRS_Elements_G1_Idx.β) *
                                      (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.β))] ++
                                [C (prover.1 Proof_G1_Idx.A SRS_Elements_G1_Idx.δ) *
                                    (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.δ))] ++
                              List.map
                                (fun x =>
                                  C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.x_pow x)) *
                                    (X (some Vars.γ) * X (some Vars.δ) * X none ^ ↑x))
                                (List.finRange n_var) ++
                            List.map
                              (fun x =>
                                C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.x_pow_times_t x)) *
                                  (X (some Vars.γ) * X none ^ ↑x *
                                    (to_MvPolynomial_Option Vars)
                                      (∏ i : Fin n_wit, (Polynomial.X - Polynomial.C (r i)))))
                              (List.finRange (n_var - 1)) ++
                          List.map
                            (fun x =>
                              C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.y x)) *
                                    (X (some Vars.β) * X (some Vars.δ) * (to_MvPolynomial_Option Vars) (u_stmt x)) +
                                  C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.y x)) *
                                    (X (some Vars.α) * X (some Vars.δ) * (to_MvPolynomial_Option Vars) (v_stmt x)) +
                                C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.y x)) *
                                  (X (some Vars.δ) * (to_MvPolynomial_Option Vars) (w_stmt x)))
                            (List.finRange n_stmt) ++
                        List.map
                          (fun x =>
                            C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.q x)) *
                                  (X (some Vars.β) * X (some Vars.γ) * (to_MvPolynomial_Option Vars) (u_wit x)) +
                                C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.q x)) *
                                  (X (some Vars.α) * X (some Vars.γ) * (to_MvPolynomial_Option Vars) (v_wit x)) +
                              C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.q x)) *
                                (X (some Vars.γ) * (to_MvPolynomial_Option Vars) (w_wit x)))
                          (List.finRange n_wit)).sum,
                  C 1 *
                    ([C (prover.1 Proof_G1_Idx.C SRS_Elements_G1_Idx.α) *
                                      (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.α))] ++
                                  [C (prover.1 Proof_G1_Idx.C SRS_Elements_G1_Idx.β) *
                                      (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.β))] ++
                                [C (prover.1 Proof_G1_Idx.C SRS_Elements_G1_Idx.δ) *
                                    (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.δ))] ++
                              List.map
                                (fun x =>
                                  C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.x_pow x)) *
                                    (X (some Vars.γ) * X (some Vars.δ) * X none ^ ↑x))
                                (List.finRange n_var) ++
                            List.map
                              (fun x =>
                                C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.x_pow_times_t x)) *
                                  (X (some Vars.γ) * X none ^ ↑x *
                                    (to_MvPolynomial_Option Vars)
                                      (∏ i : Fin n_wit, (Polynomial.X - Polynomial.C (r i)))))
                              (List.finRange (n_var - 1)) ++
                          List.map
                            (fun x =>
                              C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.y x)) *
                                    (X (some Vars.β) * X (some Vars.δ) * (to_MvPolynomial_Option Vars) (u_stmt x)) +
                                  C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.y x)) *
                                    (X (some Vars.α) * X (some Vars.δ) * (to_MvPolynomial_Option Vars) (v_stmt x)) +
                                C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.y x)) *
                                  (X (some Vars.δ) * (to_MvPolynomial_Option Vars) (w_stmt x)))
                            (List.finRange n_stmt) ++
                        List.map
                          (fun x =>
                            C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q x)) *
                                  (X (some Vars.β) * X (some Vars.γ) * (to_MvPolynomial_Option Vars) (u_wit x)) +
                                C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q x)) *
                                  (X (some Vars.α) * X (some Vars.γ) * (to_MvPolynomial_Option Vars) (v_wit x)) +
                              C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q x)) *
                                (X (some Vars.γ) * (to_MvPolynomial_Option Vars) (w_wit x)))
                          (List.finRange n_wit)).sum].sum *
              [C 0 *
                    ([C (prover.2 Proof_G2_Idx.B SRS_Elements_G2_Idx.β) *
                                (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.β))] ++
                            [C (prover.2 Proof_G2_Idx.B SRS_Elements_G2_Idx.γ) *
                                (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.γ))] ++
                          [C (prover.2 Proof_G2_Idx.B SRS_Elements_G2_Idx.δ) *
                              (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.δ))] ++
                        List.map
                          (fun x =>
                            C (prover.2 Proof_G2_Idx.B (SRS_Elements_G2_Idx.x_pow x)) *
                              (X (some Vars.γ) * X (some Vars.δ) * X none ^ ↑x))
                          (List.finRange n_var)).sum].sum +
            ([C 0 * (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.α))] ++
                            [C 0 * (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.β))] ++
                          [C 0 * (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.δ))] ++
                        List.map (fun x => C 0 * (X (some Vars.γ) * X (some Vars.δ) * X none ^ ↑x))
                          (List.finRange n_var) ++
                      List.map
                        (fun x =>
                          C 0 *
                            (X (some Vars.γ) * X none ^ ↑x *
                              (to_MvPolynomial_Option Vars) (∏ i : Fin n_wit, (Polynomial.X - Polynomial.C (r i)))))
                        (List.finRange (n_var - 1)) ++
                    List.map
                      (fun x =>
                        C 0 * (X (some Vars.β) * X (some Vars.δ) * (to_MvPolynomial_Option Vars) (u_stmt x)) +
                            C 0 * (X (some Vars.α) * X (some Vars.δ) * (to_MvPolynomial_Option Vars) (v_stmt x)) +
                          C 0 * (X (some Vars.δ) * (to_MvPolynomial_Option Vars) (w_stmt x)))
                      (List.finRange n_stmt) ++
                  List.map
                    (fun x =>
                      C 0 * (X (some Vars.β) * X (some Vars.γ) * (to_MvPolynomial_Option Vars) (u_wit x)) +
                          C 0 * (X (some Vars.α) * X (some Vars.γ) * (to_MvPolynomial_Option Vars) (v_wit x)) +
                        C 0 * (X (some Vars.γ) * (to_MvPolynomial_Option Vars) (w_wit x)))
                    (List.finRange n_wit)).sum *
              [C 0 *
                    ([C (prover.2 Proof_G2_Idx.B SRS_Elements_G2_Idx.β) *
                                (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.β))] ++
                            [C (prover.2 Proof_G2_Idx.B SRS_Elements_G2_Idx.γ) *
                                (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.γ))] ++
                          [C (prover.2 Proof_G2_Idx.B SRS_Elements_G2_Idx.δ) *
                              (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.δ))] ++
                        List.map
                          (fun x =>
                            C (prover.2 Proof_G2_Idx.B (SRS_Elements_G2_Idx.x_pow x)) *
                              (X (some Vars.γ) * X (some Vars.δ) * X none ^ ↑x))
                          (List.finRange n_var)).sum].sum +
          ([C 0 *
                    ([C (prover.1 Proof_G1_Idx.A SRS_Elements_G1_Idx.α) *
                                      (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.α))] ++
                                  [C (prover.1 Proof_G1_Idx.A SRS_Elements_G1_Idx.β) *
                                      (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.β))] ++
                                [C (prover.1 Proof_G1_Idx.A SRS_Elements_G1_Idx.δ) *
                                    (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.δ))] ++
                              List.map
                                (fun x =>
                                  C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.x_pow x)) *
                                    (X (some Vars.γ) * X (some Vars.δ) * X none ^ ↑x))
                                (List.finRange n_var) ++
                            List.map
                              (fun x =>
                                C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.x_pow_times_t x)) *
                                  (X (some Vars.γ) * X none ^ ↑x *
                                    (to_MvPolynomial_Option Vars)
                                      (∏ i : Fin n_wit, (Polynomial.X - Polynomial.C (r i)))))
                              (List.finRange (n_var - 1)) ++
                          List.map
                            (fun x =>
                              C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.y x)) *
                                    (X (some Vars.β) * X (some Vars.δ) * (to_MvPolynomial_Option Vars) (u_stmt x)) +
                                  C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.y x)) *
                                    (X (some Vars.α) * X (some Vars.δ) * (to_MvPolynomial_Option Vars) (v_stmt x)) +
                                C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.y x)) *
                                  (X (some Vars.δ) * (to_MvPolynomial_Option Vars) (w_stmt x)))
                            (List.finRange n_stmt) ++
                        List.map
                          (fun x =>
                            C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.q x)) *
                                  (X (some Vars.β) * X (some Vars.γ) * (to_MvPolynomial_Option Vars) (u_wit x)) +
                                C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.q x)) *
                                  (X (some Vars.α) * X (some Vars.γ) * (to_MvPolynomial_Option Vars) (v_wit x)) +
                              C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.q x)) *
                                (X (some Vars.γ) * (to_MvPolynomial_Option Vars) (w_wit x)))
                          (List.finRange n_wit)).sum,
                  C 1 *
                    ([C (prover.1 Proof_G1_Idx.C SRS_Elements_G1_Idx.α) *
                                      (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.α))] ++
                                  [C (prover.1 Proof_G1_Idx.C SRS_Elements_G1_Idx.β) *
                                      (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.β))] ++
                                [C (prover.1 Proof_G1_Idx.C SRS_Elements_G1_Idx.δ) *
                                    (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.δ))] ++
                              List.map
                                (fun x =>
                                  C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.x_pow x)) *
                                    (X (some Vars.γ) * X (some Vars.δ) * X none ^ ↑x))
                                (List.finRange n_var) ++
                            List.map
                              (fun x =>
                                C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.x_pow_times_t x)) *
                                  (X (some Vars.γ) * X none ^ ↑x *
                                    (to_MvPolynomial_Option Vars)
                                      (∏ i : Fin n_wit, (Polynomial.X - Polynomial.C (r i)))))
                              (List.finRange (n_var - 1)) ++
                          List.map
                            (fun x =>
                              C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.y x)) *
                                    (X (some Vars.β) * X (some Vars.δ) * (to_MvPolynomial_Option Vars) (u_stmt x)) +
                                  C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.y x)) *
                                    (X (some Vars.α) * X (some Vars.δ) * (to_MvPolynomial_Option Vars) (v_stmt x)) +
                                C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.y x)) *
                                  (X (some Vars.δ) * (to_MvPolynomial_Option Vars) (w_stmt x)))
                            (List.finRange n_stmt) ++
                        List.map
                          (fun x =>
                            C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q x)) *
                                  (X (some Vars.β) * X (some Vars.γ) * (to_MvPolynomial_Option Vars) (u_wit x)) +
                                C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q x)) *
                                  (X (some Vars.α) * X (some Vars.γ) * (to_MvPolynomial_Option Vars) (v_wit x)) +
                              C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q x)) *
                                (X (some Vars.γ) * (to_MvPolynomial_Option Vars) (w_wit x)))
                          (List.finRange n_wit)).sum].sum *
              ([C 0 * (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.β))] ++
                      [C 0 * (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.γ))] ++
                    [C 1 * (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.δ))] ++
                  List.map (fun x => C 0 * (X (some Vars.γ) * X (some Vars.δ) * X none ^ ↑x))
                    (List.finRange n_var)).sum +
            ([C 0 * (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.α))] ++
                            [C 0 * (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.β))] ++
                          [C 0 * (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.δ))] ++
                        List.map (fun x => C 0 * (X (some Vars.γ) * X (some Vars.δ) * X none ^ ↑x))
                          (List.finRange n_var) ++
                      List.map
                        (fun x =>
                          C 0 *
                            (X (some Vars.γ) * X none ^ ↑x *
                              (to_MvPolynomial_Option Vars) (∏ i : Fin n_wit, (Polynomial.X - Polynomial.C (r i)))))
                        (List.finRange (n_var - 1)) ++
                    List.map
                      (fun x =>
                        C 0 * (X (some Vars.β) * X (some Vars.δ) * (to_MvPolynomial_Option Vars) (u_stmt x)) +
                            C 0 * (X (some Vars.α) * X (some Vars.δ) * (to_MvPolynomial_Option Vars) (v_stmt x)) +
                          C 0 * (X (some Vars.δ) * (to_MvPolynomial_Option Vars) (w_stmt x)))
                      (List.finRange n_stmt) ++
                  List.map
                    (fun x =>
                      C 0 * (X (some Vars.β) * X (some Vars.γ) * (to_MvPolynomial_Option Vars) (u_wit x)) +
                          C 0 * (X (some Vars.α) * X (some Vars.γ) * (to_MvPolynomial_Option Vars) (v_wit x)) +
                        C 0 * (X (some Vars.γ) * (to_MvPolynomial_Option Vars) (w_wit x)))
                    (List.finRange n_wit)).sum *
              ([C 0 * (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.β))] ++
                      [C 0 * (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.γ))] ++
                    [C 1 * (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.δ))] ++
                  List.map (fun x => C 0 * (X (some Vars.γ) * X (some Vars.δ) * X none ^ ↑x))
                    (List.finRange n_var)).sum)].sum =
    0
⊢ ((List.map (fun i => Polynomial.C (stmt i) * u_stmt i) (List.finRange n_stmt)).sum +
        (List.map (fun i => Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q i)) * u_wit i)
            (List.finRange n_wit)).sum) *
      ((List.map (fun i => Polynomial.C (stmt i) * v_stmt i) (List.finRange n_stmt)).sum +
        (List.map (fun i => Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q i)) * v_wit i)
            (List.finRange n_wit)).sum) =
    (List.map (fun i => Polynomial.C (stmt i) * w_stmt i) (List.finRange n_stmt)).sum +
        (List.map (fun i => Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q i)) * w_wit i)
            (List.finRange n_wit)).sum +
      (List.map
          (fun x =>
            Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.x_pow_times_t x)) * (Polynomial.X ^ ↑x * t))
          (List.finRange (n_var - 1))).sum
Tactic:
simp only [map_one, List.singleton_append, List.cons_append, map_prod, map_sub, List.append_assoc,
  List.sum_cons, List.sum_append, List.sum_map_add, one_mul, map_zero, zero_mul, List.sum_nil,
  add_zero, map_neg, neg_mul, neg_add_rev, List.map_const', List.length_finRange,
  List.sum_replicate, smul_zero, mul_zero, zero_add] at eqn
State after:
case intro
F : Type
inst✝ : Field F
n_stmt n_wit n_var : ℕ
u_stmt : Fin n_stmt → Polynomial F
u_wit : Fin n_wit → Polynomial F
v_stmt : Fin n_stmt → Polynomial F
v_wit : Fin n_wit → Polynomial F
w_stmt : Fin n_stmt → Polynomial F
w_wit : Fin n_wit → Polynomial F
r : Fin n_wit → F
stmt : Groth16TypeIII.Stmt
prover : Prover F Groth16TypeIII
t : Polynomial F := ∏ i : Fin n_wit, (Polynomial.X - Polynomial.C (r i))
eqn :
  (C (prover.1 Proof_G1_Idx.A SRS_Elements_G1_Idx.α) * (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.α)) +
          (C (prover.1 Proof_G1_Idx.A SRS_Elements_G1_Idx.β) * (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.β)) +
            (C (prover.1 Proof_G1_Idx.A SRS_Elements_G1_Idx.δ) * (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.δ)) +
              ((List.map
                    (fun x =>
                      C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.x_pow x)) *
                        (X (some Vars.γ) * X (some Vars.δ) * X none ^ ↑x))
                    (List.finRange n_var)).sum +
                ((List.map
                      (fun x =>
                        C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.x_pow_times_t x)) *
                          (X (some Vars.γ) * X none ^ ↑x *
                            ∏ x : Fin n_wit,
                              ((to_MvPolynomial_Option Vars) Polynomial.X -
                                (to_MvPolynomial_Option Vars) (Polynomial.C (r x)))))
                      (List.finRange (n_var - 1))).sum +
                  ((List.map
                            (fun i =>
                              C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.y i)) *
                                (X (some Vars.β) * X (some Vars.δ) * (to_MvPolynomial_Option Vars) (u_stmt i)))
                            (List.finRange n_stmt)).sum +
                        (List.map
                            (fun i =>
                              C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.y i)) *
                                (X (some Vars.α) * X (some Vars.δ) * (to_MvPolynomial_Option Vars) (v_stmt i)))
                            (List.finRange n_stmt)).sum +
                      (List.map
                          (fun i =>
                            C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.y i)) *
                              (X (some Vars.δ) * (to_MvPolynomial_Option Vars) (w_stmt i)))
                          (List.finRange n_stmt)).sum +
                    ((List.map
                            (fun i =>
                              C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.q i)) *
                                (X (some Vars.β) * X (some Vars.γ) * (to_MvPolynomial_Option Vars) (u_wit i)))
                            (List.finRange n_wit)).sum +
                        (List.map
                            (fun i =>
                              C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.q i)) *
                                (X (some Vars.α) * X (some Vars.γ) * (to_MvPolynomial_Option Vars) (v_wit i)))
                            (List.finRange n_wit)).sum +
                      (List.map
                          (fun i =>
                            C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.q i)) *
                              (X (some Vars.γ) * (to_MvPolynomial_Option Vars) (w_wit i)))
                          (List.finRange n_wit)).sum))))))) *
        (-(List.map
                    (fun x =>
                      C (prover.2 Proof_G2_Idx.B (SRS_Elements_G2_Idx.x_pow x)) *
                        (X (some Vars.γ) * X (some Vars.δ) * X none ^ ↑x))
                    (List.finRange n_var)).sum +
              -(C (prover.2 Proof_G2_Idx.B SRS_Elements_G2_Idx.δ) *
                  (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.δ))) +
            -(C (prover.2 Proof_G2_Idx.B SRS_Elements_G2_Idx.γ) *
                (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.γ))) +
          -(C (prover.2 Proof_G2_Idx.B SRS_Elements_G2_Idx.β) *
              (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.β)))) +
      (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.α) * (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.β)) +
        (((List.map
                    (fun i =>
                      C (stmt i) * (X (some Vars.β) * X (some Vars.δ) * (to_MvPolynomial_Option Vars) (u_stmt i)))
                    (List.finRange n_stmt)).sum +
                (List.map
                    (fun i =>
                      C (stmt i) * (X (some Vars.α) * X (some Vars.δ) * (to_MvPolynomial_Option Vars) (v_stmt i)))
                    (List.finRange n_stmt)).sum +
              (List.map (fun i => C (stmt i) * (X (some Vars.δ) * (to_MvPolynomial_Option Vars) (w_stmt i)))
                  (List.finRange n_stmt)).sum) *
            (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.γ)) +
          (C (prover.1 Proof_G1_Idx.C SRS_Elements_G1_Idx.α) * (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.α)) +
              (C (prover.1 Proof_G1_Idx.C SRS_Elements_G1_Idx.β) *
                  (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.β)) +
                (C (prover.1 Proof_G1_Idx.C SRS_Elements_G1_Idx.δ) *
                    (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.δ)) +
                  ((List.map
                        (fun x =>
                          C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.x_pow x)) *
                            (X (some Vars.γ) * X (some Vars.δ) * X none ^ ↑x))
                        (List.finRange n_var)).sum +
                    ((List.map
                          (fun x =>
                            C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.x_pow_times_t x)) *
                              (X (some Vars.γ) * X none ^ ↑x *
                                ∏ x : Fin n_wit,
                                  ((to_MvPolynomial_Option Vars) Polynomial.X -
                                    (to_MvPolynomial_Option Vars) (Polynomial.C (r x)))))
                          (List.finRange (n_var - 1))).sum +
                      ((List.map
                                (fun i =>
                                  C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.y i)) *
                                    (X (some Vars.β) * X (some Vars.δ) * (to_MvPolynomial_Option Vars) (u_stmt i)))
                                (List.finRange n_stmt)).sum +
                            (List.map
                                (fun i =>
                                  C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.y i)) *
                                    (X (some Vars.α) * X (some Vars.δ) * (to_MvPolynomial_Option Vars) (v_stmt i)))
                                (List.finRange n_stmt)).sum +
                          (List.map
                              (fun i =>
                                C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.y i)) *
                                  (X (some Vars.δ) * (to_MvPolynomial_Option Vars) (w_stmt i)))
                              (List.finRange n_stmt)).sum +
                        ((List.map
                                (fun i =>
                                  C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q i)) *
                                    (X (some Vars.β) * X (some Vars.γ) * (to_MvPolynomial_Option Vars) (u_wit i)))
                                (List.finRange n_wit)).sum +
                            (List.map
                                (fun i =>
                                  C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q i)) *
                                    (X (some Vars.α) * X (some Vars.γ) * (to_MvPolynomial_Option Vars) (v_wit i)))
                                (List.finRange n_wit)).sum +
                          (List.map
                              (fun i =>
                                C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q i)) *
                                  (X (some Vars.γ) * (to_MvPolynomial_Option Vars) (w_wit i)))
                              (List.finRange n_wit)).sum))))))) *
            (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.δ)))) =
    0
⊢ ((List.map (fun i => Polynomial.C (stmt i) * u_stmt i) (List.finRange n_stmt)).sum +
        (List.map (fun i => Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q i)) * u_wit i)
            (List.finRange n_wit)).sum) *
      ((List.map (fun i => Polynomial.C (stmt i) * v_stmt i) (List.finRange n_stmt)).sum +
        (List.map (fun i => Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q i)) * v_wit i)
            (List.finRange n_wit)).sum) =
    (List.map (fun i => Polynomial.C (stmt i) * w_stmt i) (List.finRange n_stmt)).sum +
        (List.map (fun i => Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q i)) * w_wit i)
            (List.finRange n_wit)).sum +
      (List.map
          (fun x =>
            Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.x_pow_times_t x)) * (Polynomial.X ^ ↑x * t))
          (List.finRange (n_var - 1))).sum

State before:
case intro
F : Type
inst✝ : Field F
n_stmt n_wit n_var : ℕ
u_stmt : Fin n_stmt → Polynomial F
u_wit : Fin n_wit → Polynomial F
v_stmt : Fin n_stmt → Polynomial F
v_wit : Fin n_wit → Polynomial F
w_stmt : Fin n_stmt → Polynomial F
w_wit : Fin n_wit → Polynomial F
r : Fin n_wit → F
stmt : Groth16TypeIII.Stmt
prover : Prover F Groth16TypeIII
t : Polynomial F := ∏ i : Fin n_wit, (Polynomial.X - Polynomial.C (r i))
eqn :
  (C (prover.1 Proof_G1_Idx.A SRS_Elements_G1_Idx.α) * (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.α)) +
          (C (prover.1 Proof_G1_Idx.A SRS_Elements_G1_Idx.β) * (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.β)) +
            (C (prover.1 Proof_G1_Idx.A SRS_Elements_G1_Idx.δ) * (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.δ)) +
              ((List.map
                    (fun x =>
                      C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.x_pow x)) *
                        (X (some Vars.γ) * X (some Vars.δ) * X none ^ ↑x))
                    (List.finRange n_var)).sum +
                ((List.map
                      (fun x =>
                        C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.x_pow_times_t x)) *
                          (X (some Vars.γ) * X none ^ ↑x *
                            ∏ x : Fin n_wit,
                              ((to_MvPolynomial_Option Vars) Polynomial.X -
                                (to_MvPolynomial_Option Vars) (Polynomial.C (r x)))))
                      (List.finRange (n_var - 1))).sum +
                  ((List.map
                            (fun i =>
                              C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.y i)) *
                                (X (some Vars.β) * X (some Vars.δ) * (to_MvPolynomial_Option Vars) (u_stmt i)))
                            (List.finRange n_stmt)).sum +
                        (List.map
                            (fun i =>
                              C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.y i)) *
                                (X (some Vars.α) * X (some Vars.δ) * (to_MvPolynomial_Option Vars) (v_stmt i)))
                            (List.finRange n_stmt)).sum +
                      (List.map
                          (fun i =>
                            C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.y i)) *
                              (X (some Vars.δ) * (to_MvPolynomial_Option Vars) (w_stmt i)))
                          (List.finRange n_stmt)).sum +
                    ((List.map
                            (fun i =>
                              C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.q i)) *
                                (X (some Vars.β) * X (some Vars.γ) * (to_MvPolynomial_Option Vars) (u_wit i)))
                            (List.finRange n_wit)).sum +
                        (List.map
                            (fun i =>
                              C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.q i)) *
                                (X (some Vars.α) * X (some Vars.γ) * (to_MvPolynomial_Option Vars) (v_wit i)))
                            (List.finRange n_wit)).sum +
                      (List.map
                          (fun i =>
                            C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.q i)) *
                              (X (some Vars.γ) * (to_MvPolynomial_Option Vars) (w_wit i)))
                          (List.finRange n_wit)).sum))))))) *
        (-(List.map
                    (fun x =>
                      C (prover.2 Proof_G2_Idx.B (SRS_Elements_G2_Idx.x_pow x)) *
                        (X (some Vars.γ) * X (some Vars.δ) * X none ^ ↑x))
                    (List.finRange n_var)).sum +
              -(C (prover.2 Proof_G2_Idx.B SRS_Elements_G2_Idx.δ) *
                  (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.δ))) +
            -(C (prover.2 Proof_G2_Idx.B SRS_Elements_G2_Idx.γ) *
                (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.γ))) +
          -(C (prover.2 Proof_G2_Idx.B SRS_Elements_G2_Idx.β) *
              (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.β)))) +
      (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.α) * (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.β)) +
        (((List.map
                    (fun i =>
                      C (stmt i) * (X (some Vars.β) * X (some Vars.δ) * (to_MvPolynomial_Option Vars) (u_stmt i)))
                    (List.finRange n_stmt)).sum +
                (List.map
                    (fun i =>
                      C (stmt i) * (X (some Vars.α) * X (some Vars.δ) * (to_MvPolynomial_Option Vars) (v_stmt i)))
                    (List.finRange n_stmt)).sum +
              (List.map (fun i => C (stmt i) * (X (some Vars.δ) * (to_MvPolynomial_Option Vars) (w_stmt i)))
                  (List.finRange n_stmt)).sum) *
            (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.γ)) +
          (C (prover.1 Proof_G1_Idx.C SRS_Elements_G1_Idx.α) * (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.α)) +
              (C (prover.1 Proof_G1_Idx.C SRS_Elements_G1_Idx.β) *
                  (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.β)) +
                (C (prover.1 Proof_G1_Idx.C SRS_Elements_G1_Idx.δ) *
                    (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.δ)) +
                  ((List.map
                        (fun x =>
                          C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.x_pow x)) *
                            (X (some Vars.γ) * X (some Vars.δ) * X none ^ ↑x))
                        (List.finRange n_var)).sum +
                    ((List.map
                          (fun x =>
                            C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.x_pow_times_t x)) *
                              (X (some Vars.γ) * X none ^ ↑x *
                                ∏ x : Fin n_wit,
                                  ((to_MvPolynomial_Option Vars) Polynomial.X -
                                    (to_MvPolynomial_Option Vars) (Polynomial.C (r x)))))
                          (List.finRange (n_var - 1))).sum +
                      ((List.map
                                (fun i =>
                                  C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.y i)) *
                                    (X (some Vars.β) * X (some Vars.δ) * (to_MvPolynomial_Option Vars) (u_stmt i)))
                                (List.finRange n_stmt)).sum +
                            (List.map
                                (fun i =>
                                  C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.y i)) *
                                    (X (some Vars.α) * X (some Vars.δ) * (to_MvPolynomial_Option Vars) (v_stmt i)))
                                (List.finRange n_stmt)).sum +
                          (List.map
                              (fun i =>
                                C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.y i)) *
                                  (X (some Vars.δ) * (to_MvPolynomial_Option Vars) (w_stmt i)))
                              (List.finRange n_stmt)).sum +
                        ((List.map
                                (fun i =>
                                  C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q i)) *
                                    (X (some Vars.β) * X (some Vars.γ) * (to_MvPolynomial_Option Vars) (u_wit i)))
                                (List.finRange n_wit)).sum +
                            (List.map
                                (fun i =>
                                  C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q i)) *
                                    (X (some Vars.α) * X (some Vars.γ) * (to_MvPolynomial_Option Vars) (v_wit i)))
                                (List.finRange n_wit)).sum +
                          (List.map
                              (fun i =>
                                C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q i)) *
                                  (X (some Vars.γ) * (to_MvPolynomial_Option Vars) (w_wit i)))
                              (List.finRange n_wit)).sum))))))) *
            (X (some Vars.γ) * X (some Vars.δ) * X (some Vars.δ)))) =
    0
⊢ ((List.map (fun i => Polynomial.C (stmt i) * u_stmt i) (List.finRange n_stmt)).sum +
        (List.map (fun i => Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q i)) * u_wit i)
            (List.finRange n_wit)).sum) *
      ((List.map (fun i => Polynomial.C (stmt i) * v_stmt i) (List.finRange n_stmt)).sum +
        (List.map (fun i => Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q i)) * v_wit i)
            (List.finRange n_wit)).sum) =
    (List.map (fun i => Polynomial.C (stmt i) * w_stmt i) (List.finRange n_stmt)).sum +
        (List.map (fun i => Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q i)) * w_wit i)
            (List.finRange n_wit)).sum +
      (List.map
          (fun x =>
            Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.x_pow_times_t x)) * (Polynomial.X ^ ↑x * t))
          (List.finRange (n_var - 1))).sum
Tactic:
simp only [
  mul_assoc,
  mul_left_comm (C _) (X (some _)) _, mul_left_comm (List.sum _) (X (some _)) _,
  mul_comm (C _) (X (some _)), mul_comm (List.sum _) (X (some _)),
  neg_mul, mul_neg,
  List.sum_map_mul_right, List.sum_map_mul_left] at eqn
State after:
case intro
F : Type
inst✝ : Field F
n_stmt n_wit n_var : ℕ
u_stmt : Fin n_stmt → Polynomial F
u_wit : Fin n_wit → Polynomial F
v_stmt : Fin n_stmt → Polynomial F
v_wit : Fin n_wit → Polynomial F
w_stmt : Fin n_stmt → Polynomial F
w_wit : Fin n_wit → Polynomial F
r : Fin n_wit → F
stmt : Groth16TypeIII.Stmt
prover : Prover F Groth16TypeIII
t : Polynomial F := ∏ i : Fin n_wit, (Polynomial.X - Polynomial.C (r i))
eqn :
  (X (some Vars.γ) * (X (some Vars.δ) * (X (some Vars.α) * C (prover.1 Proof_G1_Idx.A SRS_Elements_G1_Idx.α))) +
          (X (some Vars.γ) * (X (some Vars.δ) * (X (some Vars.β) * C (prover.1 Proof_G1_Idx.A SRS_Elements_G1_Idx.β))) +
            (X (some Vars.γ) *
                (X (some Vars.δ) * (X (some Vars.δ) * C (prover.1 Proof_G1_Idx.A SRS_Elements_G1_Idx.δ))) +
              (X (some Vars.γ) *
                  (X (some Vars.δ) *
                    (List.map (fun b => C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.x_pow b)) * X none ^ ↑b)
                        (List.finRange n_var)).sum) +
                (X (some Vars.γ) *
                    (List.map
                        (fun b =>
                          C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.x_pow_times_t b)) *
                            (X none ^ ↑b *
                              ∏ x : Fin n_wit,
                                ((to_MvPolynomial_Option Vars) Polynomial.X -
                                  (to_MvPolynomial_Option Vars) (Polynomial.C (r x)))))
                        (List.finRange (n_var - 1))).sum +
                  (X (some Vars.β) *
                          (X (some Vars.δ) *
                            (List.map
                                (fun b =>
                                  C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.y b)) *
                                    (to_MvPolynomial_Option Vars) (u_stmt b))
                                (List.finRange n_stmt)).sum) +
                        X (some Vars.α) *
                          (X (some Vars.δ) *
                            (List.map
                                (fun b =>
                                  C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.y b)) *
                                    (to_MvPolynomial_Option Vars) (v_stmt b))
                                (List.finRange n_stmt)).sum) +
                      X (some Vars.δ) *
                        (List.map
                            (fun b =>
                              C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.y b)) *
                                (to_MvPolynomial_Option Vars) (w_stmt b))
                            (List.finRange n_stmt)).sum +
                    (X (some Vars.β) *
                          (X (some Vars.γ) *
                            (List.map
                                (fun b =>
                                  C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.q b)) *
                                    (to_MvPolynomial_Option Vars) (u_wit b))
                                (List.finRange n_wit)).sum) +
                        X (some Vars.α) *
                          (X (some Vars.γ) *
                            (List.map
                                (fun b =>
                                  C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.q b)) *
                                    (to_MvPolynomial_Option Vars) (v_wit b))
                                (List.finRange n_wit)).sum) +
                      X (some Vars.γ) *
                        (List.map
                            (fun b =>
                              C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.q b)) *
                                (to_MvPolynomial_Option Vars) (w_wit b))
                            (List.finRange n_wit)).sum))))))) *
        (-(X (some Vars.γ) *
                  (X (some Vars.δ) *
                    (List.map (fun b => C (prover.2 Proof_G2_Idx.B (SRS_Elements_G2_Idx.x_pow b)) * X none ^ ↑b)
                        (List.finRange n_var)).sum)) +
              -(X (some Vars.γ) *
                  (X (some Vars.δ) * (X (some Vars.δ) * C (prover.2 Proof_G2_Idx.B SRS_Elements_G2_Idx.δ)))) +
            -(X (some Vars.γ) *
                (X (some Vars.δ) * (X (some Vars.γ) * C (prover.2 Proof_G2_Idx.B SRS_Elements_G2_Idx.γ)))) +
          -(X (some Vars.γ) *
              (X (some Vars.δ) * (X (some Vars.β) * C (prover.2 Proof_G2_Idx.B SRS_Elements_G2_Idx.β))))) +
      (X (some Vars.γ) *
          (X (some Vars.δ) * (X (some Vars.α) * (X (some Vars.γ) * (X (some Vars.δ) * X (some Vars.β))))) +
        ((X (some Vars.β) *
                  (X (some Vars.δ) *
                    (List.map (fun b => C (stmt b) * (to_MvPolynomial_Option Vars) (u_stmt b))
                        (List.finRange n_stmt)).sum) +
                X (some Vars.α) *
                  (X (some Vars.δ) *
                    (List.map (fun b => C (stmt b) * (to_MvPolynomial_Option Vars) (v_stmt b))
                        (List.finRange n_stmt)).sum) +
              X (some Vars.δ) *
                (List.map (fun b => C (stmt b) * (to_MvPolynomial_Option Vars) (w_stmt b))
                    (List.finRange n_stmt)).sum) *
            (X (some Vars.γ) * (X (some Vars.δ) * X (some Vars.γ))) +
          (X (some Vars.γ) * (X (some Vars.δ) * (X (some Vars.α) * C (prover.1 Proof_G1_Idx.C SRS_Elements_G1_Idx.α))) +
              (X (some Vars.γ) *
                  (X (some Vars.δ) * (X (some Vars.β) * C (prover.1 Proof_G1_Idx.C SRS_Elements_G1_Idx.β))) +
                (X (some Vars.γ) *
                    (X (some Vars.δ) * (X (some Vars.δ) * C (prover.1 Proof_G1_Idx.C SRS_Elements_G1_Idx.δ))) +
                  (X (some Vars.γ) *
                      (X (some Vars.δ) *
                        (List.map (fun b => C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.x_pow b)) * X none ^ ↑b)
                            (List.finRange n_var)).sum) +
                    (X (some Vars.γ) *
                        (List.map
                            (fun b =>
                              C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.x_pow_times_t b)) *
                                (X none ^ ↑b *
                                  ∏ x : Fin n_wit,
                                    ((to_MvPolynomial_Option Vars) Polynomial.X -
                                      (to_MvPolynomial_Option Vars) (Polynomial.C (r x)))))
                            (List.finRange (n_var - 1))).sum +
                      (X (some Vars.β) *
                              (X (some Vars.δ) *
                                (List.map
                                    (fun b =>
                                      C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.y b)) *
                                        (to_MvPolynomial_Option Vars) (u_stmt b))
                                    (List.finRange n_stmt)).sum) +
                            X (some Vars.α) *
                              (X (some Vars.δ) *
                                (List.map
                                    (fun b =>
                                      C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.y b)) *
                                        (to_MvPolynomial_Option Vars) (v_stmt b))
                                    (List.finRange n_stmt)).sum) +
                          X (some Vars.δ) *
                            (List.map
                                (fun b =>
                                  C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.y b)) *
                                    (to_MvPolynomial_Option Vars) (w_stmt b))
                                (List.finRange n_stmt)).sum +
                        (X (some Vars.β) *
                              (X (some Vars.γ) *
                                (List.map
                                    (fun b =>
                                      C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q b)) *
                                        (to_MvPolynomial_Option Vars) (u_wit b))
                                    (List.finRange n_wit)).sum) +
                            X (some Vars.α) *
                              (X (some Vars.γ) *
                                (List.map
                                    (fun b =>
                                      C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q b)) *
                                        (to_MvPolynomial_Option Vars) (v_wit b))
                                    (List.finRange n_wit)).sum) +
                          X (some Vars.γ) *
                            (List.map
                                (fun b =>
                                  C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q b)) *
                                    (to_MvPolynomial_Option Vars) (w_wit b))
                                (List.finRange n_wit)).sum))))))) *
            (X (some Vars.γ) * (X (some Vars.δ) * X (some Vars.δ))))) =
    0
⊢ ((List.map (fun i => Polynomial.C (stmt i) * u_stmt i) (List.finRange n_stmt)).sum +
        (List.map (fun i => Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q i)) * u_wit i)
            (List.finRange n_wit)).sum) *
      ((List.map (fun i => Polynomial.C (stmt i) * v_stmt i) (List.finRange n_stmt)).sum +
        (List.map (fun i => Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q i)) * v_wit i)
            (List.finRange n_wit)).sum) =
    (List.map (fun i => Polynomial.C (stmt i) * w_stmt i) (List.finRange n_stmt)).sum +
        (List.map (fun i => Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q i)) * w_wit i)
            (List.finRange n_wit)).sum +
      (List.map
          (fun x =>
            Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.x_pow_times_t x)) * (Polynomial.X ^ ↑x * t))
          (List.finRange (n_var - 1))).sum

State before:
case intro
F : Type
inst✝ : Field F
n_stmt n_wit n_var : ℕ
u_stmt : Fin n_stmt → Polynomial F
u_wit : Fin n_wit → Polynomial F
v_stmt : Fin n_stmt → Polynomial F
v_wit : Fin n_wit → Polynomial F
w_stmt : Fin n_stmt → Polynomial F
w_wit : Fin n_wit → Polynomial F
r : Fin n_wit → F
stmt : Groth16TypeIII.Stmt
prover : Prover F Groth16TypeIII
t : Polynomial F := ∏ i : Fin n_wit, (Polynomial.X - Polynomial.C (r i))
eqn :
  (X (some Vars.γ) * (X (some Vars.δ) * (X (some Vars.α) * C (prover.1 Proof_G1_Idx.A SRS_Elements_G1_Idx.α))) +
          (X (some Vars.γ) * (X (some Vars.δ) * (X (some Vars.β) * C (prover.1 Proof_G1_Idx.A SRS_Elements_G1_Idx.β))) +
            (X (some Vars.γ) *
                (X (some Vars.δ) * (X (some Vars.δ) * C (prover.1 Proof_G1_Idx.A SRS_Elements_G1_Idx.δ))) +
              (X (some Vars.γ) *
                  (X (some Vars.δ) *
                    (List.map (fun b => C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.x_pow b)) * X none ^ ↑b)
                        (List.finRange n_var)).sum) +
                (X (some Vars.γ) *
                    (List.map
                        (fun b =>
                          C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.x_pow_times_t b)) *
                            (X none ^ ↑b *
                              ∏ x : Fin n_wit,
                                ((to_MvPolynomial_Option Vars) Polynomial.X -
                                  (to_MvPolynomial_Option Vars) (Polynomial.C (r x)))))
                        (List.finRange (n_var - 1))).sum +
                  (X (some Vars.β) *
                          (X (some Vars.δ) *
                            (List.map
                                (fun b =>
                                  C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.y b)) *
                                    (to_MvPolynomial_Option Vars) (u_stmt b))
                                (List.finRange n_stmt)).sum) +
                        X (some Vars.α) *
                          (X (some Vars.δ) *
                            (List.map
                                (fun b =>
                                  C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.y b)) *
                                    (to_MvPolynomial_Option Vars) (v_stmt b))
                                (List.finRange n_stmt)).sum) +
                      X (some Vars.δ) *
                        (List.map
                            (fun b =>
                              C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.y b)) *
                                (to_MvPolynomial_Option Vars) (w_stmt b))
                            (List.finRange n_stmt)).sum +
                    (X (some Vars.β) *
                          (X (some Vars.γ) *
                            (List.map
                                (fun b =>
                                  C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.q b)) *
                                    (to_MvPolynomial_Option Vars) (u_wit b))
                                (List.finRange n_wit)).sum) +
                        X (some Vars.α) *
                          (X (some Vars.γ) *
                            (List.map
                                (fun b =>
                                  C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.q b)) *
                                    (to_MvPolynomial_Option Vars) (v_wit b))
                                (List.finRange n_wit)).sum) +
                      X (some Vars.γ) *
                        (List.map
                            (fun b =>
                              C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.q b)) *
                                (to_MvPolynomial_Option Vars) (w_wit b))
                            (List.finRange n_wit)).sum))))))) *
        (-(X (some Vars.γ) *
                  (X (some Vars.δ) *
                    (List.map (fun b => C (prover.2 Proof_G2_Idx.B (SRS_Elements_G2_Idx.x_pow b)) * X none ^ ↑b)
                        (List.finRange n_var)).sum)) +
              -(X (some Vars.γ) *
                  (X (some Vars.δ) * (X (some Vars.δ) * C (prover.2 Proof_G2_Idx.B SRS_Elements_G2_Idx.δ)))) +
            -(X (some Vars.γ) *
                (X (some Vars.δ) * (X (some Vars.γ) * C (prover.2 Proof_G2_Idx.B SRS_Elements_G2_Idx.γ)))) +
          -(X (some Vars.γ) *
              (X (some Vars.δ) * (X (some Vars.β) * C (prover.2 Proof_G2_Idx.B SRS_Elements_G2_Idx.β))))) +
      (X (some Vars.γ) *
          (X (some Vars.δ) * (X (some Vars.α) * (X (some Vars.γ) * (X (some Vars.δ) * X (some Vars.β))))) +
        ((X (some Vars.β) *
                  (X (some Vars.δ) *
                    (List.map (fun b => C (stmt b) * (to_MvPolynomial_Option Vars) (u_stmt b))
                        (List.finRange n_stmt)).sum) +
                X (some Vars.α) *
                  (X (some Vars.δ) *
                    (List.map (fun b => C (stmt b) * (to_MvPolynomial_Option Vars) (v_stmt b))
                        (List.finRange n_stmt)).sum) +
              X (some Vars.δ) *
                (List.map (fun b => C (stmt b) * (to_MvPolynomial_Option Vars) (w_stmt b))
                    (List.finRange n_stmt)).sum) *
            (X (some Vars.γ) * (X (some Vars.δ) * X (some Vars.γ))) +
          (X (some Vars.γ) * (X (some Vars.δ) * (X (some Vars.α) * C (prover.1 Proof_G1_Idx.C SRS_Elements_G1_Idx.α))) +
              (X (some Vars.γ) *
                  (X (some Vars.δ) * (X (some Vars.β) * C (prover.1 Proof_G1_Idx.C SRS_Elements_G1_Idx.β))) +
                (X (some Vars.γ) *
                    (X (some Vars.δ) * (X (some Vars.δ) * C (prover.1 Proof_G1_Idx.C SRS_Elements_G1_Idx.δ))) +
                  (X (some Vars.γ) *
                      (X (some Vars.δ) *
                        (List.map (fun b => C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.x_pow b)) * X none ^ ↑b)
                            (List.finRange n_var)).sum) +
                    (X (some Vars.γ) *
                        (List.map
                            (fun b =>
                              C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.x_pow_times_t b)) *
                                (X none ^ ↑b *
                                  ∏ x : Fin n_wit,
                                    ((to_MvPolynomial_Option Vars) Polynomial.X -
                                      (to_MvPolynomial_Option Vars) (Polynomial.C (r x)))))
                            (List.finRange (n_var - 1))).sum +
                      (X (some Vars.β) *
                              (X (some Vars.δ) *
                                (List.map
                                    (fun b =>
                                      C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.y b)) *
                                        (to_MvPolynomial_Option Vars) (u_stmt b))
                                    (List.finRange n_stmt)).sum) +
                            X (some Vars.α) *
                              (X (some Vars.δ) *
                                (List.map
                                    (fun b =>
                                      C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.y b)) *
                                        (to_MvPolynomial_Option Vars) (v_stmt b))
                                    (List.finRange n_stmt)).sum) +
                          X (some Vars.δ) *
                            (List.map
                                (fun b =>
                                  C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.y b)) *
                                    (to_MvPolynomial_Option Vars) (w_stmt b))
                                (List.finRange n_stmt)).sum +
                        (X (some Vars.β) *
                              (X (some Vars.γ) *
                                (List.map
                                    (fun b =>
                                      C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q b)) *
                                        (to_MvPolynomial_Option Vars) (u_wit b))
                                    (List.finRange n_wit)).sum) +
                            X (some Vars.α) *
                              (X (some Vars.γ) *
                                (List.map
                                    (fun b =>
                                      C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q b)) *
                                        (to_MvPolynomial_Option Vars) (v_wit b))
                                    (List.finRange n_wit)).sum) +
                          X (some Vars.γ) *
                            (List.map
                                (fun b =>
                                  C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q b)) *
                                    (to_MvPolynomial_Option Vars) (w_wit b))
                                (List.finRange n_wit)).sum))))))) *
            (X (some Vars.γ) * (X (some Vars.δ) * X (some Vars.δ))))) =
    0
⊢ ((List.map (fun i => Polynomial.C (stmt i) * u_stmt i) (List.finRange n_stmt)).sum +
        (List.map (fun i => Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q i)) * u_wit i)
            (List.finRange n_wit)).sum) *
      ((List.map (fun i => Polynomial.C (stmt i) * v_stmt i) (List.finRange n_stmt)).sum +
        (List.map (fun i => Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q i)) * v_wit i)
            (List.finRange n_wit)).sum) =
    (List.map (fun i => Polynomial.C (stmt i) * w_stmt i) (List.finRange n_stmt)).sum +
        (List.map (fun i => Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q i)) * w_wit i)
            (List.finRange n_wit)).sum +
      (List.map
          (fun x =>
            Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.x_pow_times_t x)) * (Polynomial.X ^ ↑x * t))
          (List.finRange (n_var - 1))).sum
Tactic:
simp only [←(EquivLike.apply_eq_iff_eq (optionEquivRight _ _))] at eqn
State after:
case intro
F : Type
inst✝ : Field F
n_stmt n_wit n_var : ℕ
u_stmt : Fin n_stmt → Polynomial F
u_wit : Fin n_wit → Polynomial F
v_stmt : Fin n_stmt → Polynomial F
v_wit : Fin n_wit → Polynomial F
w_stmt : Fin n_stmt → Polynomial F
w_wit : Fin n_wit → Polynomial F
r : Fin n_wit → F
stmt : Groth16TypeIII.Stmt
prover : Prover F Groth16TypeIII
t : Polynomial F := ∏ i : Fin n_wit, (Polynomial.X - Polynomial.C (r i))
eqn :
  (optionEquivRight F Vars)
      ((X (some Vars.γ) * (X (some Vars.δ) * (X (some Vars.α) * C (prover.1 Proof_G1_Idx.A SRS_Elements_G1_Idx.α))) +
            (X (some Vars.γ) *
                (X (some Vars.δ) * (X (some Vars.β) * C (prover.1 Proof_G1_Idx.A SRS_Elements_G1_Idx.β))) +
              (X (some Vars.γ) *
                  (X (some Vars.δ) * (X (some Vars.δ) * C (prover.1 Proof_G1_Idx.A SRS_Elements_G1_Idx.δ))) +
                (X (some Vars.γ) *
                    (X (some Vars.δ) *
                      (List.map (fun b => C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.x_pow b)) * X none ^ ↑b)
                          (List.finRange n_var)).sum) +
                  (X (some Vars.γ) *
                      (List.map
                          (fun b =>
                            C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.x_pow_times_t b)) *
                              (X none ^ ↑b *
                                ∏ x : Fin n_wit,
                                  ((to_MvPolynomial_Option Vars) Polynomial.X -
                                    (to_MvPolynomial_Option Vars) (Polynomial.C (r x)))))
                          (List.finRange (n_var - 1))).sum +
                    (X (some Vars.β) *
                            (X (some Vars.δ) *
                              (List.map
                                  (fun b =>
                                    C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.y b)) *
                                      (to_MvPolynomial_Option Vars) (u_stmt b))
                                  (List.finRange n_stmt)).sum) +
                          X (some Vars.α) *
                            (X (some Vars.δ) *
                              (List.map
                                  (fun b =>
                                    C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.y b)) *
                                      (to_MvPolynomial_Option Vars) (v_stmt b))
                                  (List.finRange n_stmt)).sum) +
                        X (some Vars.δ) *
                          (List.map
                              (fun b =>
                                C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.y b)) *
                                  (to_MvPolynomial_Option Vars) (w_stmt b))
                              (List.finRange n_stmt)).sum +
                      (X (some Vars.β) *
                            (X (some Vars.γ) *
                              (List.map
                                  (fun b =>
                                    C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.q b)) *
                                      (to_MvPolynomial_Option Vars) (u_wit b))
                                  (List.finRange n_wit)).sum) +
                          X (some Vars.α) *
                            (X (some Vars.γ) *
                              (List.map
                                  (fun b =>
                                    C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.q b)) *
                                      (to_MvPolynomial_Option Vars) (v_wit b))
                                  (List.finRange n_wit)).sum) +
                        X (some Vars.γ) *
                          (List.map
                              (fun b =>
                                C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.q b)) *
                                  (to_MvPolynomial_Option Vars) (w_wit b))
                              (List.finRange n_wit)).sum))))))) *
          (-(X (some Vars.γ) *
                    (X (some Vars.δ) *
                      (List.map (fun b => C (prover.2 Proof_G2_Idx.B (SRS_Elements_G2_Idx.x_pow b)) * X none ^ ↑b)
                          (List.finRange n_var)).sum)) +
                -(X (some Vars.γ) *
                    (X (some Vars.δ) * (X (some Vars.δ) * C (prover.2 Proof_G2_Idx.B SRS_Elements_G2_Idx.δ)))) +
              -(X (some Vars.γ) *
                  (X (some Vars.δ) * (X (some Vars.γ) * C (prover.2 Proof_G2_Idx.B SRS_Elements_G2_Idx.γ)))) +
            -(X (some Vars.γ) *
                (X (some Vars.δ) * (X (some Vars.β) * C (prover.2 Proof_G2_Idx.B SRS_Elements_G2_Idx.β))))) +
        (X (some Vars.γ) *
            (X (some Vars.δ) * (X (some Vars.α) * (X (some Vars.γ) * (X (some Vars.δ) * X (some Vars.β))))) +
          ((X (some Vars.β) *
                    (X (some Vars.δ) *
                      (List.map (fun b => C (stmt b) * (to_MvPolynomial_Option Vars) (u_stmt b))
                          (List.finRange n_stmt)).sum) +
                  X (some Vars.α) *
                    (X (some Vars.δ) *
                      (List.map (fun b => C (stmt b) * (to_MvPolynomial_Option Vars) (v_stmt b))
                          (List.finRange n_stmt)).sum) +
                X (some Vars.δ) *
                  (List.map (fun b => C (stmt b) * (to_MvPolynomial_Option Vars) (w_stmt b))
                      (List.finRange n_stmt)).sum) *
              (X (some Vars.γ) * (X (some Vars.δ) * X (some Vars.γ))) +
            (X (some Vars.γ) *
                  (X (some Vars.δ) * (X (some Vars.α) * C (prover.1 Proof_G1_Idx.C SRS_Elements_G1_Idx.α))) +
                (X (some Vars.γ) *
                    (X (some Vars.δ) * (X (some Vars.β) * C (prover.1 Proof_G1_Idx.C SRS_Elements_G1_Idx.β))) +
                  (X (some Vars.γ) *
                      (X (some Vars.δ) * (X (some Vars.δ) * C (prover.1 Proof_G1_Idx.C SRS_Elements_G1_Idx.δ))) +
                    (X (some Vars.γ) *
                        (X (some Vars.δ) *
                          (List.map (fun b => C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.x_pow b)) * X none ^ ↑b)
                              (List.finRange n_var)).sum) +
                      (X (some Vars.γ) *
                          (List.map
                              (fun b =>
                                C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.x_pow_times_t b)) *
                                  (X none ^ ↑b *
                                    ∏ x : Fin n_wit,
                                      ((to_MvPolynomial_Option Vars) Polynomial.X -
                                        (to_MvPolynomial_Option Vars) (Polynomial.C (r x)))))
                              (List.finRange (n_var - 1))).sum +
                        (X (some Vars.β) *
                                (X (some Vars.δ) *
                                  (List.map
                                      (fun b =>
                                        C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.y b)) *
                                          (to_MvPolynomial_Option Vars) (u_stmt b))
                                      (List.finRange n_stmt)).sum) +
                              X (some Vars.α) *
                                (X (some Vars.δ) *
                                  (List.map
                                      (fun b =>
                                        C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.y b)) *
                                          (to_MvPolynomial_Option Vars) (v_stmt b))
                                      (List.finRange n_stmt)).sum) +
                            X (some Vars.δ) *
                              (List.map
                                  (fun b =>
                                    C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.y b)) *
                                      (to_MvPolynomial_Option Vars) (w_stmt b))
                                  (List.finRange n_stmt)).sum +
                          (X (some Vars.β) *
                                (X (some Vars.γ) *
                                  (List.map
                                      (fun b =>
                                        C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q b)) *
                                          (to_MvPolynomial_Option Vars) (u_wit b))
                                      (List.finRange n_wit)).sum) +
                              X (some Vars.α) *
                                (X (some Vars.γ) *
                                  (List.map
                                      (fun b =>
                                        C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q b)) *
                                          (to_MvPolynomial_Option Vars) (v_wit b))
                                      (List.finRange n_wit)).sum) +
                            X (some Vars.γ) *
                              (List.map
                                  (fun b =>
                                    C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q b)) *
                                      (to_MvPolynomial_Option Vars) (w_wit b))
                                  (List.finRange n_wit)).sum))))))) *
              (X (some Vars.γ) * (X (some Vars.δ) * X (some Vars.δ)))))) =
    (optionEquivRight F Vars) 0
⊢ ((List.map (fun i => Polynomial.C (stmt i) * u_stmt i) (List.finRange n_stmt)).sum +
        (List.map (fun i => Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q i)) * u_wit i)
            (List.finRange n_wit)).sum) *
      ((List.map (fun i => Polynomial.C (stmt i) * v_stmt i) (List.finRange n_stmt)).sum +
        (List.map (fun i => Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q i)) * v_wit i)
            (List.finRange n_wit)).sum) =
    (List.map (fun i => Polynomial.C (stmt i) * w_stmt i) (List.finRange n_stmt)).sum +
        (List.map (fun i => Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q i)) * w_wit i)
            (List.finRange n_wit)).sum +
      (List.map
          (fun x =>
            Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.x_pow_times_t x)) * (Polynomial.X ^ ↑x * t))
          (List.finRange (n_var - 1))).sum

State before:
case intro
F : Type
inst✝ : Field F
n_stmt n_wit n_var : ℕ
u_stmt : Fin n_stmt → Polynomial F
u_wit : Fin n_wit → Polynomial F
v_stmt : Fin n_stmt → Polynomial F
v_wit : Fin n_wit → Polynomial F
w_stmt : Fin n_stmt → Polynomial F
w_wit : Fin n_wit → Polynomial F
r : Fin n_wit → F
stmt : Groth16TypeIII.Stmt
prover : Prover F Groth16TypeIII
t : Polynomial F := ∏ i : Fin n_wit, (Polynomial.X - Polynomial.C (r i))
eqn :
  (optionEquivRight F Vars)
      ((X (some Vars.γ) * (X (some Vars.δ) * (X (some Vars.α) * C (prover.1 Proof_G1_Idx.A SRS_Elements_G1_Idx.α))) +
            (X (some Vars.γ) *
                (X (some Vars.δ) * (X (some Vars.β) * C (prover.1 Proof_G1_Idx.A SRS_Elements_G1_Idx.β))) +
              (X (some Vars.γ) *
                  (X (some Vars.δ) * (X (some Vars.δ) * C (prover.1 Proof_G1_Idx.A SRS_Elements_G1_Idx.δ))) +
                (X (some Vars.γ) *
                    (X (some Vars.δ) *
                      (List.map (fun b => C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.x_pow b)) * X none ^ ↑b)
                          (List.finRange n_var)).sum) +
                  (X (some Vars.γ) *
                      (List.map
                          (fun b =>
                            C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.x_pow_times_t b)) *
                              (X none ^ ↑b *
                                ∏ x : Fin n_wit,
                                  ((to_MvPolynomial_Option Vars) Polynomial.X -
                                    (to_MvPolynomial_Option Vars) (Polynomial.C (r x)))))
                          (List.finRange (n_var - 1))).sum +
                    (X (some Vars.β) *
                            (X (some Vars.δ) *
                              (List.map
                                  (fun b =>
                                    C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.y b)) *
                                      (to_MvPolynomial_Option Vars) (u_stmt b))
                                  (List.finRange n_stmt)).sum) +
                          X (some Vars.α) *
                            (X (some Vars.δ) *
                              (List.map
                                  (fun b =>
                                    C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.y b)) *
                                      (to_MvPolynomial_Option Vars) (v_stmt b))
                                  (List.finRange n_stmt)).sum) +
                        X (some Vars.δ) *
                          (List.map
                              (fun b =>
                                C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.y b)) *
                                  (to_MvPolynomial_Option Vars) (w_stmt b))
                              (List.finRange n_stmt)).sum +
                      (X (some Vars.β) *
                            (X (some Vars.γ) *
                              (List.map
                                  (fun b =>
                                    C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.q b)) *
                                      (to_MvPolynomial_Option Vars) (u_wit b))
                                  (List.finRange n_wit)).sum) +
                          X (some Vars.α) *
                            (X (some Vars.γ) *
                              (List.map
                                  (fun b =>
                                    C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.q b)) *
                                      (to_MvPolynomial_Option Vars) (v_wit b))
                                  (List.finRange n_wit)).sum) +
                        X (some Vars.γ) *
                          (List.map
                              (fun b =>
                                C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.q b)) *
                                  (to_MvPolynomial_Option Vars) (w_wit b))
                              (List.finRange n_wit)).sum))))))) *
          (-(X (some Vars.γ) *
                    (X (some Vars.δ) *
                      (List.map (fun b => C (prover.2 Proof_G2_Idx.B (SRS_Elements_G2_Idx.x_pow b)) * X none ^ ↑b)
                          (List.finRange n_var)).sum)) +
                -(X (some Vars.γ) *
                    (X (some Vars.δ) * (X (some Vars.δ) * C (prover.2 Proof_G2_Idx.B SRS_Elements_G2_Idx.δ)))) +
              -(X (some Vars.γ) *
                  (X (some Vars.δ) * (X (some Vars.γ) * C (prover.2 Proof_G2_Idx.B SRS_Elements_G2_Idx.γ)))) +
            -(X (some Vars.γ) *
                (X (some Vars.δ) * (X (some Vars.β) * C (prover.2 Proof_G2_Idx.B SRS_Elements_G2_Idx.β))))) +
        (X (some Vars.γ) *
            (X (some Vars.δ) * (X (some Vars.α) * (X (some Vars.γ) * (X (some Vars.δ) * X (some Vars.β))))) +
          ((X (some Vars.β) *
                    (X (some Vars.δ) *
                      (List.map (fun b => C (stmt b) * (to_MvPolynomial_Option Vars) (u_stmt b))
                          (List.finRange n_stmt)).sum) +
                  X (some Vars.α) *
                    (X (some Vars.δ) *
                      (List.map (fun b => C (stmt b) * (to_MvPolynomial_Option Vars) (v_stmt b))
                          (List.finRange n_stmt)).sum) +
                X (some Vars.δ) *
                  (List.map (fun b => C (stmt b) * (to_MvPolynomial_Option Vars) (w_stmt b))
                      (List.finRange n_stmt)).sum) *
              (X (some Vars.γ) * (X (some Vars.δ) * X (some Vars.γ))) +
            (X (some Vars.γ) *
                  (X (some Vars.δ) * (X (some Vars.α) * C (prover.1 Proof_G1_Idx.C SRS_Elements_G1_Idx.α))) +
                (X (some Vars.γ) *
                    (X (some Vars.δ) * (X (some Vars.β) * C (prover.1 Proof_G1_Idx.C SRS_Elements_G1_Idx.β))) +
                  (X (some Vars.γ) *
                      (X (some Vars.δ) * (X (some Vars.δ) * C (prover.1 Proof_G1_Idx.C SRS_Elements_G1_Idx.δ))) +
                    (X (some Vars.γ) *
                        (X (some Vars.δ) *
                          (List.map (fun b => C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.x_pow b)) * X none ^ ↑b)
                              (List.finRange n_var)).sum) +
                      (X (some Vars.γ) *
                          (List.map
                              (fun b =>
                                C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.x_pow_times_t b)) *
                                  (X none ^ ↑b *
                                    ∏ x : Fin n_wit,
                                      ((to_MvPolynomial_Option Vars) Polynomial.X -
                                        (to_MvPolynomial_Option Vars) (Polynomial.C (r x)))))
                              (List.finRange (n_var - 1))).sum +
                        (X (some Vars.β) *
                                (X (some Vars.δ) *
                                  (List.map
                                      (fun b =>
                                        C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.y b)) *
                                          (to_MvPolynomial_Option Vars) (u_stmt b))
                                      (List.finRange n_stmt)).sum) +
                              X (some Vars.α) *
                                (X (some Vars.δ) *
                                  (List.map
                                      (fun b =>
                                        C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.y b)) *
                                          (to_MvPolynomial_Option Vars) (v_stmt b))
                                      (List.finRange n_stmt)).sum) +
                            X (some Vars.δ) *
                              (List.map
                                  (fun b =>
                                    C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.y b)) *
                                      (to_MvPolynomial_Option Vars) (w_stmt b))
                                  (List.finRange n_stmt)).sum +
                          (X (some Vars.β) *
                                (X (some Vars.γ) *
                                  (List.map
                                      (fun b =>
                                        C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q b)) *
                                          (to_MvPolynomial_Option Vars) (u_wit b))
                                      (List.finRange n_wit)).sum) +
                              X (some Vars.α) *
                                (X (some Vars.γ) *
                                  (List.map
                                      (fun b =>
                                        C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q b)) *
                                          (to_MvPolynomial_Option Vars) (v_wit b))
                                      (List.finRange n_wit)).sum) +
                            X (some Vars.γ) *
                              (List.map
                                  (fun b =>
                                    C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q b)) *
                                      (to_MvPolynomial_Option Vars) (w_wit b))
                                  (List.finRange n_wit)).sum))))))) *
              (X (some Vars.γ) * (X (some Vars.δ) * X (some Vars.δ)))))) =
    (optionEquivRight F Vars) 0
⊢ ((List.map (fun i => Polynomial.C (stmt i) * u_stmt i) (List.finRange n_stmt)).sum +
        (List.map (fun i => Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q i)) * u_wit i)
            (List.finRange n_wit)).sum) *
      ((List.map (fun i => Polynomial.C (stmt i) * v_stmt i) (List.finRange n_stmt)).sum +
        (List.map (fun i => Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q i)) * v_wit i)
            (List.finRange n_wit)).sum) =
    (List.map (fun i => Polynomial.C (stmt i) * w_stmt i) (List.finRange n_stmt)).sum +
        (List.map (fun i => Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q i)) * w_wit i)
            (List.finRange n_wit)).sum +
      (List.map
          (fun x =>
            Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.x_pow_times_t x)) * (Polynomial.X ^ ↑x * t))
          (List.finRange (n_var - 1))).sum
Tactic:
simp only [AlgEquiv.map_add, AlgEquiv.map_zero, AlgEquiv.map_mul, AlgEquiv.map_one,
  AlgEquiv.map_neg, AlgEquiv.list_map_sum, AlgEquiv.map_pow] at eqn
State after:
case intro
F : Type
inst✝ : Field F
n_stmt n_wit n_var : ℕ
u_stmt : Fin n_stmt → Polynomial F
u_wit : Fin n_wit → Polynomial F
v_stmt : Fin n_stmt → Polynomial F
v_wit : Fin n_wit → Polynomial F
w_stmt : Fin n_stmt → Polynomial F
w_wit : Fin n_wit → Polynomial F
r : Fin n_wit → F
stmt : Groth16TypeIII.Stmt
prover : Prover F Groth16TypeIII
t : Polynomial F := ∏ i : Fin n_wit, (Polynomial.X - Polynomial.C (r i))
eqn :
  ((optionEquivRight F Vars) (X (some Vars.γ)) *
            ((optionEquivRight F Vars) (X (some Vars.δ)) *
              ((optionEquivRight F Vars) (X (some Vars.α)) *
                (optionEquivRight F Vars) (C (prover.1 Proof_G1_Idx.A SRS_Elements_G1_Idx.α)))) +
          ((optionEquivRight F Vars) (X (some Vars.γ)) *
              ((optionEquivRight F Vars) (X (some Vars.δ)) *
                ((optionEquivRight F Vars) (X (some Vars.β)) *
                  (optionEquivRight F Vars) (C (prover.1 Proof_G1_Idx.A SRS_Elements_G1_Idx.β)))) +
            ((optionEquivRight F Vars) (X (some Vars.γ)) *
                ((optionEquivRight F Vars) (X (some Vars.δ)) *
                  ((optionEquivRight F Vars) (X (some Vars.δ)) *
                    (optionEquivRight F Vars) (C (prover.1 Proof_G1_Idx.A SRS_Elements_G1_Idx.δ)))) +
              ((optionEquivRight F Vars) (X (some Vars.γ)) *
                  ((optionEquivRight F Vars) (X (some Vars.δ)) *
                    (List.map
                        (fun x =>
                          (optionEquivRight F Vars) (C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.x_pow x))) *
                            (optionEquivRight F Vars) (X none) ^ ↑x)
                        (List.finRange n_var)).sum) +
                ((optionEquivRight F Vars) (X (some Vars.γ)) *
                    (List.map
                        (fun x =>
                          (optionEquivRight F Vars)
                              (C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.x_pow_times_t x))) *
                            ((optionEquivRight F Vars) (X none) ^ ↑x *
                              (optionEquivRight F Vars)
                                (∏ x : Fin n_wit,
                                  ((to_MvPolynomial_Option Vars) Polynomial.X -
                                    (to_MvPolynomial_Option Vars) (Polynomial.C (r x))))))
                        (List.finRange (n_var - 1))).sum +
                  ((optionEquivRight F Vars) (X (some Vars.β)) *
                          ((optionEquivRight F Vars) (X (some Vars.δ)) *
                            (List.map
                                (fun x =>
                                  (optionEquivRight F Vars) (C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.y x))) *
                                    (optionEquivRight F Vars) ((to_MvPolynomial_Option Vars) (u_stmt x)))
                                (List.finRange n_stmt)).sum) +
                        (optionEquivRight F Vars) (X (some Vars.α)) *
                          ((optionEquivRight F Vars) (X (some Vars.δ)) *
                            (List.map
                                (fun x =>
                                  (optionEquivRight F Vars) (C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.y x))) *
                                    (optionEquivRight F Vars) ((to_MvPolynomial_Option Vars) (v_stmt x)))
                                (List.finRange n_stmt)).sum) +
                      (optionEquivRight F Vars) (X (some Vars.δ)) *
                        (List.map
                            (fun x =>
                              (optionEquivRight F Vars) (C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.y x))) *
                                (optionEquivRight F Vars) ((to_MvPolynomial_Option Vars) (w_stmt x)))
                            (List.finRange n_stmt)).sum +
                    ((optionEquivRight F Vars) (X (some Vars.β)) *
                          ((optionEquivRight F Vars) (X (some Vars.γ)) *
                            (List.map
                                (fun x =>
                                  (optionEquivRight F Vars) (C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.q x))) *
                                    (optionEquivRight F Vars) ((to_MvPolynomial_Option Vars) (u_wit x)))
                                (List.finRange n_wit)).sum) +
                        (optionEquivRight F Vars) (X (some Vars.α)) *
                          ((optionEquivRight F Vars) (X (some Vars.γ)) *
                            (List.map
                                (fun x =>
                                  (optionEquivRight F Vars) (C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.q x))) *
                                    (optionEquivRight F Vars) ((to_MvPolynomial_Option Vars) (v_wit x)))
                                (List.finRange n_wit)).sum) +
                      (optionEquivRight F Vars) (X (some Vars.γ)) *
                        (List.map
                            (fun x =>
                              (optionEquivRight F Vars) (C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.q x))) *
                                (optionEquivRight F Vars) ((to_MvPolynomial_Option Vars) (w_wit x)))
                            (List.finRange n_wit)).sum))))))) *
        (-((optionEquivRight F Vars) (X (some Vars.γ)) *
                  ((optionEquivRight F Vars) (X (some Vars.δ)) *
                    (List.map
                        (fun x =>
                          (optionEquivRight F Vars) (C (prover.2 Proof_G2_Idx.B (SRS_Elements_G2_Idx.x_pow x))) *
                            (optionEquivRight F Vars) (X none) ^ ↑x)
                        (List.finRange n_var)).sum)) +
              -((optionEquivRight F Vars) (X (some Vars.γ)) *
                  ((optionEquivRight F Vars) (X (some Vars.δ)) *
                    ((optionEquivRight F Vars) (X (some Vars.δ)) *
                      (optionEquivRight F Vars) (C (prover.2 Proof_G2_Idx.B SRS_Elements_G2_Idx.δ))))) +
            -((optionEquivRight F Vars) (X (some Vars.γ)) *
                ((optionEquivRight F Vars) (X (some Vars.δ)) *
                  ((optionEquivRight F Vars) (X (some Vars.γ)) *
                    (optionEquivRight F Vars) (C (prover.2 Proof_G2_Idx.B SRS_Elements_G2_Idx.γ))))) +
          -((optionEquivRight F Vars) (X (some Vars.γ)) *
              ((optionEquivRight F Vars) (X (some Vars.δ)) *
                ((optionEquivRight F Vars) (X (some Vars.β)) *
                  (optionEquivRight F Vars) (C (prover.2 Proof_G2_Idx.B SRS_Elements_G2_Idx.β)))))) +
      ((optionEquivRight F Vars) (X (some Vars.γ)) *
          ((optionEquivRight F Vars) (X (some Vars.δ)) *
            ((optionEquivRight F Vars) (X (some Vars.α)) *
              ((optionEquivRight F Vars) (X (some Vars.γ)) *
                ((optionEquivRight F Vars) (X (some Vars.δ)) * (optionEquivRight F Vars) (X (some Vars.β)))))) +
        (((optionEquivRight F Vars) (X (some Vars.β)) *
                  ((optionEquivRight F Vars) (X (some Vars.δ)) *
                    (List.map
                        (fun x =>
                          (optionEquivRight F Vars) (C (stmt x)) *
                            (optionEquivRight F Vars) ((to_MvPolynomial_Option Vars) (u_stmt x)))
                        (List.finRange n_stmt)).sum) +
                (optionEquivRight F Vars) (X (some Vars.α)) *
                  ((optionEquivRight F Vars) (X (some Vars.δ)) *
                    (List.map
                        (fun x =>
                          (optionEquivRight F Vars) (C (stmt x)) *
                            (optionEquivRight F Vars) ((to_MvPolynomial_Option Vars) (v_stmt x)))
                        (List.finRange n_stmt)).sum) +
              (optionEquivRight F Vars) (X (some Vars.δ)) *
                (List.map
                    (fun x =>
                      (optionEquivRight F Vars) (C (stmt x)) *
                        (optionEquivRight F Vars) ((to_MvPolynomial_Option Vars) (w_stmt x)))
                    (List.finRange n_stmt)).sum) *
            ((optionEquivRight F Vars) (X (some Vars.γ)) *
              ((optionEquivRight F Vars) (X (some Vars.δ)) * (optionEquivRight F Vars) (X (some Vars.γ)))) +
          ((optionEquivRight F Vars) (X (some Vars.γ)) *
                ((optionEquivRight F Vars) (X (some Vars.δ)) *
                  ((optionEquivRight F Vars) (X (some Vars.α)) *
                    (optionEquivRight F Vars) (C (prover.1 Proof_G1_Idx.C SRS_Elements_G1_Idx.α)))) +
              ((optionEquivRight F Vars) (X (some Vars.γ)) *
                  ((optionEquivRight F Vars) (X (some Vars.δ)) *
                    ((optionEquivRight F Vars) (X (some Vars.β)) *
                      (optionEquivRight F Vars) (C (prover.1 Proof_G1_Idx.C SRS_Elements_G1_Idx.β)))) +
                ((optionEquivRight F Vars) (X (some Vars.γ)) *
                    ((optionEquivRight F Vars) (X (some Vars.δ)) *
                      ((optionEquivRight F Vars) (X (some Vars.δ)) *
                        (optionEquivRight F Vars) (C (prover.1 Proof_G1_Idx.C SRS_Elements_G1_Idx.δ)))) +
                  ((optionEquivRight F Vars) (X (some Vars.γ)) *
                      ((optionEquivRight F Vars) (X (some Vars.δ)) *
                        (List.map
                            (fun x =>
                              (optionEquivRight F Vars) (C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.x_pow x))) *
                                (optionEquivRight F Vars) (X none) ^ ↑x)
                            (List.finRange n_var)).sum) +
                    ((optionEquivRight F Vars) (X (some Vars.γ)) *
                        (List.map
                            (fun x =>
                              (optionEquivRight F Vars)
                                  (C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.x_pow_times_t x))) *
                                ((optionEquivRight F Vars) (X none) ^ ↑x *
                                  (optionEquivRight F Vars)
                                    (∏ x : Fin n_wit,
                                      ((to_MvPolynomial_Option Vars) Polynomial.X -
                                        (to_MvPolynomial_Option Vars) (Polynomial.C (r x))))))
                            (List.finRange (n_var - 1))).sum +
                      ((optionEquivRight F Vars) (X (some Vars.β)) *
                              ((optionEquivRight F Vars) (X (some Vars.δ)) *
                                (List.map
                                    (fun x =>
                                      (optionEquivRight F Vars)
                                          (C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.y x))) *
                                        (optionEquivRight F Vars) ((to_MvPolynomial_Option Vars) (u_stmt x)))
                                    (List.finRange n_stmt)).sum) +
                            (optionEquivRight F Vars) (X (some Vars.α)) *
                              ((optionEquivRight F Vars) (X (some Vars.δ)) *
                                (List.map
                                    (fun x =>
                                      (optionEquivRight F Vars)
                                          (C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.y x))) *
                                        (optionEquivRight F Vars) ((to_MvPolynomial_Option Vars) (v_stmt x)))
                                    (List.finRange n_stmt)).sum) +
                          (optionEquivRight F Vars) (X (some Vars.δ)) *
                            (List.map
                                (fun x =>
                                  (optionEquivRight F Vars) (C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.y x))) *
                                    (optionEquivRight F Vars) ((to_MvPolynomial_Option Vars) (w_stmt x)))
                                (List.finRange n_stmt)).sum +
                        ((optionEquivRight F Vars) (X (some Vars.β)) *
                              ((optionEquivRight F Vars) (X (some Vars.γ)) *
                                (List.map
                                    (fun x =>
                                      (optionEquivRight F Vars)
                                          (C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q x))) *
                                        (optionEquivRight F Vars) ((to_MvPolynomial_Option Vars) (u_wit x)))
                                    (List.finRange n_wit)).sum) +
                            (optionEquivRight F Vars) (X (some Vars.α)) *
                              ((optionEquivRight F Vars) (X (some Vars.γ)) *
                                (List.map
                                    (fun x =>
                                      (optionEquivRight F Vars)
                                          (C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q x))) *
                                        (optionEquivRight F Vars) ((to_MvPolynomial_Option Vars) (v_wit x)))
                                    (List.finRange n_wit)).sum) +
                          (optionEquivRight F Vars) (X (some Vars.γ)) *
                            (List.map
                                (fun x =>
                                  (optionEquivRight F Vars) (C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q x))) *
                                    (optionEquivRight F Vars) ((to_MvPolynomial_Option Vars) (w_wit x)))
                                (List.finRange n_wit)).sum))))))) *
            ((optionEquivRight F Vars) (X (some Vars.γ)) *
              ((optionEquivRight F Vars) (X (some Vars.δ)) * (optionEquivRight F Vars) (X (some Vars.δ)))))) =
    0
⊢ ((List.map (fun i => Polynomial.C (stmt i) * u_stmt i) (List.finRange n_stmt)).sum +
        (List.map (fun i => Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q i)) * u_wit i)
            (List.finRange n_wit)).sum) *
      ((List.map (fun i => Polynomial.C (stmt i) * v_stmt i) (List.finRange n_stmt)).sum +
        (List.map (fun i => Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q i)) * v_wit i)
            (List.finRange n_wit)).sum) =
    (List.map (fun i => Polynomial.C (stmt i) * w_stmt i) (List.finRange n_stmt)).sum +
        (List.map (fun i => Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q i)) * w_wit i)
            (List.finRange n_wit)).sum +
      (List.map
          (fun x =>
            Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.x_pow_times_t x)) * (Polynomial.X ^ ↑x * t))
          (List.finRange (n_var - 1))).sum

State before:
case intro
F : Type
inst✝ : Field F
n_stmt n_wit n_var : ℕ
u_stmt : Fin n_stmt → Polynomial F
u_wit : Fin n_wit → Polynomial F
v_stmt : Fin n_stmt → Polynomial F
v_wit : Fin n_wit → Polynomial F
w_stmt : Fin n_stmt → Polynomial F
w_wit : Fin n_wit → Polynomial F
r : Fin n_wit → F
stmt : Groth16TypeIII.Stmt
prover : Prover F Groth16TypeIII
t : Polynomial F := ∏ i : Fin n_wit, (Polynomial.X - Polynomial.C (r i))
eqn :
  ((optionEquivRight F Vars) (X (some Vars.γ)) *
            ((optionEquivRight F Vars) (X (some Vars.δ)) *
              ((optionEquivRight F Vars) (X (some Vars.α)) *
                (optionEquivRight F Vars) (C (prover.1 Proof_G1_Idx.A SRS_Elements_G1_Idx.α)))) +
          ((optionEquivRight F Vars) (X (some Vars.γ)) *
              ((optionEquivRight F Vars) (X (some Vars.δ)) *
                ((optionEquivRight F Vars) (X (some Vars.β)) *
                  (optionEquivRight F Vars) (C (prover.1 Proof_G1_Idx.A SRS_Elements_G1_Idx.β)))) +
            ((optionEquivRight F Vars) (X (some Vars.γ)) *
                ((optionEquivRight F Vars) (X (some Vars.δ)) *
                  ((optionEquivRight F Vars) (X (some Vars.δ)) *
                    (optionEquivRight F Vars) (C (prover.1 Proof_G1_Idx.A SRS_Elements_G1_Idx.δ)))) +
              ((optionEquivRight F Vars) (X (some Vars.γ)) *
                  ((optionEquivRight F Vars) (X (some Vars.δ)) *
                    (List.map
                        (fun x =>
                          (optionEquivRight F Vars) (C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.x_pow x))) *
                            (optionEquivRight F Vars) (X none) ^ ↑x)
                        (List.finRange n_var)).sum) +
                ((optionEquivRight F Vars) (X (some Vars.γ)) *
                    (List.map
                        (fun x =>
                          (optionEquivRight F Vars)
                              (C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.x_pow_times_t x))) *
                            ((optionEquivRight F Vars) (X none) ^ ↑x *
                              (optionEquivRight F Vars)
                                (∏ x : Fin n_wit,
                                  ((to_MvPolynomial_Option Vars) Polynomial.X -
                                    (to_MvPolynomial_Option Vars) (Polynomial.C (r x))))))
                        (List.finRange (n_var - 1))).sum +
                  ((optionEquivRight F Vars) (X (some Vars.β)) *
                          ((optionEquivRight F Vars) (X (some Vars.δ)) *
                            (List.map
                                (fun x =>
                                  (optionEquivRight F Vars) (C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.y x))) *
                                    (optionEquivRight F Vars) ((to_MvPolynomial_Option Vars) (u_stmt x)))
                                (List.finRange n_stmt)).sum) +
                        (optionEquivRight F Vars) (X (some Vars.α)) *
                          ((optionEquivRight F Vars) (X (some Vars.δ)) *
                            (List.map
                                (fun x =>
                                  (optionEquivRight F Vars) (C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.y x))) *
                                    (optionEquivRight F Vars) ((to_MvPolynomial_Option Vars) (v_stmt x)))
                                (List.finRange n_stmt)).sum) +
                      (optionEquivRight F Vars) (X (some Vars.δ)) *
                        (List.map
                            (fun x =>
                              (optionEquivRight F Vars) (C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.y x))) *
                                (optionEquivRight F Vars) ((to_MvPolynomial_Option Vars) (w_stmt x)))
                            (List.finRange n_stmt)).sum +
                    ((optionEquivRight F Vars) (X (some Vars.β)) *
                          ((optionEquivRight F Vars) (X (some Vars.γ)) *
                            (List.map
                                (fun x =>
                                  (optionEquivRight F Vars) (C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.q x))) *
                                    (optionEquivRight F Vars) ((to_MvPolynomial_Option Vars) (u_wit x)))
                                (List.finRange n_wit)).sum) +
                        (optionEquivRight F Vars) (X (some Vars.α)) *
                          ((optionEquivRight F Vars) (X (some Vars.γ)) *
                            (List.map
                                (fun x =>
                                  (optionEquivRight F Vars) (C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.q x))) *
                                    (optionEquivRight F Vars) ((to_MvPolynomial_Option Vars) (v_wit x)))
                                (List.finRange n_wit)).sum) +
                      (optionEquivRight F Vars) (X (some Vars.γ)) *
                        (List.map
                            (fun x =>
                              (optionEquivRight F Vars) (C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.q x))) *
                                (optionEquivRight F Vars) ((to_MvPolynomial_Option Vars) (w_wit x)))
                            (List.finRange n_wit)).sum))))))) *
        (-((optionEquivRight F Vars) (X (some Vars.γ)) *
                  ((optionEquivRight F Vars) (X (some Vars.δ)) *
                    (List.map
                        (fun x =>
                          (optionEquivRight F Vars) (C (prover.2 Proof_G2_Idx.B (SRS_Elements_G2_Idx.x_pow x))) *
                            (optionEquivRight F Vars) (X none) ^ ↑x)
                        (List.finRange n_var)).sum)) +
              -((optionEquivRight F Vars) (X (some Vars.γ)) *
                  ((optionEquivRight F Vars) (X (some Vars.δ)) *
                    ((optionEquivRight F Vars) (X (some Vars.δ)) *
                      (optionEquivRight F Vars) (C (prover.2 Proof_G2_Idx.B SRS_Elements_G2_Idx.δ))))) +
            -((optionEquivRight F Vars) (X (some Vars.γ)) *
                ((optionEquivRight F Vars) (X (some Vars.δ)) *
                  ((optionEquivRight F Vars) (X (some Vars.γ)) *
                    (optionEquivRight F Vars) (C (prover.2 Proof_G2_Idx.B SRS_Elements_G2_Idx.γ))))) +
          -((optionEquivRight F Vars) (X (some Vars.γ)) *
              ((optionEquivRight F Vars) (X (some Vars.δ)) *
                ((optionEquivRight F Vars) (X (some Vars.β)) *
                  (optionEquivRight F Vars) (C (prover.2 Proof_G2_Idx.B SRS_Elements_G2_Idx.β)))))) +
      ((optionEquivRight F Vars) (X (some Vars.γ)) *
          ((optionEquivRight F Vars) (X (some Vars.δ)) *
            ((optionEquivRight F Vars) (X (some Vars.α)) *
              ((optionEquivRight F Vars) (X (some Vars.γ)) *
                ((optionEquivRight F Vars) (X (some Vars.δ)) * (optionEquivRight F Vars) (X (some Vars.β)))))) +
        (((optionEquivRight F Vars) (X (some Vars.β)) *
                  ((optionEquivRight F Vars) (X (some Vars.δ)) *
                    (List.map
                        (fun x =>
                          (optionEquivRight F Vars) (C (stmt x)) *
                            (optionEquivRight F Vars) ((to_MvPolynomial_Option Vars) (u_stmt x)))
                        (List.finRange n_stmt)).sum) +
                (optionEquivRight F Vars) (X (some Vars.α)) *
                  ((optionEquivRight F Vars) (X (some Vars.δ)) *
                    (List.map
                        (fun x =>
                          (optionEquivRight F Vars) (C (stmt x)) *
                            (optionEquivRight F Vars) ((to_MvPolynomial_Option Vars) (v_stmt x)))
                        (List.finRange n_stmt)).sum) +
              (optionEquivRight F Vars) (X (some Vars.δ)) *
                (List.map
                    (fun x =>
                      (optionEquivRight F Vars) (C (stmt x)) *
                        (optionEquivRight F Vars) ((to_MvPolynomial_Option Vars) (w_stmt x)))
                    (List.finRange n_stmt)).sum) *
            ((optionEquivRight F Vars) (X (some Vars.γ)) *
              ((optionEquivRight F Vars) (X (some Vars.δ)) * (optionEquivRight F Vars) (X (some Vars.γ)))) +
          ((optionEquivRight F Vars) (X (some Vars.γ)) *
                ((optionEquivRight F Vars) (X (some Vars.δ)) *
                  ((optionEquivRight F Vars) (X (some Vars.α)) *
                    (optionEquivRight F Vars) (C (prover.1 Proof_G1_Idx.C SRS_Elements_G1_Idx.α)))) +
              ((optionEquivRight F Vars) (X (some Vars.γ)) *
                  ((optionEquivRight F Vars) (X (some Vars.δ)) *
                    ((optionEquivRight F Vars) (X (some Vars.β)) *
                      (optionEquivRight F Vars) (C (prover.1 Proof_G1_Idx.C SRS_Elements_G1_Idx.β)))) +
                ((optionEquivRight F Vars) (X (some Vars.γ)) *
                    ((optionEquivRight F Vars) (X (some Vars.δ)) *
                      ((optionEquivRight F Vars) (X (some Vars.δ)) *
                        (optionEquivRight F Vars) (C (prover.1 Proof_G1_Idx.C SRS_Elements_G1_Idx.δ)))) +
                  ((optionEquivRight F Vars) (X (some Vars.γ)) *
                      ((optionEquivRight F Vars) (X (some Vars.δ)) *
                        (List.map
                            (fun x =>
                              (optionEquivRight F Vars) (C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.x_pow x))) *
                                (optionEquivRight F Vars) (X none) ^ ↑x)
                            (List.finRange n_var)).sum) +
                    ((optionEquivRight F Vars) (X (some Vars.γ)) *
                        (List.map
                            (fun x =>
                              (optionEquivRight F Vars)
                                  (C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.x_pow_times_t x))) *
                                ((optionEquivRight F Vars) (X none) ^ ↑x *
                                  (optionEquivRight F Vars)
                                    (∏ x : Fin n_wit,
                                      ((to_MvPolynomial_Option Vars) Polynomial.X -
                                        (to_MvPolynomial_Option Vars) (Polynomial.C (r x))))))
                            (List.finRange (n_var - 1))).sum +
                      ((optionEquivRight F Vars) (X (some Vars.β)) *
                              ((optionEquivRight F Vars) (X (some Vars.δ)) *
                                (List.map
                                    (fun x =>
                                      (optionEquivRight F Vars)
                                          (C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.y x))) *
                                        (optionEquivRight F Vars) ((to_MvPolynomial_Option Vars) (u_stmt x)))
                                    (List.finRange n_stmt)).sum) +
                            (optionEquivRight F Vars) (X (some Vars.α)) *
                              ((optionEquivRight F Vars) (X (some Vars.δ)) *
                                (List.map
                                    (fun x =>
                                      (optionEquivRight F Vars)
                                          (C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.y x))) *
                                        (optionEquivRight F Vars) ((to_MvPolynomial_Option Vars) (v_stmt x)))
                                    (List.finRange n_stmt)).sum) +
                          (optionEquivRight F Vars) (X (some Vars.δ)) *
                            (List.map
                                (fun x =>
                                  (optionEquivRight F Vars) (C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.y x))) *
                                    (optionEquivRight F Vars) ((to_MvPolynomial_Option Vars) (w_stmt x)))
                                (List.finRange n_stmt)).sum +
                        ((optionEquivRight F Vars) (X (some Vars.β)) *
                              ((optionEquivRight F Vars) (X (some Vars.γ)) *
                                (List.map
                                    (fun x =>
                                      (optionEquivRight F Vars)
                                          (C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q x))) *
                                        (optionEquivRight F Vars) ((to_MvPolynomial_Option Vars) (u_wit x)))
                                    (List.finRange n_wit)).sum) +
                            (optionEquivRight F Vars) (X (some Vars.α)) *
                              ((optionEquivRight F Vars) (X (some Vars.γ)) *
                                (List.map
                                    (fun x =>
                                      (optionEquivRight F Vars)
                                          (C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q x))) *
                                        (optionEquivRight F Vars) ((to_MvPolynomial_Option Vars) (v_wit x)))
                                    (List.finRange n_wit)).sum) +
                          (optionEquivRight F Vars) (X (some Vars.γ)) *
                            (List.map
                                (fun x =>
                                  (optionEquivRight F Vars) (C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q x))) *
                                    (optionEquivRight F Vars) ((to_MvPolynomial_Option Vars) (w_wit x)))
                                (List.finRange n_wit)).sum))))))) *
            ((optionEquivRight F Vars) (X (some Vars.γ)) *
              ((optionEquivRight F Vars) (X (some Vars.δ)) * (optionEquivRight F Vars) (X (some Vars.δ)))))) =
    0
⊢ ((List.map (fun i => Polynomial.C (stmt i) * u_stmt i) (List.finRange n_stmt)).sum +
        (List.map (fun i => Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q i)) * u_wit i)
            (List.finRange n_wit)).sum) *
      ((List.map (fun i => Polynomial.C (stmt i) * v_stmt i) (List.finRange n_stmt)).sum +
        (List.map (fun i => Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q i)) * v_wit i)
            (List.finRange n_wit)).sum) =
    (List.map (fun i => Polynomial.C (stmt i) * w_stmt i) (List.finRange n_stmt)).sum +
        (List.map (fun i => Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q i)) * w_wit i)
            (List.finRange n_wit)).sum +
      (List.map
          (fun x =>
            Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.x_pow_times_t x)) * (Polynomial.X ^ ↑x * t))
          (List.finRange (n_var - 1))).sum
Tactic:
simp only [optionEquivRight_C, optionEquivRight_X_none, optionEquivRight_X_some, optionEquivRight_to_MvPolynomial_Option] at eqn
State after:
case intro
F : Type
inst✝ : Field F
n_stmt n_wit n_var : ℕ
u_stmt : Fin n_stmt → Polynomial F
u_wit : Fin n_wit → Polynomial F
v_stmt : Fin n_stmt → Polynomial F
v_wit : Fin n_wit → Polynomial F
w_stmt : Fin n_stmt → Polynomial F
w_wit : Fin n_wit → Polynomial F
r : Fin n_wit → F
stmt : Groth16TypeIII.Stmt
prover : Prover F Groth16TypeIII
t : Polynomial F := ∏ i : Fin n_wit, (Polynomial.X - Polynomial.C (r i))
eqn :
  (X Vars.γ * (X Vars.δ * (X Vars.α * C (Polynomial.C (prover.1 Proof_G1_Idx.A SRS_Elements_G1_Idx.α)))) +
          (X Vars.γ * (X Vars.δ * (X Vars.β * C (Polynomial.C (prover.1 Proof_G1_Idx.A SRS_Elements_G1_Idx.β)))) +
            (X Vars.γ * (X Vars.δ * (X Vars.δ * C (Polynomial.C (prover.1 Proof_G1_Idx.A SRS_Elements_G1_Idx.δ)))) +
              (X Vars.γ *
                  (X Vars.δ *
                    (List.map
                        (fun x =>
                          C (Polynomial.C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.x_pow x))) *
                            C Polynomial.X ^ ↑x)
                        (List.finRange n_var)).sum) +
                (X Vars.γ *
                    (List.map
                        (fun x =>
                          C (Polynomial.C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.x_pow_times_t x))) *
                            (C Polynomial.X ^ ↑x *
                              (optionEquivRight F Vars)
                                (∏ x : Fin n_wit,
                                  ((to_MvPolynomial_Option Vars) Polynomial.X -
                                    (to_MvPolynomial_Option Vars) (Polynomial.C (r x))))))
                        (List.finRange (n_var - 1))).sum +
                  (X Vars.β *
                          (X Vars.δ *
                            (List.map
                                (fun x =>
                                  C (Polynomial.C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.y x))) * C (u_stmt x))
                                (List.finRange n_stmt)).sum) +
                        X Vars.α *
                          (X Vars.δ *
                            (List.map
                                (fun x =>
                                  C (Polynomial.C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.y x))) * C (v_stmt x))
                                (List.finRange n_stmt)).sum) +
                      X Vars.δ *
                        (List.map
                            (fun x =>
                              C (Polynomial.C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.y x))) * C (w_stmt x))
                            (List.finRange n_stmt)).sum +
                    (X Vars.β *
                          (X Vars.γ *
                            (List.map
                                (fun x =>
                                  C (Polynomial.C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.q x))) * C (u_wit x))
                                (List.finRange n_wit)).sum) +
                        X Vars.α *
                          (X Vars.γ *
                            (List.map
                                (fun x =>
                                  C (Polynomial.C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.q x))) * C (v_wit x))
                                (List.finRange n_wit)).sum) +
                      X Vars.γ *
                        (List.map
                            (fun x =>
                              C (Polynomial.C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.q x))) * C (w_wit x))
                            (List.finRange n_wit)).sum))))))) *
        (-(X Vars.γ *
                  (X Vars.δ *
                    (List.map
                        (fun x =>
                          C (Polynomial.C (prover.2 Proof_G2_Idx.B (SRS_Elements_G2_Idx.x_pow x))) *
                            C Polynomial.X ^ ↑x)
                        (List.finRange n_var)).sum)) +
              -(X Vars.γ * (X Vars.δ * (X Vars.δ * C (Polynomial.C (prover.2 Proof_G2_Idx.B SRS_Elements_G2_Idx.δ))))) +
            -(X Vars.γ * (X Vars.δ * (X Vars.γ * C (Polynomial.C (prover.2 Proof_G2_Idx.B SRS_Elements_G2_Idx.γ))))) +
          -(X Vars.γ * (X Vars.δ * (X Vars.β * C (Polynomial.C (prover.2 Proof_G2_Idx.B SRS_Elements_G2_Idx.β)))))) +
      (X Vars.γ * (X Vars.δ * (X Vars.α * (X Vars.γ * (X Vars.δ * X Vars.β)))) +
        ((X Vars.β *
                  (X Vars.δ *
                    (List.map (fun x => C (Polynomial.C (stmt x)) * C (u_stmt x)) (List.finRange n_stmt)).sum) +
                X Vars.α *
                  (X Vars.δ *
                    (List.map (fun x => C (Polynomial.C (stmt x)) * C (v_stmt x)) (List.finRange n_stmt)).sum) +
              X Vars.δ * (List.map (fun x => C (Polynomial.C (stmt x)) * C (w_stmt x)) (List.finRange n_stmt)).sum) *
            (X Vars.γ * (X Vars.δ * X Vars.γ)) +
          (X Vars.γ * (X Vars.δ * (X Vars.α * C (Polynomial.C (prover.1 Proof_G1_Idx.C SRS_Elements_G1_Idx.α)))) +
              (X Vars.γ * (X Vars.δ * (X Vars.β * C (Polynomial.C (prover.1 Proof_G1_Idx.C SRS_Elements_G1_Idx.β)))) +
                (X Vars.γ * (X Vars.δ * (X Vars.δ * C (Polynomial.C (prover.1 Proof_G1_Idx.C SRS_Elements_G1_Idx.δ)))) +
                  (X Vars.γ *
                      (X Vars.δ *
                        (List.map
                            (fun x =>
                              C (Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.x_pow x))) *
                                C Polynomial.X ^ ↑x)
                            (List.finRange n_var)).sum) +
                    (X Vars.γ *
                        (List.map
                            (fun x =>
                              C (Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.x_pow_times_t x))) *
                                (C Polynomial.X ^ ↑x *
                                  (optionEquivRight F Vars)
                                    (∏ x : Fin n_wit,
                                      ((to_MvPolynomial_Option Vars) Polynomial.X -
                                        (to_MvPolynomial_Option Vars) (Polynomial.C (r x))))))
                            (List.finRange (n_var - 1))).sum +
                      (X Vars.β *
                              (X Vars.δ *
                                (List.map
                                    (fun x =>
                                      C (Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.y x))) *
                                        C (u_stmt x))
                                    (List.finRange n_stmt)).sum) +
                            X Vars.α *
                              (X Vars.δ *
                                (List.map
                                    (fun x =>
                                      C (Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.y x))) *
                                        C (v_stmt x))
                                    (List.finRange n_stmt)).sum) +
                          X Vars.δ *
                            (List.map
                                (fun x =>
                                  C (Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.y x))) * C (w_stmt x))
                                (List.finRange n_stmt)).sum +
                        (X Vars.β *
                              (X Vars.γ *
                                (List.map
                                    (fun x =>
                                      C (Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q x))) *
                                        C (u_wit x))
                                    (List.finRange n_wit)).sum) +
                            X Vars.α *
                              (X Vars.γ *
                                (List.map
                                    (fun x =>
                                      C (Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q x))) *
                                        C (v_wit x))
                                    (List.finRange n_wit)).sum) +
                          X Vars.γ *
                            (List.map
                                (fun x =>
                                  C (Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q x))) * C (w_wit x))
                                (List.finRange n_wit)).sum))))))) *
            (X Vars.γ * (X Vars.δ * X Vars.δ)))) =
    0
⊢ ((List.map (fun i => Polynomial.C (stmt i) * u_stmt i) (List.finRange n_stmt)).sum +
        (List.map (fun i => Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q i)) * u_wit i)
            (List.finRange n_wit)).sum) *
      ((List.map (fun i => Polynomial.C (stmt i) * v_stmt i) (List.finRange n_stmt)).sum +
        (List.map (fun i => Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q i)) * v_wit i)
            (List.finRange n_wit)).sum) =
    (List.map (fun i => Polynomial.C (stmt i) * w_stmt i) (List.finRange n_stmt)).sum +
        (List.map (fun i => Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q i)) * w_wit i)
            (List.finRange n_wit)).sum +
      (List.map
          (fun x =>
            Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.x_pow_times_t x)) * (Polynomial.X ^ ↑x * t))
          (List.finRange (n_var - 1))).sum

State before:
case intro
F : Type
inst✝ : Field F
n_stmt n_wit n_var : ℕ
u_stmt : Fin n_stmt → Polynomial F
u_wit : Fin n_wit → Polynomial F
v_stmt : Fin n_stmt → Polynomial F
v_wit : Fin n_wit → Polynomial F
w_stmt : Fin n_stmt → Polynomial F
w_wit : Fin n_wit → Polynomial F
r : Fin n_wit → F
stmt : Groth16TypeIII.Stmt
prover : Prover F Groth16TypeIII
t : Polynomial F := ∏ i : Fin n_wit, (Polynomial.X - Polynomial.C (r i))
eqn :
  (X Vars.γ * (X Vars.δ * (X Vars.α * C (Polynomial.C (prover.1 Proof_G1_Idx.A SRS_Elements_G1_Idx.α)))) +
          (X Vars.γ * (X Vars.δ * (X Vars.β * C (Polynomial.C (prover.1 Proof_G1_Idx.A SRS_Elements_G1_Idx.β)))) +
            (X Vars.γ * (X Vars.δ * (X Vars.δ * C (Polynomial.C (prover.1 Proof_G1_Idx.A SRS_Elements_G1_Idx.δ)))) +
              (X Vars.γ *
                  (X Vars.δ *
                    (List.map
                        (fun x =>
                          C (Polynomial.C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.x_pow x))) *
                            C Polynomial.X ^ ↑x)
                        (List.finRange n_var)).sum) +
                (X Vars.γ *
                    (List.map
                        (fun x =>
                          C (Polynomial.C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.x_pow_times_t x))) *
                            (C Polynomial.X ^ ↑x *
                              (optionEquivRight F Vars)
                                (∏ x : Fin n_wit,
                                  ((to_MvPolynomial_Option Vars) Polynomial.X -
                                    (to_MvPolynomial_Option Vars) (Polynomial.C (r x))))))
                        (List.finRange (n_var - 1))).sum +
                  (X Vars.β *
                          (X Vars.δ *
                            (List.map
                                (fun x =>
                                  C (Polynomial.C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.y x))) * C (u_stmt x))
                                (List.finRange n_stmt)).sum) +
                        X Vars.α *
                          (X Vars.δ *
                            (List.map
                                (fun x =>
                                  C (Polynomial.C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.y x))) * C (v_stmt x))
                                (List.finRange n_stmt)).sum) +
                      X Vars.δ *
                        (List.map
                            (fun x =>
                              C (Polynomial.C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.y x))) * C (w_stmt x))
                            (List.finRange n_stmt)).sum +
                    (X Vars.β *
                          (X Vars.γ *
                            (List.map
                                (fun x =>
                                  C (Polynomial.C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.q x))) * C (u_wit x))
                                (List.finRange n_wit)).sum) +
                        X Vars.α *
                          (X Vars.γ *
                            (List.map
                                (fun x =>
                                  C (Polynomial.C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.q x))) * C (v_wit x))
                                (List.finRange n_wit)).sum) +
                      X Vars.γ *
                        (List.map
                            (fun x =>
                              C (Polynomial.C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.q x))) * C (w_wit x))
                            (List.finRange n_wit)).sum))))))) *
        (-(X Vars.γ *
                  (X Vars.δ *
                    (List.map
                        (fun x =>
                          C (Polynomial.C (prover.2 Proof_G2_Idx.B (SRS_Elements_G2_Idx.x_pow x))) *
                            C Polynomial.X ^ ↑x)
                        (List.finRange n_var)).sum)) +
              -(X Vars.γ * (X Vars.δ * (X Vars.δ * C (Polynomial.C (prover.2 Proof_G2_Idx.B SRS_Elements_G2_Idx.δ))))) +
            -(X Vars.γ * (X Vars.δ * (X Vars.γ * C (Polynomial.C (prover.2 Proof_G2_Idx.B SRS_Elements_G2_Idx.γ))))) +
          -(X Vars.γ * (X Vars.δ * (X Vars.β * C (Polynomial.C (prover.2 Proof_G2_Idx.B SRS_Elements_G2_Idx.β)))))) +
      (X Vars.γ * (X Vars.δ * (X Vars.α * (X Vars.γ * (X Vars.δ * X Vars.β)))) +
        ((X Vars.β *
                  (X Vars.δ *
                    (List.map (fun x => C (Polynomial.C (stmt x)) * C (u_stmt x)) (List.finRange n_stmt)).sum) +
                X Vars.α *
                  (X Vars.δ *
                    (List.map (fun x => C (Polynomial.C (stmt x)) * C (v_stmt x)) (List.finRange n_stmt)).sum) +
              X Vars.δ * (List.map (fun x => C (Polynomial.C (stmt x)) * C (w_stmt x)) (List.finRange n_stmt)).sum) *
            (X Vars.γ * (X Vars.δ * X Vars.γ)) +
          (X Vars.γ * (X Vars.δ * (X Vars.α * C (Polynomial.C (prover.1 Proof_G1_Idx.C SRS_Elements_G1_Idx.α)))) +
              (X Vars.γ * (X Vars.δ * (X Vars.β * C (Polynomial.C (prover.1 Proof_G1_Idx.C SRS_Elements_G1_Idx.β)))) +
                (X Vars.γ * (X Vars.δ * (X Vars.δ * C (Polynomial.C (prover.1 Proof_G1_Idx.C SRS_Elements_G1_Idx.δ)))) +
                  (X Vars.γ *
                      (X Vars.δ *
                        (List.map
                            (fun x =>
                              C (Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.x_pow x))) *
                                C Polynomial.X ^ ↑x)
                            (List.finRange n_var)).sum) +
                    (X Vars.γ *
                        (List.map
                            (fun x =>
                              C (Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.x_pow_times_t x))) *
                                (C Polynomial.X ^ ↑x *
                                  (optionEquivRight F Vars)
                                    (∏ x : Fin n_wit,
                                      ((to_MvPolynomial_Option Vars) Polynomial.X -
                                        (to_MvPolynomial_Option Vars) (Polynomial.C (r x))))))
                            (List.finRange (n_var - 1))).sum +
                      (X Vars.β *
                              (X Vars.δ *
                                (List.map
                                    (fun x =>
                                      C (Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.y x))) *
                                        C (u_stmt x))
                                    (List.finRange n_stmt)).sum) +
                            X Vars.α *
                              (X Vars.δ *
                                (List.map
                                    (fun x =>
                                      C (Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.y x))) *
                                        C (v_stmt x))
                                    (List.finRange n_stmt)).sum) +
                          X Vars.δ *
                            (List.map
                                (fun x =>
                                  C (Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.y x))) * C (w_stmt x))
                                (List.finRange n_stmt)).sum +
                        (X Vars.β *
                              (X Vars.γ *
                                (List.map
                                    (fun x =>
                                      C (Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q x))) *
                                        C (u_wit x))
                                    (List.finRange n_wit)).sum) +
                            X Vars.α *
                              (X Vars.γ *
                                (List.map
                                    (fun x =>
                                      C (Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q x))) *
                                        C (v_wit x))
                                    (List.finRange n_wit)).sum) +
                          X Vars.γ *
                            (List.map
                                (fun x =>
                                  C (Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q x))) * C (w_wit x))
                                (List.finRange n_wit)).sum))))))) *
            (X Vars.γ * (X Vars.δ * X Vars.δ)))) =
    0
⊢ ((List.map (fun i => Polynomial.C (stmt i) * u_stmt i) (List.finRange n_stmt)).sum +
        (List.map (fun i => Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q i)) * u_wit i)
            (List.finRange n_wit)).sum) *
      ((List.map (fun i => Polynomial.C (stmt i) * v_stmt i) (List.finRange n_stmt)).sum +
        (List.map (fun i => Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q i)) * v_wit i)
            (List.finRange n_wit)).sum) =
    (List.map (fun i => Polynomial.C (stmt i) * w_stmt i) (List.finRange n_stmt)).sum +
        (List.map (fun i => Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q i)) * w_wit i)
            (List.finRange n_wit)).sum +
      (List.map
          (fun x =>
            Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.x_pow_times_t x)) * (Polynomial.X ^ ↑x * t))
          (List.finRange (n_var - 1))).sum
Tactic:
simp only [←C_mul, ←C_pow, ←C_add,
  sum_map_C] at eqn
State after:
case intro
F : Type
inst✝ : Field F
n_stmt n_wit n_var : ℕ
u_stmt : Fin n_stmt → Polynomial F
u_wit : Fin n_wit → Polynomial F
v_stmt : Fin n_stmt → Polynomial F
v_wit : Fin n_wit → Polynomial F
w_stmt : Fin n_stmt → Polynomial F
w_wit : Fin n_wit → Polynomial F
r : Fin n_wit → F
stmt : Groth16TypeIII.Stmt
prover : Prover F Groth16TypeIII
t : Polynomial F := ∏ i : Fin n_wit, (Polynomial.X - Polynomial.C (r i))
eqn :
  (X Vars.γ * (X Vars.δ * (X Vars.α * C (Polynomial.C (prover.1 Proof_G1_Idx.A SRS_Elements_G1_Idx.α)))) +
          (X Vars.γ * (X Vars.δ * (X Vars.β * C (Polynomial.C (prover.1 Proof_G1_Idx.A SRS_Elements_G1_Idx.β)))) +
            (X Vars.γ * (X Vars.δ * (X Vars.δ * C (Polynomial.C (prover.1 Proof_G1_Idx.A SRS_Elements_G1_Idx.δ)))) +
              (X Vars.γ *
                  (X Vars.δ *
                    C
                      (List.map
                          (fun x =>
                            Polynomial.C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.x_pow x)) * Polynomial.X ^ ↑x)
                          (List.finRange n_var)).sum) +
                (X Vars.γ *
                    (List.map
                        (fun x =>
                          C (Polynomial.C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.x_pow_times_t x))) *
                            (C (Polynomial.X ^ ↑x) *
                              (optionEquivRight F Vars)
                                (∏ x : Fin n_wit,
                                  ((to_MvPolynomial_Option Vars) Polynomial.X -
                                    (to_MvPolynomial_Option Vars) (Polynomial.C (r x))))))
                        (List.finRange (n_var - 1))).sum +
                  (X Vars.β *
                          (X Vars.δ *
                            C
                              (List.map
                                  (fun x => Polynomial.C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.y x)) * u_stmt x)
                                  (List.finRange n_stmt)).sum) +
                        X Vars.α *
                          (X Vars.δ *
                            C
                              (List.map
                                  (fun x => Polynomial.C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.y x)) * v_stmt x)
                                  (List.finRange n_stmt)).sum) +
                      X Vars.δ *
                        C
                          (List.map
                              (fun x => Polynomial.C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.y x)) * w_stmt x)
                              (List.finRange n_stmt)).sum +
                    (X Vars.β *
                          (X Vars.γ *
                            C
                              (List.map
                                  (fun x => Polynomial.C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.q x)) * u_wit x)
                                  (List.finRange n_wit)).sum) +
                        X Vars.α *
                          (X Vars.γ *
                            C
                              (List.map
                                  (fun x => Polynomial.C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.q x)) * v_wit x)
                                  (List.finRange n_wit)).sum) +
                      X Vars.γ *
                        C
                          (List.map
                              (fun x => Polynomial.C (prover.1 Proof_G1_Idx.A (SRS_Elements_G1_Idx.q x)) * w_wit x)
                              (List.finRange n_wit)).sum))))))) *
        (-(X Vars.γ *
                  (X Vars.δ *
                    C
                      (List.map
                          (fun x =>
                            Polynomial.C (prover.2 Proof_G2_Idx.B (SRS_Elements_G2_Idx.x_pow x)) * Polynomial.X ^ ↑x)
                          (List.finRange n_var)).sum)) +
              -(X Vars.γ * (X Vars.δ * (X Vars.δ * C (Polynomial.C (prover.2 Proof_G2_Idx.B SRS_Elements_G2_Idx.δ))))) +
            -(X Vars.γ * (X Vars.δ * (X Vars.γ * C (Polynomial.C (prover.2 Proof_G2_Idx.B SRS_Elements_G2_Idx.γ))))) +
          -(X Vars.γ * (X Vars.δ * (X Vars.β * C (Polynomial.C (prover.2 Proof_G2_Idx.B SRS_Elements_G2_Idx.β)))))) +
      (X Vars.γ * (X Vars.δ * (X Vars.α * (X Vars.γ * (X Vars.δ * X Vars.β)))) +
        ((X Vars.β * (X Vars.δ * C (List.map (fun x => Polynomial.C (stmt x) * u_stmt x) (List.finRange n_stmt)).sum) +
                X Vars.α *
                  (X Vars.δ * C (List.map (fun x => Polynomial.C (stmt x) * v_stmt x) (List.finRange n_stmt)).sum) +
              X Vars.δ * C (List.map (fun x => Polynomial.C (stmt x) * w_stmt x) (List.finRange n_stmt)).sum) *
            (X Vars.γ * (X Vars.δ * X Vars.γ)) +
          (X Vars.γ * (X Vars.δ * (X Vars.α * C (Polynomial.C (prover.1 Proof_G1_Idx.C SRS_Elements_G1_Idx.α)))) +
              (X Vars.γ * (X Vars.δ * (X Vars.β * C (Polynomial.C (prover.1 Proof_G1_Idx.C SRS_Elements_G1_Idx.β)))) +
                (X Vars.γ * (X Vars.δ * (X Vars.δ * C (Polynomial.C (prover.1 Proof_G1_Idx.C SRS_Elements_G1_Idx.δ)))) +
                  (X Vars.γ *
                      (X Vars.δ *
                        C
                          (List.map
                              (fun x =>
                                Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.x_pow x)) *
                                  Polynomial.X ^ ↑x)
                              (List.finRange n_var)).sum) +
                    (X Vars.γ *
                        (List.map
                            (fun x =>
                              C (Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.x_pow_times_t x))) *
                                (C (Polynomial.X ^ ↑x) *
                                  (optionEquivRight F Vars)
                                    (∏ x : Fin n_wit,
                                      ((to_MvPolynomial_Option Vars) Polynomial.X -
                                        (to_MvPolynomial_Option Vars) (Polynomial.C (r x))))))
                            (List.finRange (n_var - 1))).sum +
                      (X Vars.β *
                              (X Vars.δ *
                                C
                                  (List.map
                                      (fun x =>
                                        Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.y x)) * u_stmt x)
                                      (List.finRange n_stmt)).sum) +
                            X Vars.α *
                              (X Vars.δ *
                                C
                                  (List.map
                                      (fun x =>
                                        Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.y x)) * v_stmt x)
                                      (List.finRange n_stmt)).sum) +
                          X Vars.δ *
                            C
                              (List.map
                                  (fun x => Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.y x)) * w_stmt x)
                                  (List.finRange n_stmt)).sum +
                        (X Vars.β *
                              (X Vars.γ *
                                C
                                  (List.map
                                      (fun x =>
                                        Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q x)) * u_wit x)
                                      (List.finRange n_wit)).sum) +
                            X Vars.α *
                              (X Vars.γ *
                                C
                                  (List.map
                                      (fun x =>
                                        Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q x)) * v_wit x)
                                      (List.finRange n_wit)).sum) +
                          X Vars.γ *
                            C
                              (List.map
                                  (fun x => Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q x)) * w_wit x)
                                  (List.finRange n_wit)).sum))))))) *
            (X Vars.γ * (X Vars.δ * X Vars.δ)))) =
    0
⊢ ((List.map (fun i => Polynomial.C (stmt i) * u_stmt i) (List.finRange n_stmt)).sum +
        (List.map (fun i => Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q i)) * u_wit i)
            (List.finRange n_wit)).sum) *
      ((List.map (fun i => Polynomial.C (stmt i) * v_stmt i) (List.finRange n_stmt)).sum +
        (List.map (fun i => Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q i)) * v_wit i)
            (List.finRange n_wit)).sum) =
    (List.map (fun i => Polynomial.C (stmt i) * w_stmt i) (List.finRange n_stmt)).sum +
        (List.map (fun i => Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q i)) * w_wit i)
            (List.finRange n_wit)).sum +
      (List.map
          (fun x =>
            Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.x_pow_times_t x)) * (Polynomial.X ^ ↑x * t))
          (List.finRange (n_var - 1))).sum