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

State before:
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 :
  (List.map
        (fun pairing =>
          ((List.map
                  (fun pf_elem =>
                    C (Groth16TypeIII.verificationPairingProof_G1 stmt () pairing pf_elem) *
                      (List.map
                          (fun SRS_elem => C (prover.1 pf_elem SRS_elem) * Groth16TypeIII.SRSElementValue_G1 SRS_elem)
                          Groth16TypeIII.ListSRSElements_G1).sum)
                  Groth16TypeIII.ListProof_G1).sum +
              (List.map
                  (fun SRS_elem =>
                    C (Groth16TypeIII.verificationPairingSRS_G1 stmt () pairing SRS_elem) *
                      Groth16TypeIII.SRSElementValue_G1 SRS_elem)
                  Groth16TypeIII.ListSRSElements_G1).sum) *
            ((List.map
                  (fun pf_elem =>
                    C (Groth16TypeIII.verificationPairingProof_G2 stmt () pairing pf_elem) *
                      (List.map
                          (fun SRS_elem => C (prover.2 pf_elem SRS_elem) * Groth16TypeIII.SRSElementValue_G2 SRS_elem)
                          Groth16TypeIII.ListSRSElements_G2).sum)
                  Groth16TypeIII.ListProof_G2).sum +
              (List.map
                  (fun SRS_elem =>
                    C (Groth16TypeIII.verificationPairingSRS_G2 stmt () pairing SRS_elem) *
                      Groth16TypeIII.SRSElementValue_G2 SRS_elem)
                  Groth16TypeIII.ListSRSElements_G2).sum))
        (Groth16TypeIII.ListPairings ())).sum =
    0
this :
  ((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
⊢ (((List.map (fun i => Polynomial.C (stmt i) * u_stmt i) (List.finRange n_stmt)).sum +
              (List.map
                  (fun i =>
                    Polynomial.C ((fun prover i => prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q i)) prover 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 ((fun prover i => prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q i)) prover 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 ((fun prover i => prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q i)) prover i) * w_wit i)
                (List.finRange n_wit)).sum)).modByMonic
      t =
    0
Tactic:
rw [<-sub_eq_iff_eq_add'] at this
State after:
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 :
  (List.map
        (fun pairing =>
          ((List.map
                  (fun pf_elem =>
                    C (Groth16TypeIII.verificationPairingProof_G1 stmt () pairing pf_elem) *
                      (List.map
                          (fun SRS_elem => C (prover.1 pf_elem SRS_elem) * Groth16TypeIII.SRSElementValue_G1 SRS_elem)
                          Groth16TypeIII.ListSRSElements_G1).sum)
                  Groth16TypeIII.ListProof_G1).sum +
              (List.map
                  (fun SRS_elem =>
                    C (Groth16TypeIII.verificationPairingSRS_G1 stmt () pairing SRS_elem) *
                      Groth16TypeIII.SRSElementValue_G1 SRS_elem)
                  Groth16TypeIII.ListSRSElements_G1).sum) *
            ((List.map
                  (fun pf_elem =>
                    C (Groth16TypeIII.verificationPairingProof_G2 stmt () pairing pf_elem) *
                      (List.map
                          (fun SRS_elem => C (prover.2 pf_elem SRS_elem) * Groth16TypeIII.SRSElementValue_G2 SRS_elem)
                          Groth16TypeIII.ListSRSElements_G2).sum)
                  Groth16TypeIII.ListProof_G2).sum +
              (List.map
                  (fun SRS_elem =>
                    C (Groth16TypeIII.verificationPairingSRS_G2 stmt () pairing SRS_elem) *
                      Groth16TypeIII.SRSElementValue_G2 SRS_elem)
                  Groth16TypeIII.ListSRSElements_G2).sum))
        (Groth16TypeIII.ListPairings ())).sum =
    0
this :
  ((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
⊢ (((List.map (fun i => Polynomial.C (stmt i) * u_stmt i) (List.finRange n_stmt)).sum +
              (List.map
                  (fun i =>
                    Polynomial.C ((fun prover i => prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q i)) prover 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 ((fun prover i => prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q i)) prover 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 ((fun prover i => prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q i)) prover i) * w_wit i)
                (List.finRange n_wit)).sum)).modByMonic
      t =
    0

State before:
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 :
  (List.map
        (fun pairing =>
          ((List.map
                  (fun pf_elem =>
                    C (Groth16TypeIII.verificationPairingProof_G1 stmt () pairing pf_elem) *
                      (List.map
                          (fun SRS_elem => C (prover.1 pf_elem SRS_elem) * Groth16TypeIII.SRSElementValue_G1 SRS_elem)
                          Groth16TypeIII.ListSRSElements_G1).sum)
                  Groth16TypeIII.ListProof_G1).sum +
              (List.map
                  (fun SRS_elem =>
                    C (Groth16TypeIII.verificationPairingSRS_G1 stmt () pairing SRS_elem) *
                      Groth16TypeIII.SRSElementValue_G1 SRS_elem)
                  Groth16TypeIII.ListSRSElements_G1).sum) *
            ((List.map
                  (fun pf_elem =>
                    C (Groth16TypeIII.verificationPairingProof_G2 stmt () pairing pf_elem) *
                      (List.map
                          (fun SRS_elem => C (prover.2 pf_elem SRS_elem) * Groth16TypeIII.SRSElementValue_G2 SRS_elem)
                          Groth16TypeIII.ListSRSElements_G2).sum)
                  Groth16TypeIII.ListProof_G2).sum +
              (List.map
                  (fun SRS_elem =>
                    C (Groth16TypeIII.verificationPairingSRS_G2 stmt () pairing SRS_elem) *
                      Groth16TypeIII.SRSElementValue_G2 SRS_elem)
                  Groth16TypeIII.ListSRSElements_G2).sum))
        (Groth16TypeIII.ListPairings ())).sum =
    0
this :
  ((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
⊢ (((List.map (fun i => Polynomial.C (stmt i) * u_stmt i) (List.finRange n_stmt)).sum +
              (List.map
                  (fun i =>
                    Polynomial.C ((fun prover i => prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q i)) prover 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 ((fun prover i => prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q i)) prover 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 ((fun prover i => prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q i)) prover i) * w_wit i)
                (List.finRange n_wit)).sum)).modByMonic
      t =
    0
Tactic:
have h := congr_arg (fun x => x %ₘ t) this
State after:
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 :
  (List.map
        (fun pairing =>
          ((List.map
                  (fun pf_elem =>
                    C (Groth16TypeIII.verificationPairingProof_G1 stmt () pairing pf_elem) *
                      (List.map
                          (fun SRS_elem => C (prover.1 pf_elem SRS_elem) * Groth16TypeIII.SRSElementValue_G1 SRS_elem)
                          Groth16TypeIII.ListSRSElements_G1).sum)
                  Groth16TypeIII.ListProof_G1).sum +
              (List.map
                  (fun SRS_elem =>
                    C (Groth16TypeIII.verificationPairingSRS_G1 stmt () pairing SRS_elem) *
                      Groth16TypeIII.SRSElementValue_G1 SRS_elem)
                  Groth16TypeIII.ListSRSElements_G1).sum) *
            ((List.map
                  (fun pf_elem =>
                    C (Groth16TypeIII.verificationPairingProof_G2 stmt () pairing pf_elem) *
                      (List.map
                          (fun SRS_elem => C (prover.2 pf_elem SRS_elem) * Groth16TypeIII.SRSElementValue_G2 SRS_elem)
                          Groth16TypeIII.ListSRSElements_G2).sum)
                  Groth16TypeIII.ListProof_G2).sum +
              (List.map
                  (fun SRS_elem =>
                    C (Groth16TypeIII.verificationPairingSRS_G2 stmt () pairing SRS_elem) *
                      Groth16TypeIII.SRSElementValue_G2 SRS_elem)
                  Groth16TypeIII.ListSRSElements_G2).sum))
        (Groth16TypeIII.ListPairings ())).sum =
    0
this :
  ((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
h :
  (fun x => x.modByMonic t)
      (((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)) =
    (fun x => x.modByMonic t)
      (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
⊢ (((List.map (fun i => Polynomial.C (stmt i) * u_stmt i) (List.finRange n_stmt)).sum +
              (List.map
                  (fun i =>
                    Polynomial.C ((fun prover i => prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q i)) prover 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 ((fun prover i => prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q i)) prover 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 ((fun prover i => prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q i)) prover i) * w_wit i)
                (List.finRange n_wit)).sum)).modByMonic
      t =
    0

State before:
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 :
  (List.map
        (fun pairing =>
          ((List.map
                  (fun pf_elem =>
                    C (Groth16TypeIII.verificationPairingProof_G1 stmt () pairing pf_elem) *
                      (List.map
                          (fun SRS_elem => C (prover.1 pf_elem SRS_elem) * Groth16TypeIII.SRSElementValue_G1 SRS_elem)
                          Groth16TypeIII.ListSRSElements_G1).sum)
                  Groth16TypeIII.ListProof_G1).sum +
              (List.map
                  (fun SRS_elem =>
                    C (Groth16TypeIII.verificationPairingSRS_G1 stmt () pairing SRS_elem) *
                      Groth16TypeIII.SRSElementValue_G1 SRS_elem)
                  Groth16TypeIII.ListSRSElements_G1).sum) *
            ((List.map
                  (fun pf_elem =>
                    C (Groth16TypeIII.verificationPairingProof_G2 stmt () pairing pf_elem) *
                      (List.map
                          (fun SRS_elem => C (prover.2 pf_elem SRS_elem) * Groth16TypeIII.SRSElementValue_G2 SRS_elem)
                          Groth16TypeIII.ListSRSElements_G2).sum)
                  Groth16TypeIII.ListProof_G2).sum +
              (List.map
                  (fun SRS_elem =>
                    C (Groth16TypeIII.verificationPairingSRS_G2 stmt () pairing SRS_elem) *
                      Groth16TypeIII.SRSElementValue_G2 SRS_elem)
                  Groth16TypeIII.ListSRSElements_G2).sum))
        (Groth16TypeIII.ListPairings ())).sum =
    0
this :
  ((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
h :
  (fun x => x.modByMonic t)
      (((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)) =
    (fun x => x.modByMonic t)
      (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
⊢ (((List.map (fun i => Polynomial.C (stmt i) * u_stmt i) (List.finRange n_stmt)).sum +
              (List.map
                  (fun i =>
                    Polynomial.C ((fun prover i => prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q i)) prover 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 ((fun prover i => prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q i)) prover 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 ((fun prover i => prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q i)) prover i) * w_wit i)
                (List.finRange n_wit)).sum)).modByMonic
      t =
    0
Tactic:
simp only at h
State after:
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 :
  (List.map
        (fun pairing =>
          ((List.map
                  (fun pf_elem =>
                    C (Groth16TypeIII.verificationPairingProof_G1 stmt () pairing pf_elem) *
                      (List.map
                          (fun SRS_elem => C (prover.1 pf_elem SRS_elem) * Groth16TypeIII.SRSElementValue_G1 SRS_elem)
                          Groth16TypeIII.ListSRSElements_G1).sum)
                  Groth16TypeIII.ListProof_G1).sum +
              (List.map
                  (fun SRS_elem =>
                    C (Groth16TypeIII.verificationPairingSRS_G1 stmt () pairing SRS_elem) *
                      Groth16TypeIII.SRSElementValue_G1 SRS_elem)
                  Groth16TypeIII.ListSRSElements_G1).sum) *
            ((List.map
                  (fun pf_elem =>
                    C (Groth16TypeIII.verificationPairingProof_G2 stmt () pairing pf_elem) *
                      (List.map
                          (fun SRS_elem => C (prover.2 pf_elem SRS_elem) * Groth16TypeIII.SRSElementValue_G2 SRS_elem)
                          Groth16TypeIII.ListSRSElements_G2).sum)
                  Groth16TypeIII.ListProof_G2).sum +
              (List.map
                  (fun SRS_elem =>
                    C (Groth16TypeIII.verificationPairingSRS_G2 stmt () pairing SRS_elem) *
                      Groth16TypeIII.SRSElementValue_G2 SRS_elem)
                  Groth16TypeIII.ListSRSElements_G2).sum))
        (Groth16TypeIII.ListPairings ())).sum =
    0
this :
  ((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
h :
  (((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)).modByMonic
      t =
    (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.modByMonic
      t
⊢ (((List.map (fun i => Polynomial.C (stmt i) * u_stmt i) (List.finRange n_stmt)).sum +
              (List.map
                  (fun i =>
                    Polynomial.C ((fun prover i => prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q i)) prover 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 ((fun prover i => prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q i)) prover 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 ((fun prover i => prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q i)) prover i) * w_wit i)
                (List.finRange n_wit)).sum)).modByMonic
      t =
    0

State before:
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 :
  (List.map
        (fun pairing =>
          ((List.map
                  (fun pf_elem =>
                    C (Groth16TypeIII.verificationPairingProof_G1 stmt () pairing pf_elem) *
                      (List.map
                          (fun SRS_elem => C (prover.1 pf_elem SRS_elem) * Groth16TypeIII.SRSElementValue_G1 SRS_elem)
                          Groth16TypeIII.ListSRSElements_G1).sum)
                  Groth16TypeIII.ListProof_G1).sum +
              (List.map
                  (fun SRS_elem =>
                    C (Groth16TypeIII.verificationPairingSRS_G1 stmt () pairing SRS_elem) *
                      Groth16TypeIII.SRSElementValue_G1 SRS_elem)
                  Groth16TypeIII.ListSRSElements_G1).sum) *
            ((List.map
                  (fun pf_elem =>
                    C (Groth16TypeIII.verificationPairingProof_G2 stmt () pairing pf_elem) *
                      (List.map
                          (fun SRS_elem => C (prover.2 pf_elem SRS_elem) * Groth16TypeIII.SRSElementValue_G2 SRS_elem)
                          Groth16TypeIII.ListSRSElements_G2).sum)
                  Groth16TypeIII.ListProof_G2).sum +
              (List.map
                  (fun SRS_elem =>
                    C (Groth16TypeIII.verificationPairingSRS_G2 stmt () pairing SRS_elem) *
                      Groth16TypeIII.SRSElementValue_G2 SRS_elem)
                  Groth16TypeIII.ListSRSElements_G2).sum))
        (Groth16TypeIII.ListPairings ())).sum =
    0
this :
  ((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
h :
  (((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)).modByMonic
      t =
    (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.modByMonic
      t
⊢ (((List.map (fun i => Polynomial.C (stmt i) * u_stmt i) (List.finRange n_stmt)).sum +
              (List.map
                  (fun i =>
                    Polynomial.C ((fun prover i => prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q i)) prover 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 ((fun prover i => prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q i)) prover 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 ((fun prover i => prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.q i)) prover i) * w_wit i)
                (List.finRange n_wit)).sum)).modByMonic
      t =
    0
Tactic:
simp
State after:
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 :
  (List.map
        (fun pairing =>
          ((List.map
                  (fun pf_elem =>
                    C (Groth16TypeIII.verificationPairingProof_G1 stmt () pairing pf_elem) *
                      (List.map
                          (fun SRS_elem => C (prover.1 pf_elem SRS_elem) * Groth16TypeIII.SRSElementValue_G1 SRS_elem)
                          Groth16TypeIII.ListSRSElements_G1).sum)
                  Groth16TypeIII.ListProof_G1).sum +
              (List.map
                  (fun SRS_elem =>
                    C (Groth16TypeIII.verificationPairingSRS_G1 stmt () pairing SRS_elem) *
                      Groth16TypeIII.SRSElementValue_G1 SRS_elem)
                  Groth16TypeIII.ListSRSElements_G1).sum) *
            ((List.map
                  (fun pf_elem =>
                    C (Groth16TypeIII.verificationPairingProof_G2 stmt () pairing pf_elem) *
                      (List.map
                          (fun SRS_elem => C (prover.2 pf_elem SRS_elem) * Groth16TypeIII.SRSElementValue_G2 SRS_elem)
                          Groth16TypeIII.ListSRSElements_G2).sum)
                  Groth16TypeIII.ListProof_G2).sum +
              (List.map
                  (fun SRS_elem =>
                    C (Groth16TypeIII.verificationPairingSRS_G2 stmt () pairing SRS_elem) *
                      Groth16TypeIII.SRSElementValue_G2 SRS_elem)
                  Groth16TypeIII.ListSRSElements_G2).sum))
        (Groth16TypeIII.ListPairings ())).sum =
    0
this :
  ((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
h :
  (((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)).modByMonic
      t =
    (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.modByMonic
      t
⊢ (((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)).modByMonic
      t =
    0

State before:
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 :
  (List.map
        (fun pairing =>
          ((List.map
                  (fun pf_elem =>
                    C (Groth16TypeIII.verificationPairingProof_G1 stmt () pairing pf_elem) *
                      (List.map
                          (fun SRS_elem => C (prover.1 pf_elem SRS_elem) * Groth16TypeIII.SRSElementValue_G1 SRS_elem)
                          Groth16TypeIII.ListSRSElements_G1).sum)
                  Groth16TypeIII.ListProof_G1).sum +
              (List.map
                  (fun SRS_elem =>
                    C (Groth16TypeIII.verificationPairingSRS_G1 stmt () pairing SRS_elem) *
                      Groth16TypeIII.SRSElementValue_G1 SRS_elem)
                  Groth16TypeIII.ListSRSElements_G1).sum) *
            ((List.map
                  (fun pf_elem =>
                    C (Groth16TypeIII.verificationPairingProof_G2 stmt () pairing pf_elem) *
                      (List.map
                          (fun SRS_elem => C (prover.2 pf_elem SRS_elem) * Groth16TypeIII.SRSElementValue_G2 SRS_elem)
                          Groth16TypeIII.ListSRSElements_G2).sum)
                  Groth16TypeIII.ListProof_G2).sum +
              (List.map
                  (fun SRS_elem =>
                    C (Groth16TypeIII.verificationPairingSRS_G2 stmt () pairing SRS_elem) *
                      Groth16TypeIII.SRSElementValue_G2 SRS_elem)
                  Groth16TypeIII.ListSRSElements_G2).sum))
        (Groth16TypeIII.ListPairings ())).sum =
    0
this :
  ((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
h :
  (((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)).modByMonic
      t =
    (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.modByMonic
      t
⊢ (((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)).modByMonic
      t =
    0
Tactic:
rw [h]
State after:
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 :
  (List.map
        (fun pairing =>
          ((List.map
                  (fun pf_elem =>
                    C (Groth16TypeIII.verificationPairingProof_G1 stmt () pairing pf_elem) *
                      (List.map
                          (fun SRS_elem => C (prover.1 pf_elem SRS_elem) * Groth16TypeIII.SRSElementValue_G1 SRS_elem)
                          Groth16TypeIII.ListSRSElements_G1).sum)
                  Groth16TypeIII.ListProof_G1).sum +
              (List.map
                  (fun SRS_elem =>
                    C (Groth16TypeIII.verificationPairingSRS_G1 stmt () pairing SRS_elem) *
                      Groth16TypeIII.SRSElementValue_G1 SRS_elem)
                  Groth16TypeIII.ListSRSElements_G1).sum) *
            ((List.map
                  (fun pf_elem =>
                    C (Groth16TypeIII.verificationPairingProof_G2 stmt () pairing pf_elem) *
                      (List.map
                          (fun SRS_elem => C (prover.2 pf_elem SRS_elem) * Groth16TypeIII.SRSElementValue_G2 SRS_elem)
                          Groth16TypeIII.ListSRSElements_G2).sum)
                  Groth16TypeIII.ListProof_G2).sum +
              (List.map
                  (fun SRS_elem =>
                    C (Groth16TypeIII.verificationPairingSRS_G2 stmt () pairing SRS_elem) *
                      Groth16TypeIII.SRSElementValue_G2 SRS_elem)
                  Groth16TypeIII.ListSRSElements_G2).sum))
        (Groth16TypeIII.ListPairings ())).sum =
    0
this :
  ((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
h :
  (((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)).modByMonic
      t =
    (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.modByMonic
      t
⊢ (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.modByMonic
      t =
    0

State before:
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 :
  (List.map
        (fun pairing =>
          ((List.map
                  (fun pf_elem =>
                    C (Groth16TypeIII.verificationPairingProof_G1 stmt () pairing pf_elem) *
                      (List.map
                          (fun SRS_elem => C (prover.1 pf_elem SRS_elem) * Groth16TypeIII.SRSElementValue_G1 SRS_elem)
                          Groth16TypeIII.ListSRSElements_G1).sum)
                  Groth16TypeIII.ListProof_G1).sum +
              (List.map
                  (fun SRS_elem =>
                    C (Groth16TypeIII.verificationPairingSRS_G1 stmt () pairing SRS_elem) *
                      Groth16TypeIII.SRSElementValue_G1 SRS_elem)
                  Groth16TypeIII.ListSRSElements_G1).sum) *
            ((List.map
                  (fun pf_elem =>
                    C (Groth16TypeIII.verificationPairingProof_G2 stmt () pairing pf_elem) *
                      (List.map
                          (fun SRS_elem => C (prover.2 pf_elem SRS_elem) * Groth16TypeIII.SRSElementValue_G2 SRS_elem)
                          Groth16TypeIII.ListSRSElements_G2).sum)
                  Groth16TypeIII.ListProof_G2).sum +
              (List.map
                  (fun SRS_elem =>
                    C (Groth16TypeIII.verificationPairingSRS_G2 stmt () pairing SRS_elem) *
                      Groth16TypeIII.SRSElementValue_G2 SRS_elem)
                  Groth16TypeIII.ListSRSElements_G2).sum))
        (Groth16TypeIII.ListPairings ())).sum =
    0
this :
  ((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
h :
  (((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)).modByMonic
      t =
    (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.modByMonic
      t
⊢ (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.modByMonic
      t =
    0
Tactic:
clear this h
State after:
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 :
  (List.map
        (fun pairing =>
          ((List.map
                  (fun pf_elem =>
                    C (Groth16TypeIII.verificationPairingProof_G1 stmt () pairing pf_elem) *
                      (List.map
                          (fun SRS_elem => C (prover.1 pf_elem SRS_elem) * Groth16TypeIII.SRSElementValue_G1 SRS_elem)
                          Groth16TypeIII.ListSRSElements_G1).sum)
                  Groth16TypeIII.ListProof_G1).sum +
              (List.map
                  (fun SRS_elem =>
                    C (Groth16TypeIII.verificationPairingSRS_G1 stmt () pairing SRS_elem) *
                      Groth16TypeIII.SRSElementValue_G1 SRS_elem)
                  Groth16TypeIII.ListSRSElements_G1).sum) *
            ((List.map
                  (fun pf_elem =>
                    C (Groth16TypeIII.verificationPairingProof_G2 stmt () pairing pf_elem) *
                      (List.map
                          (fun SRS_elem => C (prover.2 pf_elem SRS_elem) * Groth16TypeIII.SRSElementValue_G2 SRS_elem)
                          Groth16TypeIII.ListSRSElements_G2).sum)
                  Groth16TypeIII.ListProof_G2).sum +
              (List.map
                  (fun SRS_elem =>
                    C (Groth16TypeIII.verificationPairingSRS_G2 stmt () pairing SRS_elem) *
                      Groth16TypeIII.SRSElementValue_G2 SRS_elem)
                  Groth16TypeIII.ListSRSElements_G2).sum))
        (Groth16TypeIII.ListPairings ())).sum =
    0
⊢ (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.modByMonic
      t =
    0

State before:
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 :
  (List.map
        (fun pairing =>
          ((List.map
                  (fun pf_elem =>
                    C (Groth16TypeIII.verificationPairingProof_G1 stmt () pairing pf_elem) *
                      (List.map
                          (fun SRS_elem => C (prover.1 pf_elem SRS_elem) * Groth16TypeIII.SRSElementValue_G1 SRS_elem)
                          Groth16TypeIII.ListSRSElements_G1).sum)
                  Groth16TypeIII.ListProof_G1).sum +
              (List.map
                  (fun SRS_elem =>
                    C (Groth16TypeIII.verificationPairingSRS_G1 stmt () pairing SRS_elem) *
                      Groth16TypeIII.SRSElementValue_G1 SRS_elem)
                  Groth16TypeIII.ListSRSElements_G1).sum) *
            ((List.map
                  (fun pf_elem =>
                    C (Groth16TypeIII.verificationPairingProof_G2 stmt () pairing pf_elem) *
                      (List.map
                          (fun SRS_elem => C (prover.2 pf_elem SRS_elem) * Groth16TypeIII.SRSElementValue_G2 SRS_elem)
                          Groth16TypeIII.ListSRSElements_G2).sum)
                  Groth16TypeIII.ListProof_G2).sum +
              (List.map
                  (fun SRS_elem =>
                    C (Groth16TypeIII.verificationPairingSRS_G2 stmt () pairing SRS_elem) *
                      Groth16TypeIII.SRSElementValue_G2 SRS_elem)
                  Groth16TypeIII.ListSRSElements_G2).sum))
        (Groth16TypeIII.ListPairings ())).sum =
    0
⊢ (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.modByMonic
      t =
    0
Tactic:
simp only [mul_comm _ (t), <-mul_assoc]
State after:
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 :
  (List.map
        (fun pairing =>
          ((List.map
                  (fun pf_elem =>
                    C (Groth16TypeIII.verificationPairingProof_G1 stmt () pairing pf_elem) *
                      (List.map
                          (fun SRS_elem => C (prover.1 pf_elem SRS_elem) * Groth16TypeIII.SRSElementValue_G1 SRS_elem)
                          Groth16TypeIII.ListSRSElements_G1).sum)
                  Groth16TypeIII.ListProof_G1).sum +
              (List.map
                  (fun SRS_elem =>
                    C (Groth16TypeIII.verificationPairingSRS_G1 stmt () pairing SRS_elem) *
                      Groth16TypeIII.SRSElementValue_G1 SRS_elem)
                  Groth16TypeIII.ListSRSElements_G1).sum) *
            ((List.map
                  (fun pf_elem =>
                    C (Groth16TypeIII.verificationPairingProof_G2 stmt () pairing pf_elem) *
                      (List.map
                          (fun SRS_elem => C (prover.2 pf_elem SRS_elem) * Groth16TypeIII.SRSElementValue_G2 SRS_elem)
                          Groth16TypeIII.ListSRSElements_G2).sum)
                  Groth16TypeIII.ListProof_G2).sum +
              (List.map
                  (fun SRS_elem =>
                    C (Groth16TypeIII.verificationPairingSRS_G2 stmt () pairing SRS_elem) *
                      Groth16TypeIII.SRSElementValue_G2 SRS_elem)
                  Groth16TypeIII.ListSRSElements_G2).sum))
        (Groth16TypeIII.ListPairings ())).sum =
    0
⊢ (List.map
            (fun x =>
              t * Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.x_pow_times_t x)) * Polynomial.X ^ ↑x)
            (List.finRange (n_var - 1))).sum.modByMonic
      t =
    0

State before:
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 :
  (List.map
        (fun pairing =>
          ((List.map
                  (fun pf_elem =>
                    C (Groth16TypeIII.verificationPairingProof_G1 stmt () pairing pf_elem) *
                      (List.map
                          (fun SRS_elem => C (prover.1 pf_elem SRS_elem) * Groth16TypeIII.SRSElementValue_G1 SRS_elem)
                          Groth16TypeIII.ListSRSElements_G1).sum)
                  Groth16TypeIII.ListProof_G1).sum +
              (List.map
                  (fun SRS_elem =>
                    C (Groth16TypeIII.verificationPairingSRS_G1 stmt () pairing SRS_elem) *
                      Groth16TypeIII.SRSElementValue_G1 SRS_elem)
                  Groth16TypeIII.ListSRSElements_G1).sum) *
            ((List.map
                  (fun pf_elem =>
                    C (Groth16TypeIII.verificationPairingProof_G2 stmt () pairing pf_elem) *
                      (List.map
                          (fun SRS_elem => C (prover.2 pf_elem SRS_elem) * Groth16TypeIII.SRSElementValue_G2 SRS_elem)
                          Groth16TypeIII.ListSRSElements_G2).sum)
                  Groth16TypeIII.ListProof_G2).sum +
              (List.map
                  (fun SRS_elem =>
                    C (Groth16TypeIII.verificationPairingSRS_G2 stmt () pairing SRS_elem) *
                      Groth16TypeIII.SRSElementValue_G2 SRS_elem)
                  Groth16TypeIII.ListSRSElements_G2).sum))
        (Groth16TypeIII.ListPairings ())).sum =
    0
⊢ (List.map
            (fun x =>
              t * Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.x_pow_times_t x)) * Polynomial.X ^ ↑x)
            (List.finRange (n_var - 1))).sum.modByMonic
      t =
    0
Tactic:
simp only [mul_assoc, List.sum_map_mul_right, List.sum_map_mul_left]
State after:
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 :
  (List.map
        (fun pairing =>
          ((List.map
                  (fun pf_elem =>
                    C (Groth16TypeIII.verificationPairingProof_G1 stmt () pairing pf_elem) *
                      (List.map
                          (fun SRS_elem => C (prover.1 pf_elem SRS_elem) * Groth16TypeIII.SRSElementValue_G1 SRS_elem)
                          Groth16TypeIII.ListSRSElements_G1).sum)
                  Groth16TypeIII.ListProof_G1).sum +
              (List.map
                  (fun SRS_elem =>
                    C (Groth16TypeIII.verificationPairingSRS_G1 stmt () pairing SRS_elem) *
                      Groth16TypeIII.SRSElementValue_G1 SRS_elem)
                  Groth16TypeIII.ListSRSElements_G1).sum) *
            ((List.map
                  (fun pf_elem =>
                    C (Groth16TypeIII.verificationPairingProof_G2 stmt () pairing pf_elem) *
                      (List.map
                          (fun SRS_elem => C (prover.2 pf_elem SRS_elem) * Groth16TypeIII.SRSElementValue_G2 SRS_elem)
                          Groth16TypeIII.ListSRSElements_G2).sum)
                  Groth16TypeIII.ListProof_G2).sum +
              (List.map
                  (fun SRS_elem =>
                    C (Groth16TypeIII.verificationPairingSRS_G2 stmt () pairing SRS_elem) *
                      Groth16TypeIII.SRSElementValue_G2 SRS_elem)
                  Groth16TypeIII.ListSRSElements_G2).sum))
        (Groth16TypeIII.ListPairings ())).sum =
    0
⊢ (t *
          (List.map
              (fun b =>
                Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.x_pow_times_t b)) * Polynomial.X ^ ↑b)
              (List.finRange (n_var - 1))).sum).modByMonic
      t =
    0

State before:
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 :
  (List.map
        (fun pairing =>
          ((List.map
                  (fun pf_elem =>
                    C (Groth16TypeIII.verificationPairingProof_G1 stmt () pairing pf_elem) *
                      (List.map
                          (fun SRS_elem => C (prover.1 pf_elem SRS_elem) * Groth16TypeIII.SRSElementValue_G1 SRS_elem)
                          Groth16TypeIII.ListSRSElements_G1).sum)
                  Groth16TypeIII.ListProof_G1).sum +
              (List.map
                  (fun SRS_elem =>
                    C (Groth16TypeIII.verificationPairingSRS_G1 stmt () pairing SRS_elem) *
                      Groth16TypeIII.SRSElementValue_G1 SRS_elem)
                  Groth16TypeIII.ListSRSElements_G1).sum) *
            ((List.map
                  (fun pf_elem =>
                    C (Groth16TypeIII.verificationPairingProof_G2 stmt () pairing pf_elem) *
                      (List.map
                          (fun SRS_elem => C (prover.2 pf_elem SRS_elem) * Groth16TypeIII.SRSElementValue_G2 SRS_elem)
                          Groth16TypeIII.ListSRSElements_G2).sum)
                  Groth16TypeIII.ListProof_G2).sum +
              (List.map
                  (fun SRS_elem =>
                    C (Groth16TypeIII.verificationPairingSRS_G2 stmt () pairing SRS_elem) *
                      Groth16TypeIII.SRSElementValue_G2 SRS_elem)
                  Groth16TypeIII.ListSRSElements_G2).sum))
        (Groth16TypeIII.ListPairings ())).sum =
    0
⊢ (t *
          (List.map
              (fun b =>
                Polynomial.C (prover.1 Proof_G1_Idx.C (SRS_Elements_G1_Idx.x_pow_times_t b)) * Polynomial.X ^ ↑b)
              (List.finRange (n_var - 1))).sum).modByMonic
      t =
    0
Tactic:
apply Polynomial.self_mul_modByMonic
State after:
case hq
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 :
  (List.map
        (fun pairing =>
          ((List.map
                  (fun pf_elem =>
                    C (Groth16TypeIII.verificationPairingProof_G1 stmt () pairing pf_elem) *
                      (List.map
                          (fun SRS_elem => C (prover.1 pf_elem SRS_elem) * Groth16TypeIII.SRSElementValue_G1 SRS_elem)
                          Groth16TypeIII.ListSRSElements_G1).sum)
                  Groth16TypeIII.ListProof_G1).sum +
              (List.map
                  (fun SRS_elem =>
                    C (Groth16TypeIII.verificationPairingSRS_G1 stmt () pairing SRS_elem) *
                      Groth16TypeIII.SRSElementValue_G1 SRS_elem)
                  Groth16TypeIII.ListSRSElements_G1).sum) *
            ((List.map
                  (fun pf_elem =>
                    C (Groth16TypeIII.verificationPairingProof_G2 stmt () pairing pf_elem) *
                      (List.map
                          (fun SRS_elem => C (prover.2 pf_elem SRS_elem) * Groth16TypeIII.SRSElementValue_G2 SRS_elem)
                          Groth16TypeIII.ListSRSElements_G2).sum)
                  Groth16TypeIII.ListProof_G2).sum +
              (List.map
                  (fun SRS_elem =>
                    C (Groth16TypeIII.verificationPairingSRS_G2 stmt () pairing SRS_elem) *
                      Groth16TypeIII.SRSElementValue_G2 SRS_elem)
                  Groth16TypeIII.ListSRSElements_G2).sum))
        (Groth16TypeIII.ListPairings ())).sum =
    0
⊢ t.Monic

State before:
case hq
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 :
  (List.map
        (fun pairing =>
          ((List.map
                  (fun pf_elem =>
                    C (Groth16TypeIII.verificationPairingProof_G1 stmt () pairing pf_elem) *
                      (List.map
                          (fun SRS_elem => C (prover.1 pf_elem SRS_elem) * Groth16TypeIII.SRSElementValue_G1 SRS_elem)
                          Groth16TypeIII.ListSRSElements_G1).sum)
                  Groth16TypeIII.ListProof_G1).sum +
              (List.map
                  (fun SRS_elem =>
                    C (Groth16TypeIII.verificationPairingSRS_G1 stmt () pairing SRS_elem) *
                      Groth16TypeIII.SRSElementValue_G1 SRS_elem)
                  Groth16TypeIII.ListSRSElements_G1).sum) *
            ((List.map
                  (fun pf_elem =>
                    C (Groth16TypeIII.verificationPairingProof_G2 stmt () pairing pf_elem) *
                      (List.map
                          (fun SRS_elem => C (prover.2 pf_elem SRS_elem) * Groth16TypeIII.SRSElementValue_G2 SRS_elem)
                          Groth16TypeIII.ListSRSElements_G2).sum)
                  Groth16TypeIII.ListProof_G2).sum +
              (List.map
                  (fun SRS_elem =>
                    C (Groth16TypeIII.verificationPairingSRS_G2 stmt () pairing SRS_elem) *
                      Groth16TypeIII.SRSElementValue_G2 SRS_elem)
                  Groth16TypeIII.ListSRSElements_G2).sum))
        (Groth16TypeIII.ListPairings ())).sum =
    0
⊢ t.Monic
Tactic:
apply Polynomial.monic_prod_of_monic
State after:
case hq.hs
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 :
  (List.map
        (fun pairing =>
          ((List.map
                  (fun pf_elem =>
                    C (Groth16TypeIII.verificationPairingProof_G1 stmt () pairing pf_elem) *
                      (List.map
                          (fun SRS_elem => C (prover.1 pf_elem SRS_elem) * Groth16TypeIII.SRSElementValue_G1 SRS_elem)
                          Groth16TypeIII.ListSRSElements_G1).sum)
                  Groth16TypeIII.ListProof_G1).sum +
              (List.map
                  (fun SRS_elem =>
                    C (Groth16TypeIII.verificationPairingSRS_G1 stmt () pairing SRS_elem) *
                      Groth16TypeIII.SRSElementValue_G1 SRS_elem)
                  Groth16TypeIII.ListSRSElements_G1).sum) *
            ((List.map
                  (fun pf_elem =>
                    C (Groth16TypeIII.verificationPairingProof_G2 stmt () pairing pf_elem) *
                      (List.map
                          (fun SRS_elem => C (prover.2 pf_elem SRS_elem) * Groth16TypeIII.SRSElementValue_G2 SRS_elem)
                          Groth16TypeIII.ListSRSElements_G2).sum)
                  Groth16TypeIII.ListProof_G2).sum +
              (List.map
                  (fun SRS_elem =>
                    C (Groth16TypeIII.verificationPairingSRS_G2 stmt () pairing SRS_elem) *
                      Groth16TypeIII.SRSElementValue_G2 SRS_elem)
                  Groth16TypeIII.ListSRSElements_G2).sum))
        (Groth16TypeIII.ListPairings ())).sum =
    0
⊢ ∀ i ∈ Finset.univ, (Polynomial.X - Polynomial.C (r i)).Monic

State before:
case hq.hs
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 :
  (List.map
        (fun pairing =>
          ((List.map
                  (fun pf_elem =>
                    C (Groth16TypeIII.verificationPairingProof_G1 stmt () pairing pf_elem) *
                      (List.map
                          (fun SRS_elem => C (prover.1 pf_elem SRS_elem) * Groth16TypeIII.SRSElementValue_G1 SRS_elem)
                          Groth16TypeIII.ListSRSElements_G1).sum)
                  Groth16TypeIII.ListProof_G1).sum +
              (List.map
                  (fun SRS_elem =>
                    C (Groth16TypeIII.verificationPairingSRS_G1 stmt () pairing SRS_elem) *
                      Groth16TypeIII.SRSElementValue_G1 SRS_elem)
                  Groth16TypeIII.ListSRSElements_G1).sum) *
            ((List.map
                  (fun pf_elem =>
                    C (Groth16TypeIII.verificationPairingProof_G2 stmt () pairing pf_elem) *
                      (List.map
                          (fun SRS_elem => C (prover.2 pf_elem SRS_elem) * Groth16TypeIII.SRSElementValue_G2 SRS_elem)
                          Groth16TypeIII.ListSRSElements_G2).sum)
                  Groth16TypeIII.ListProof_G2).sum +
              (List.map
                  (fun SRS_elem =>
                    C (Groth16TypeIII.verificationPairingSRS_G2 stmt () pairing SRS_elem) *
                      Groth16TypeIII.SRSElementValue_G2 SRS_elem)
                  Groth16TypeIII.ListSRSElements_G2).sum))
        (Groth16TypeIII.ListPairings ())).sum =
    0
⊢ ∀ i ∈ Finset.univ, (Polynomial.X - Polynomial.C (r i)).Monic
Tactic:
intro i hi
State after:
case hq.hs
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 :
  (List.map
        (fun pairing =>
          ((List.map
                  (fun pf_elem =>
                    C (Groth16TypeIII.verificationPairingProof_G1 stmt () pairing pf_elem) *
                      (List.map
                          (fun SRS_elem => C (prover.1 pf_elem SRS_elem) * Groth16TypeIII.SRSElementValue_G1 SRS_elem)
                          Groth16TypeIII.ListSRSElements_G1).sum)
                  Groth16TypeIII.ListProof_G1).sum +
              (List.map
                  (fun SRS_elem =>
                    C (Groth16TypeIII.verificationPairingSRS_G1 stmt () pairing SRS_elem) *
                      Groth16TypeIII.SRSElementValue_G1 SRS_elem)
                  Groth16TypeIII.ListSRSElements_G1).sum) *
            ((List.map
                  (fun pf_elem =>
                    C (Groth16TypeIII.verificationPairingProof_G2 stmt () pairing pf_elem) *
                      (List.map
                          (fun SRS_elem => C (prover.2 pf_elem SRS_elem) * Groth16TypeIII.SRSElementValue_G2 SRS_elem)
                          Groth16TypeIII.ListSRSElements_G2).sum)
                  Groth16TypeIII.ListProof_G2).sum +
              (List.map
                  (fun SRS_elem =>
                    C (Groth16TypeIII.verificationPairingSRS_G2 stmt () pairing SRS_elem) *
                      Groth16TypeIII.SRSElementValue_G2 SRS_elem)
                  Groth16TypeIII.ListSRSElements_G2).sum))
        (Groth16TypeIII.ListPairings ())).sum =
    0
i : Fin n_wit
hi : i ∈ Finset.univ
⊢ (Polynomial.X - Polynomial.C (r i)).Monic

State before:
case hq.hs
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 :
  (List.map
        (fun pairing =>
          ((List.map
                  (fun pf_elem =>
                    C (Groth16TypeIII.verificationPairingProof_G1 stmt () pairing pf_elem) *
                      (List.map
                          (fun SRS_elem => C (prover.1 pf_elem SRS_elem) * Groth16TypeIII.SRSElementValue_G1 SRS_elem)
                          Groth16TypeIII.ListSRSElements_G1).sum)
                  Groth16TypeIII.ListProof_G1).sum +
              (List.map
                  (fun SRS_elem =>
                    C (Groth16TypeIII.verificationPairingSRS_G1 stmt () pairing SRS_elem) *
                      Groth16TypeIII.SRSElementValue_G1 SRS_elem)
                  Groth16TypeIII.ListSRSElements_G1).sum) *
            ((List.map
                  (fun pf_elem =>
                    C (Groth16TypeIII.verificationPairingProof_G2 stmt () pairing pf_elem) *
                      (List.map
                          (fun SRS_elem => C (prover.2 pf_elem SRS_elem) * Groth16TypeIII.SRSElementValue_G2 SRS_elem)
                          Groth16TypeIII.ListSRSElements_G2).sum)
                  Groth16TypeIII.ListProof_G2).sum +
              (List.map
                  (fun SRS_elem =>
                    C (Groth16TypeIII.verificationPairingSRS_G2 stmt () pairing SRS_elem) *
                      Groth16TypeIII.SRSElementValue_G2 SRS_elem)
                  Groth16TypeIII.ListSRSElements_G2).sum))
        (Groth16TypeIII.ListPairings ())).sum =
    0
i : Fin n_wit
hi : i ∈ Finset.univ
⊢ (Polynomial.X - Polynomial.C (r i)).Monic
Tactic:
exact Polynomial.monic_X_sub_C (r i)
State after:
no goals