Theorem: BabySNARK.is_sound (FormalSnarksProject/SNARKs/BabySnark.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
t : Polynomial F
ht : (List.map (fun x => Polynomial.C (t.coeff ↑x) * Polynomial.X ^ ↑x) (List.finRange n_var)).sum = t
ht0 : t.Monic
⊢ soundness F BabySNARK (Fin n_wit → F)
    (fun stmt wit =>
      (((List.map (fun i => Polynomial.C (stmt i) * u_stmt i) (List.finRange n_stmt)).sum +
                  (List.map (fun i => Polynomial.C (wit i) * u_wit i) (List.finRange n_wit)).sum) ^
                2 -
              1).modByMonic
          t =
        0)
    fun prover i => prover.1 Proof_Idx.B (SRS_Elements_Idx.βu i)
Tactic:
unfold soundness verify check_poly pairing_poly proof_element_G1_as_poly proof_element_G2_as_poly
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
t : Polynomial F
ht : (List.map (fun x => Polynomial.C (t.coeff ↑x) * Polynomial.X ^ ↑x) (List.finRange n_var)).sum = t
ht0 : t.Monic
⊢ ∀ (stmt : BabySNARK.Stmt) (prover : Prover F BabySNARK),
    ((∀ (check_idx : BabySNARK.EqualityChecks),
          (List.map
                (fun pairing =>
                  ((List.map
                          (fun pf_elem =>
                            C (BabySNARK.verificationPairingProof_G1 stmt check_idx pairing pf_elem) *
                              (List.map
                                  (fun SRS_elem =>
                                    C (prover.1 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
                                  BabySNARK.ListSRSElements_G1).sum)
                          BabySNARK.ListProof_G1).sum +
                      (List.map
                          (fun SRS_elem =>
                            C (BabySNARK.verificationPairingSRS_G1 stmt check_idx pairing SRS_elem) *
                              BabySNARK.SRSElementValue_G1 SRS_elem)
                          BabySNARK.ListSRSElements_G1).sum) *
                    ((List.map
                          (fun pf_elem =>
                            C (BabySNARK.verificationPairingProof_G2 stmt check_idx pairing pf_elem) *
                              (List.map
                                  (fun SRS_elem =>
                                    C (prover.2 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
                                  BabySNARK.ListSRSElements_G2).sum)
                          BabySNARK.ListProof_G2).sum +
                      (List.map
                          (fun SRS_elem =>
                            C (BabySNARK.verificationPairingSRS_G2 stmt check_idx pairing SRS_elem) *
                              BabySNARK.SRSElementValue_G2 SRS_elem)
                          BabySNARK.ListSRSElements_G2).sum))
                (BabySNARK.ListPairings check_idx)).sum =
            0) ∧
        ∀ pfs ∈ BabySNARK.Identified_Proof_Elems,
          (List.map (fun SRS_elem => C (prover.1 pfs.1 SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
                BabySNARK.ListSRSElements_G1).sum =
            (List.map (fun SRS_elem => C (prover.2 pfs.2 SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
                BabySNARK.ListSRSElements_G2).sum) →
      (fun stmt wit =>
          (((List.map (fun i => Polynomial.C (stmt i) * u_stmt i) (List.finRange n_stmt)).sum +
                      (List.map (fun i => Polynomial.C (wit i) * u_wit i) (List.finRange n_wit)).sum) ^
                    2 -
                  1).modByMonic
              t =
            0)
        stmt ((fun prover i => prover.1 Proof_Idx.B (SRS_Elements_Idx.βu i)) prover)

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
t : Polynomial F
ht : (List.map (fun x => Polynomial.C (t.coeff ↑x) * Polynomial.X ^ ↑x) (List.finRange n_var)).sum = t
ht0 : t.Monic
⊢ ∀ (stmt : BabySNARK.Stmt) (prover : Prover F BabySNARK),
    ((∀ (check_idx : BabySNARK.EqualityChecks),
          (List.map
                (fun pairing =>
                  ((List.map
                          (fun pf_elem =>
                            C (BabySNARK.verificationPairingProof_G1 stmt check_idx pairing pf_elem) *
                              (List.map
                                  (fun SRS_elem =>
                                    C (prover.1 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
                                  BabySNARK.ListSRSElements_G1).sum)
                          BabySNARK.ListProof_G1).sum +
                      (List.map
                          (fun SRS_elem =>
                            C (BabySNARK.verificationPairingSRS_G1 stmt check_idx pairing SRS_elem) *
                              BabySNARK.SRSElementValue_G1 SRS_elem)
                          BabySNARK.ListSRSElements_G1).sum) *
                    ((List.map
                          (fun pf_elem =>
                            C (BabySNARK.verificationPairingProof_G2 stmt check_idx pairing pf_elem) *
                              (List.map
                                  (fun SRS_elem =>
                                    C (prover.2 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
                                  BabySNARK.ListSRSElements_G2).sum)
                          BabySNARK.ListProof_G2).sum +
                      (List.map
                          (fun SRS_elem =>
                            C (BabySNARK.verificationPairingSRS_G2 stmt check_idx pairing SRS_elem) *
                              BabySNARK.SRSElementValue_G2 SRS_elem)
                          BabySNARK.ListSRSElements_G2).sum))
                (BabySNARK.ListPairings check_idx)).sum =
            0) ∧
        ∀ pfs ∈ BabySNARK.Identified_Proof_Elems,
          (List.map (fun SRS_elem => C (prover.1 pfs.1 SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
                BabySNARK.ListSRSElements_G1).sum =
            (List.map (fun SRS_elem => C (prover.2 pfs.2 SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
                BabySNARK.ListSRSElements_G2).sum) →
      (fun stmt wit =>
          (((List.map (fun i => Polynomial.C (stmt i) * u_stmt i) (List.finRange n_stmt)).sum +
                      (List.map (fun i => Polynomial.C (wit i) * u_wit i) (List.finRange n_wit)).sum) ^
                    2 -
                  1).modByMonic
              t =
            0)
        stmt ((fun prover i => prover.1 Proof_Idx.B (SRS_Elements_Idx.βu i)) prover)
Tactic:
intros stmt prover eqns'
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
t : Polynomial F
ht : (List.map (fun x => Polynomial.C (t.coeff ↑x) * Polynomial.X ^ ↑x) (List.finRange n_var)).sum = t
ht0 : t.Monic
stmt : BabySNARK.Stmt
prover : Prover F BabySNARK
eqns' :
  (∀ (check_idx : BabySNARK.EqualityChecks),
      (List.map
            (fun pairing =>
              ((List.map
                      (fun pf_elem =>
                        C (BabySNARK.verificationPairingProof_G1 stmt check_idx pairing pf_elem) *
                          (List.map
                              (fun SRS_elem => C (prover.1 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
                              BabySNARK.ListSRSElements_G1).sum)
                      BabySNARK.ListProof_G1).sum +
                  (List.map
                      (fun SRS_elem =>
                        C (BabySNARK.verificationPairingSRS_G1 stmt check_idx pairing SRS_elem) *
                          BabySNARK.SRSElementValue_G1 SRS_elem)
                      BabySNARK.ListSRSElements_G1).sum) *
                ((List.map
                      (fun pf_elem =>
                        C (BabySNARK.verificationPairingProof_G2 stmt check_idx pairing pf_elem) *
                          (List.map
                              (fun SRS_elem => C (prover.2 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
                              BabySNARK.ListSRSElements_G2).sum)
                      BabySNARK.ListProof_G2).sum +
                  (List.map
                      (fun SRS_elem =>
                        C (BabySNARK.verificationPairingSRS_G2 stmt check_idx pairing SRS_elem) *
                          BabySNARK.SRSElementValue_G2 SRS_elem)
                      BabySNARK.ListSRSElements_G2).sum))
            (BabySNARK.ListPairings check_idx)).sum =
        0) ∧
    ∀ pfs ∈ BabySNARK.Identified_Proof_Elems,
      (List.map (fun SRS_elem => C (prover.1 pfs.1 SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
            BabySNARK.ListSRSElements_G1).sum =
        (List.map (fun SRS_elem => C (prover.2 pfs.2 SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
            BabySNARK.ListSRSElements_G2).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_Idx.B (SRS_Elements_Idx.βu i)) prover i) * u_wit i)
                  (List.finRange n_wit)).sum) ^
            2 -
          1).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
t : Polynomial F
ht : (List.map (fun x => Polynomial.C (t.coeff ↑x) * Polynomial.X ^ ↑x) (List.finRange n_var)).sum = t
ht0 : t.Monic
stmt : BabySNARK.Stmt
prover : Prover F BabySNARK
eqns' :
  (∀ (check_idx : BabySNARK.EqualityChecks),
      (List.map
            (fun pairing =>
              ((List.map
                      (fun pf_elem =>
                        C (BabySNARK.verificationPairingProof_G1 stmt check_idx pairing pf_elem) *
                          (List.map
                              (fun SRS_elem => C (prover.1 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
                              BabySNARK.ListSRSElements_G1).sum)
                      BabySNARK.ListProof_G1).sum +
                  (List.map
                      (fun SRS_elem =>
                        C (BabySNARK.verificationPairingSRS_G1 stmt check_idx pairing SRS_elem) *
                          BabySNARK.SRSElementValue_G1 SRS_elem)
                      BabySNARK.ListSRSElements_G1).sum) *
                ((List.map
                      (fun pf_elem =>
                        C (BabySNARK.verificationPairingProof_G2 stmt check_idx pairing pf_elem) *
                          (List.map
                              (fun SRS_elem => C (prover.2 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
                              BabySNARK.ListSRSElements_G2).sum)
                      BabySNARK.ListProof_G2).sum +
                  (List.map
                      (fun SRS_elem =>
                        C (BabySNARK.verificationPairingSRS_G2 stmt check_idx pairing SRS_elem) *
                          BabySNARK.SRSElementValue_G2 SRS_elem)
                      BabySNARK.ListSRSElements_G2).sum))
            (BabySNARK.ListPairings check_idx)).sum =
        0) ∧
    ∀ pfs ∈ BabySNARK.Identified_Proof_Elems,
      (List.map (fun SRS_elem => C (prover.1 pfs.1 SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
            BabySNARK.ListSRSElements_G1).sum =
        (List.map (fun SRS_elem => C (prover.2 pfs.2 SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
            BabySNARK.ListSRSElements_G2).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_Idx.B (SRS_Elements_Idx.βu i)) prover i) * u_wit i)
                  (List.finRange n_wit)).sum) ^
            2 -
          1).modByMonic
      t =
    0
Tactic:
rcases eqns' with ⟨eqns, typeI_identification⟩
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
t : Polynomial F
ht : (List.map (fun x => Polynomial.C (t.coeff ↑x) * Polynomial.X ^ ↑x) (List.finRange n_var)).sum = t
ht0 : t.Monic
stmt : BabySNARK.Stmt
prover : Prover F BabySNARK
eqns :
  ∀ (check_idx : BabySNARK.EqualityChecks),
    (List.map
          (fun pairing =>
            ((List.map
                    (fun pf_elem =>
                      C (BabySNARK.verificationPairingProof_G1 stmt check_idx pairing pf_elem) *
                        (List.map
                            (fun SRS_elem => C (prover.1 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
                            BabySNARK.ListSRSElements_G1).sum)
                    BabySNARK.ListProof_G1).sum +
                (List.map
                    (fun SRS_elem =>
                      C (BabySNARK.verificationPairingSRS_G1 stmt check_idx pairing SRS_elem) *
                        BabySNARK.SRSElementValue_G1 SRS_elem)
                    BabySNARK.ListSRSElements_G1).sum) *
              ((List.map
                    (fun pf_elem =>
                      C (BabySNARK.verificationPairingProof_G2 stmt check_idx pairing pf_elem) *
                        (List.map
                            (fun SRS_elem => C (prover.2 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
                            BabySNARK.ListSRSElements_G2).sum)
                    BabySNARK.ListProof_G2).sum +
                (List.map
                    (fun SRS_elem =>
                      C (BabySNARK.verificationPairingSRS_G2 stmt check_idx pairing SRS_elem) *
                        BabySNARK.SRSElementValue_G2 SRS_elem)
                    BabySNARK.ListSRSElements_G2).sum))
          (BabySNARK.ListPairings check_idx)).sum =
      0
typeI_identification :
  ∀ pfs ∈ BabySNARK.Identified_Proof_Elems,
    (List.map (fun SRS_elem => C (prover.1 pfs.1 SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
          BabySNARK.ListSRSElements_G1).sum =
      (List.map (fun SRS_elem => C (prover.2 pfs.2 SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
          BabySNARK.ListSRSElements_G2).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_Idx.B (SRS_Elements_Idx.βu i)) prover i) * u_wit i)
                  (List.finRange n_wit)).sum) ^
            2 -
          1).modByMonic
      t =
    0

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
t : Polynomial F
ht : (List.map (fun x => Polynomial.C (t.coeff ↑x) * Polynomial.X ^ ↑x) (List.finRange n_var)).sum = t
ht0 : t.Monic
stmt : BabySNARK.Stmt
prover : Prover F BabySNARK
eqns :
  ∀ (check_idx : BabySNARK.EqualityChecks),
    (List.map
          (fun pairing =>
            ((List.map
                    (fun pf_elem =>
                      C (BabySNARK.verificationPairingProof_G1 stmt check_idx pairing pf_elem) *
                        (List.map
                            (fun SRS_elem => C (prover.1 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
                            BabySNARK.ListSRSElements_G1).sum)
                    BabySNARK.ListProof_G1).sum +
                (List.map
                    (fun SRS_elem =>
                      C (BabySNARK.verificationPairingSRS_G1 stmt check_idx pairing SRS_elem) *
                        BabySNARK.SRSElementValue_G1 SRS_elem)
                    BabySNARK.ListSRSElements_G1).sum) *
              ((List.map
                    (fun pf_elem =>
                      C (BabySNARK.verificationPairingProof_G2 stmt check_idx pairing pf_elem) *
                        (List.map
                            (fun SRS_elem => C (prover.2 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
                            BabySNARK.ListSRSElements_G2).sum)
                    BabySNARK.ListProof_G2).sum +
                (List.map
                    (fun SRS_elem =>
                      C (BabySNARK.verificationPairingSRS_G2 stmt check_idx pairing SRS_elem) *
                        BabySNARK.SRSElementValue_G2 SRS_elem)
                    BabySNARK.ListSRSElements_G2).sum))
          (BabySNARK.ListPairings check_idx)).sum =
      0
typeI_identification :
  ∀ pfs ∈ BabySNARK.Identified_Proof_Elems,
    (List.map (fun SRS_elem => C (prover.1 pfs.1 SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
          BabySNARK.ListSRSElements_G1).sum =
      (List.map (fun SRS_elem => C (prover.2 pfs.2 SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
          BabySNARK.ListSRSElements_G2).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_Idx.B (SRS_Elements_Idx.βu i)) prover i) * u_wit i)
                  (List.finRange n_wit)).sum) ^
            2 -
          1).modByMonic
      t =
    0
Tactic:
have eqnI := eqns ChecksIdx.CheckI
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
t : Polynomial F
ht : (List.map (fun x => Polynomial.C (t.coeff ↑x) * Polynomial.X ^ ↑x) (List.finRange n_var)).sum = t
ht0 : t.Monic
stmt : BabySNARK.Stmt
prover : Prover F BabySNARK
eqns :
  ∀ (check_idx : BabySNARK.EqualityChecks),
    (List.map
          (fun pairing =>
            ((List.map
                    (fun pf_elem =>
                      C (BabySNARK.verificationPairingProof_G1 stmt check_idx pairing pf_elem) *
                        (List.map
                            (fun SRS_elem => C (prover.1 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
                            BabySNARK.ListSRSElements_G1).sum)
                    BabySNARK.ListProof_G1).sum +
                (List.map
                    (fun SRS_elem =>
                      C (BabySNARK.verificationPairingSRS_G1 stmt check_idx pairing SRS_elem) *
                        BabySNARK.SRSElementValue_G1 SRS_elem)
                    BabySNARK.ListSRSElements_G1).sum) *
              ((List.map
                    (fun pf_elem =>
                      C (BabySNARK.verificationPairingProof_G2 stmt check_idx pairing pf_elem) *
                        (List.map
                            (fun SRS_elem => C (prover.2 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
                            BabySNARK.ListSRSElements_G2).sum)
                    BabySNARK.ListProof_G2).sum +
                (List.map
                    (fun SRS_elem =>
                      C (BabySNARK.verificationPairingSRS_G2 stmt check_idx pairing SRS_elem) *
                        BabySNARK.SRSElementValue_G2 SRS_elem)
                    BabySNARK.ListSRSElements_G2).sum))
          (BabySNARK.ListPairings check_idx)).sum =
      0
typeI_identification :
  ∀ pfs ∈ BabySNARK.Identified_Proof_Elems,
    (List.map (fun SRS_elem => C (prover.1 pfs.1 SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
          BabySNARK.ListSRSElements_G1).sum =
      (List.map (fun SRS_elem => C (prover.2 pfs.2 SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
          BabySNARK.ListSRSElements_G2).sum
eqnI :
  (List.map
        (fun pairing =>
          ((List.map
                  (fun pf_elem =>
                    C (BabySNARK.verificationPairingProof_G1 stmt ChecksIdx.CheckI pairing pf_elem) *
                      (List.map (fun SRS_elem => C (prover.1 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
                          BabySNARK.ListSRSElements_G1).sum)
                  BabySNARK.ListProof_G1).sum +
              (List.map
                  (fun SRS_elem =>
                    C (BabySNARK.verificationPairingSRS_G1 stmt ChecksIdx.CheckI pairing SRS_elem) *
                      BabySNARK.SRSElementValue_G1 SRS_elem)
                  BabySNARK.ListSRSElements_G1).sum) *
            ((List.map
                  (fun pf_elem =>
                    C (BabySNARK.verificationPairingProof_G2 stmt ChecksIdx.CheckI pairing pf_elem) *
                      (List.map (fun SRS_elem => C (prover.2 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
                          BabySNARK.ListSRSElements_G2).sum)
                  BabySNARK.ListProof_G2).sum +
              (List.map
                  (fun SRS_elem =>
                    C (BabySNARK.verificationPairingSRS_G2 stmt ChecksIdx.CheckI pairing SRS_elem) *
                      BabySNARK.SRSElementValue_G2 SRS_elem)
                  BabySNARK.ListSRSElements_G2).sum))
        (BabySNARK.ListPairings ChecksIdx.CheckI)).sum =
    0
⊢ (((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_Idx.B (SRS_Elements_Idx.βu i)) prover i) * u_wit i)
                  (List.finRange n_wit)).sum) ^
            2 -
          1).modByMonic
      t =
    0

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
t : Polynomial F
ht : (List.map (fun x => Polynomial.C (t.coeff ↑x) * Polynomial.X ^ ↑x) (List.finRange n_var)).sum = t
ht0 : t.Monic
stmt : BabySNARK.Stmt
prover : Prover F BabySNARK
eqns :
  ∀ (check_idx : BabySNARK.EqualityChecks),
    (List.map
          (fun pairing =>
            ((List.map
                    (fun pf_elem =>
                      C (BabySNARK.verificationPairingProof_G1 stmt check_idx pairing pf_elem) *
                        (List.map
                            (fun SRS_elem => C (prover.1 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
                            BabySNARK.ListSRSElements_G1).sum)
                    BabySNARK.ListProof_G1).sum +
                (List.map
                    (fun SRS_elem =>
                      C (BabySNARK.verificationPairingSRS_G1 stmt check_idx pairing SRS_elem) *
                        BabySNARK.SRSElementValue_G1 SRS_elem)
                    BabySNARK.ListSRSElements_G1).sum) *
              ((List.map
                    (fun pf_elem =>
                      C (BabySNARK.verificationPairingProof_G2 stmt check_idx pairing pf_elem) *
                        (List.map
                            (fun SRS_elem => C (prover.2 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
                            BabySNARK.ListSRSElements_G2).sum)
                    BabySNARK.ListProof_G2).sum +
                (List.map
                    (fun SRS_elem =>
                      C (BabySNARK.verificationPairingSRS_G2 stmt check_idx pairing SRS_elem) *
                        BabySNARK.SRSElementValue_G2 SRS_elem)
                    BabySNARK.ListSRSElements_G2).sum))
          (BabySNARK.ListPairings check_idx)).sum =
      0
typeI_identification :
  ∀ pfs ∈ BabySNARK.Identified_Proof_Elems,
    (List.map (fun SRS_elem => C (prover.1 pfs.1 SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
          BabySNARK.ListSRSElements_G1).sum =
      (List.map (fun SRS_elem => C (prover.2 pfs.2 SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
          BabySNARK.ListSRSElements_G2).sum
eqnI :
  (List.map
        (fun pairing =>
          ((List.map
                  (fun pf_elem =>
                    C (BabySNARK.verificationPairingProof_G1 stmt ChecksIdx.CheckI pairing pf_elem) *
                      (List.map (fun SRS_elem => C (prover.1 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
                          BabySNARK.ListSRSElements_G1).sum)
                  BabySNARK.ListProof_G1).sum +
              (List.map
                  (fun SRS_elem =>
                    C (BabySNARK.verificationPairingSRS_G1 stmt ChecksIdx.CheckI pairing SRS_elem) *
                      BabySNARK.SRSElementValue_G1 SRS_elem)
                  BabySNARK.ListSRSElements_G1).sum) *
            ((List.map
                  (fun pf_elem =>
                    C (BabySNARK.verificationPairingProof_G2 stmt ChecksIdx.CheckI pairing pf_elem) *
                      (List.map (fun SRS_elem => C (prover.2 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
                          BabySNARK.ListSRSElements_G2).sum)
                  BabySNARK.ListProof_G2).sum +
              (List.map
                  (fun SRS_elem =>
                    C (BabySNARK.verificationPairingSRS_G2 stmt ChecksIdx.CheckI pairing SRS_elem) *
                      BabySNARK.SRSElementValue_G2 SRS_elem)
                  BabySNARK.ListSRSElements_G2).sum))
        (BabySNARK.ListPairings ChecksIdx.CheckI)).sum =
    0
⊢ (((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_Idx.B (SRS_Elements_Idx.βu i)) prover i) * u_wit i)
                  (List.finRange n_wit)).sum) ^
            2 -
          1).modByMonic
      t =
    0
Tactic:
have eqnII := eqns ChecksIdx.CheckII
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
t : Polynomial F
ht : (List.map (fun x => Polynomial.C (t.coeff ↑x) * Polynomial.X ^ ↑x) (List.finRange n_var)).sum = t
ht0 : t.Monic
stmt : BabySNARK.Stmt
prover : Prover F BabySNARK
eqns :
  ∀ (check_idx : BabySNARK.EqualityChecks),
    (List.map
          (fun pairing =>
            ((List.map
                    (fun pf_elem =>
                      C (BabySNARK.verificationPairingProof_G1 stmt check_idx pairing pf_elem) *
                        (List.map
                            (fun SRS_elem => C (prover.1 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
                            BabySNARK.ListSRSElements_G1).sum)
                    BabySNARK.ListProof_G1).sum +
                (List.map
                    (fun SRS_elem =>
                      C (BabySNARK.verificationPairingSRS_G1 stmt check_idx pairing SRS_elem) *
                        BabySNARK.SRSElementValue_G1 SRS_elem)
                    BabySNARK.ListSRSElements_G1).sum) *
              ((List.map
                    (fun pf_elem =>
                      C (BabySNARK.verificationPairingProof_G2 stmt check_idx pairing pf_elem) *
                        (List.map
                            (fun SRS_elem => C (prover.2 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
                            BabySNARK.ListSRSElements_G2).sum)
                    BabySNARK.ListProof_G2).sum +
                (List.map
                    (fun SRS_elem =>
                      C (BabySNARK.verificationPairingSRS_G2 stmt check_idx pairing SRS_elem) *
                        BabySNARK.SRSElementValue_G2 SRS_elem)
                    BabySNARK.ListSRSElements_G2).sum))
          (BabySNARK.ListPairings check_idx)).sum =
      0
typeI_identification :
  ∀ pfs ∈ BabySNARK.Identified_Proof_Elems,
    (List.map (fun SRS_elem => C (prover.1 pfs.1 SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
          BabySNARK.ListSRSElements_G1).sum =
      (List.map (fun SRS_elem => C (prover.2 pfs.2 SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
          BabySNARK.ListSRSElements_G2).sum
eqnI :
  (List.map
        (fun pairing =>
          ((List.map
                  (fun pf_elem =>
                    C (BabySNARK.verificationPairingProof_G1 stmt ChecksIdx.CheckI pairing pf_elem) *
                      (List.map (fun SRS_elem => C (prover.1 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
                          BabySNARK.ListSRSElements_G1).sum)
                  BabySNARK.ListProof_G1).sum +
              (List.map
                  (fun SRS_elem =>
                    C (BabySNARK.verificationPairingSRS_G1 stmt ChecksIdx.CheckI pairing SRS_elem) *
                      BabySNARK.SRSElementValue_G1 SRS_elem)
                  BabySNARK.ListSRSElements_G1).sum) *
            ((List.map
                  (fun pf_elem =>
                    C (BabySNARK.verificationPairingProof_G2 stmt ChecksIdx.CheckI pairing pf_elem) *
                      (List.map (fun SRS_elem => C (prover.2 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
                          BabySNARK.ListSRSElements_G2).sum)
                  BabySNARK.ListProof_G2).sum +
              (List.map
                  (fun SRS_elem =>
                    C (BabySNARK.verificationPairingSRS_G2 stmt ChecksIdx.CheckI pairing SRS_elem) *
                      BabySNARK.SRSElementValue_G2 SRS_elem)
                  BabySNARK.ListSRSElements_G2).sum))
        (BabySNARK.ListPairings ChecksIdx.CheckI)).sum =
    0
eqnII :
  (List.map
        (fun pairing =>
          ((List.map
                  (fun pf_elem =>
                    C (BabySNARK.verificationPairingProof_G1 stmt ChecksIdx.CheckII pairing pf_elem) *
                      (List.map (fun SRS_elem => C (prover.1 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
                          BabySNARK.ListSRSElements_G1).sum)
                  BabySNARK.ListProof_G1).sum +
              (List.map
                  (fun SRS_elem =>
                    C (BabySNARK.verificationPairingSRS_G1 stmt ChecksIdx.CheckII pairing SRS_elem) *
                      BabySNARK.SRSElementValue_G1 SRS_elem)
                  BabySNARK.ListSRSElements_G1).sum) *
            ((List.map
                  (fun pf_elem =>
                    C (BabySNARK.verificationPairingProof_G2 stmt ChecksIdx.CheckII pairing pf_elem) *
                      (List.map (fun SRS_elem => C (prover.2 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
                          BabySNARK.ListSRSElements_G2).sum)
                  BabySNARK.ListProof_G2).sum +
              (List.map
                  (fun SRS_elem =>
                    C (BabySNARK.verificationPairingSRS_G2 stmt ChecksIdx.CheckII pairing SRS_elem) *
                      BabySNARK.SRSElementValue_G2 SRS_elem)
                  BabySNARK.ListSRSElements_G2).sum))
        (BabySNARK.ListPairings ChecksIdx.CheckII)).sum =
    0
⊢ (((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_Idx.B (SRS_Elements_Idx.βu i)) prover i) * u_wit i)
                  (List.finRange n_wit)).sum) ^
            2 -
          1).modByMonic
      t =
    0

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
t : Polynomial F
ht : (List.map (fun x => Polynomial.C (t.coeff ↑x) * Polynomial.X ^ ↑x) (List.finRange n_var)).sum = t
ht0 : t.Monic
stmt : BabySNARK.Stmt
prover : Prover F BabySNARK
eqns :
  ∀ (check_idx : BabySNARK.EqualityChecks),
    (List.map
          (fun pairing =>
            ((List.map
                    (fun pf_elem =>
                      C (BabySNARK.verificationPairingProof_G1 stmt check_idx pairing pf_elem) *
                        (List.map
                            (fun SRS_elem => C (prover.1 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
                            BabySNARK.ListSRSElements_G1).sum)
                    BabySNARK.ListProof_G1).sum +
                (List.map
                    (fun SRS_elem =>
                      C (BabySNARK.verificationPairingSRS_G1 stmt check_idx pairing SRS_elem) *
                        BabySNARK.SRSElementValue_G1 SRS_elem)
                    BabySNARK.ListSRSElements_G1).sum) *
              ((List.map
                    (fun pf_elem =>
                      C (BabySNARK.verificationPairingProof_G2 stmt check_idx pairing pf_elem) *
                        (List.map
                            (fun SRS_elem => C (prover.2 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
                            BabySNARK.ListSRSElements_G2).sum)
                    BabySNARK.ListProof_G2).sum +
                (List.map
                    (fun SRS_elem =>
                      C (BabySNARK.verificationPairingSRS_G2 stmt check_idx pairing SRS_elem) *
                        BabySNARK.SRSElementValue_G2 SRS_elem)
                    BabySNARK.ListSRSElements_G2).sum))
          (BabySNARK.ListPairings check_idx)).sum =
      0
typeI_identification :
  ∀ pfs ∈ BabySNARK.Identified_Proof_Elems,
    (List.map (fun SRS_elem => C (prover.1 pfs.1 SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
          BabySNARK.ListSRSElements_G1).sum =
      (List.map (fun SRS_elem => C (prover.2 pfs.2 SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
          BabySNARK.ListSRSElements_G2).sum
eqnI :
  (List.map
        (fun pairing =>
          ((List.map
                  (fun pf_elem =>
                    C (BabySNARK.verificationPairingProof_G1 stmt ChecksIdx.CheckI pairing pf_elem) *
                      (List.map (fun SRS_elem => C (prover.1 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
                          BabySNARK.ListSRSElements_G1).sum)
                  BabySNARK.ListProof_G1).sum +
              (List.map
                  (fun SRS_elem =>
                    C (BabySNARK.verificationPairingSRS_G1 stmt ChecksIdx.CheckI pairing SRS_elem) *
                      BabySNARK.SRSElementValue_G1 SRS_elem)
                  BabySNARK.ListSRSElements_G1).sum) *
            ((List.map
                  (fun pf_elem =>
                    C (BabySNARK.verificationPairingProof_G2 stmt ChecksIdx.CheckI pairing pf_elem) *
                      (List.map (fun SRS_elem => C (prover.2 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
                          BabySNARK.ListSRSElements_G2).sum)
                  BabySNARK.ListProof_G2).sum +
              (List.map
                  (fun SRS_elem =>
                    C (BabySNARK.verificationPairingSRS_G2 stmt ChecksIdx.CheckI pairing SRS_elem) *
                      BabySNARK.SRSElementValue_G2 SRS_elem)
                  BabySNARK.ListSRSElements_G2).sum))
        (BabySNARK.ListPairings ChecksIdx.CheckI)).sum =
    0
eqnII :
  (List.map
        (fun pairing =>
          ((List.map
                  (fun pf_elem =>
                    C (BabySNARK.verificationPairingProof_G1 stmt ChecksIdx.CheckII pairing pf_elem) *
                      (List.map (fun SRS_elem => C (prover.1 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
                          BabySNARK.ListSRSElements_G1).sum)
                  BabySNARK.ListProof_G1).sum +
              (List.map
                  (fun SRS_elem =>
                    C (BabySNARK.verificationPairingSRS_G1 stmt ChecksIdx.CheckII pairing SRS_elem) *
                      BabySNARK.SRSElementValue_G1 SRS_elem)
                  BabySNARK.ListSRSElements_G1).sum) *
            ((List.map
                  (fun pf_elem =>
                    C (BabySNARK.verificationPairingProof_G2 stmt ChecksIdx.CheckII pairing pf_elem) *
                      (List.map (fun SRS_elem => C (prover.2 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
                          BabySNARK.ListSRSElements_G2).sum)
                  BabySNARK.ListProof_G2).sum +
              (List.map
                  (fun SRS_elem =>
                    C (BabySNARK.verificationPairingSRS_G2 stmt ChecksIdx.CheckII pairing SRS_elem) *
                      BabySNARK.SRSElementValue_G2 SRS_elem)
                  BabySNARK.ListSRSElements_G2).sum))
        (BabySNARK.ListPairings ChecksIdx.CheckII)).sum =
    0
⊢ (((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_Idx.B (SRS_Elements_Idx.βu i)) prover i) * u_wit i)
                  (List.finRange n_wit)).sum) ^
            2 -
          1).modByMonic
      t =
    0
Tactic:
clear eqns
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
t : Polynomial F
ht : (List.map (fun x => Polynomial.C (t.coeff ↑x) * Polynomial.X ^ ↑x) (List.finRange n_var)).sum = t
ht0 : t.Monic
stmt : BabySNARK.Stmt
prover : Prover F BabySNARK
typeI_identification :
  ∀ pfs ∈ BabySNARK.Identified_Proof_Elems,
    (List.map (fun SRS_elem => C (prover.1 pfs.1 SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
          BabySNARK.ListSRSElements_G1).sum =
      (List.map (fun SRS_elem => C (prover.2 pfs.2 SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
          BabySNARK.ListSRSElements_G2).sum
eqnI :
  (List.map
        (fun pairing =>
          ((List.map
                  (fun pf_elem =>
                    C (BabySNARK.verificationPairingProof_G1 stmt ChecksIdx.CheckI pairing pf_elem) *
                      (List.map (fun SRS_elem => C (prover.1 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
                          BabySNARK.ListSRSElements_G1).sum)
                  BabySNARK.ListProof_G1).sum +
              (List.map
                  (fun SRS_elem =>
                    C (BabySNARK.verificationPairingSRS_G1 stmt ChecksIdx.CheckI pairing SRS_elem) *
                      BabySNARK.SRSElementValue_G1 SRS_elem)
                  BabySNARK.ListSRSElements_G1).sum) *
            ((List.map
                  (fun pf_elem =>
                    C (BabySNARK.verificationPairingProof_G2 stmt ChecksIdx.CheckI pairing pf_elem) *
                      (List.map (fun SRS_elem => C (prover.2 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
                          BabySNARK.ListSRSElements_G2).sum)
                  BabySNARK.ListProof_G2).sum +
              (List.map
                  (fun SRS_elem =>
                    C (BabySNARK.verificationPairingSRS_G2 stmt ChecksIdx.CheckI pairing SRS_elem) *
                      BabySNARK.SRSElementValue_G2 SRS_elem)
                  BabySNARK.ListSRSElements_G2).sum))
        (BabySNARK.ListPairings ChecksIdx.CheckI)).sum =
    0
eqnII :
  (List.map
        (fun pairing =>
          ((List.map
                  (fun pf_elem =>
                    C (BabySNARK.verificationPairingProof_G1 stmt ChecksIdx.CheckII pairing pf_elem) *
                      (List.map (fun SRS_elem => C (prover.1 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
                          BabySNARK.ListSRSElements_G1).sum)
                  BabySNARK.ListProof_G1).sum +
              (List.map
                  (fun SRS_elem =>
                    C (BabySNARK.verificationPairingSRS_G1 stmt ChecksIdx.CheckII pairing SRS_elem) *
                      BabySNARK.SRSElementValue_G1 SRS_elem)
                  BabySNARK.ListSRSElements_G1).sum) *
            ((List.map
                  (fun pf_elem =>
                    C (BabySNARK.verificationPairingProof_G2 stmt ChecksIdx.CheckII pairing pf_elem) *
                      (List.map (fun SRS_elem => C (prover.2 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
                          BabySNARK.ListSRSElements_G2).sum)
                  BabySNARK.ListProof_G2).sum +
              (List.map
                  (fun SRS_elem =>
                    C (BabySNARK.verificationPairingSRS_G2 stmt ChecksIdx.CheckII pairing SRS_elem) *
                      BabySNARK.SRSElementValue_G2 SRS_elem)
                  BabySNARK.ListSRSElements_G2).sum))
        (BabySNARK.ListPairings ChecksIdx.CheckII)).sum =
    0
⊢ (((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_Idx.B (SRS_Elements_Idx.βu i)) prover i) * u_wit i)
                  (List.finRange n_wit)).sum) ^
            2 -
          1).modByMonic
      t =
    0

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
t : Polynomial F
ht : (List.map (fun x => Polynomial.C (t.coeff ↑x) * Polynomial.X ^ ↑x) (List.finRange n_var)).sum = t
ht0 : t.Monic
stmt : BabySNARK.Stmt
prover : Prover F BabySNARK
typeI_identification :
  ∀ pfs ∈ BabySNARK.Identified_Proof_Elems,
    (List.map (fun SRS_elem => C (prover.1 pfs.1 SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
          BabySNARK.ListSRSElements_G1).sum =
      (List.map (fun SRS_elem => C (prover.2 pfs.2 SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
          BabySNARK.ListSRSElements_G2).sum
eqnI :
  (List.map
        (fun pairing =>
          ((List.map
                  (fun pf_elem =>
                    C (BabySNARK.verificationPairingProof_G1 stmt ChecksIdx.CheckI pairing pf_elem) *
                      (List.map (fun SRS_elem => C (prover.1 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
                          BabySNARK.ListSRSElements_G1).sum)
                  BabySNARK.ListProof_G1).sum +
              (List.map
                  (fun SRS_elem =>
                    C (BabySNARK.verificationPairingSRS_G1 stmt ChecksIdx.CheckI pairing SRS_elem) *
                      BabySNARK.SRSElementValue_G1 SRS_elem)
                  BabySNARK.ListSRSElements_G1).sum) *
            ((List.map
                  (fun pf_elem =>
                    C (BabySNARK.verificationPairingProof_G2 stmt ChecksIdx.CheckI pairing pf_elem) *
                      (List.map (fun SRS_elem => C (prover.2 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
                          BabySNARK.ListSRSElements_G2).sum)
                  BabySNARK.ListProof_G2).sum +
              (List.map
                  (fun SRS_elem =>
                    C (BabySNARK.verificationPairingSRS_G2 stmt ChecksIdx.CheckI pairing SRS_elem) *
                      BabySNARK.SRSElementValue_G2 SRS_elem)
                  BabySNARK.ListSRSElements_G2).sum))
        (BabySNARK.ListPairings ChecksIdx.CheckI)).sum =
    0
eqnII :
  (List.map
        (fun pairing =>
          ((List.map
                  (fun pf_elem =>
                    C (BabySNARK.verificationPairingProof_G1 stmt ChecksIdx.CheckII pairing pf_elem) *
                      (List.map (fun SRS_elem => C (prover.1 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
                          BabySNARK.ListSRSElements_G1).sum)
                  BabySNARK.ListProof_G1).sum +
              (List.map
                  (fun SRS_elem =>
                    C (BabySNARK.verificationPairingSRS_G1 stmt ChecksIdx.CheckII pairing SRS_elem) *
                      BabySNARK.SRSElementValue_G1 SRS_elem)
                  BabySNARK.ListSRSElements_G1).sum) *
            ((List.map
                  (fun pf_elem =>
                    C (BabySNARK.verificationPairingProof_G2 stmt ChecksIdx.CheckII pairing pf_elem) *
                      (List.map (fun SRS_elem => C (prover.2 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
                          BabySNARK.ListSRSElements_G2).sum)
                  BabySNARK.ListProof_G2).sum +
              (List.map
                  (fun SRS_elem =>
                    C (BabySNARK.verificationPairingSRS_G2 stmt ChecksIdx.CheckII pairing SRS_elem) *
                      BabySNARK.SRSElementValue_G2 SRS_elem)
                  BabySNARK.ListSRSElements_G2).sum))
        (BabySNARK.ListPairings ChecksIdx.CheckII)).sum =
    0
⊢ (((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_Idx.B (SRS_Elements_Idx.βu i)) prover i) * u_wit i)
                  (List.finRange n_wit)).sum) ^
            2 -
          1).modByMonic
      t =
    0
Tactic:
simp only [identified_proof_elems_def, Bool.not_eq_true, List.mem_cons, List.mem_singleton,
  forall_eq_or_imp, forall_eq] at typeI_identification
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
t : Polynomial F
ht : (List.map (fun x => Polynomial.C (t.coeff ↑x) * Polynomial.X ^ ↑x) (List.finRange n_var)).sum = t
ht0 : t.Monic
stmt : BabySNARK.Stmt
prover : Prover F BabySNARK
eqnI :
  (List.map
        (fun pairing =>
          ((List.map
                  (fun pf_elem =>
                    C (BabySNARK.verificationPairingProof_G1 stmt ChecksIdx.CheckI pairing pf_elem) *
                      (List.map (fun SRS_elem => C (prover.1 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
                          BabySNARK.ListSRSElements_G1).sum)
                  BabySNARK.ListProof_G1).sum +
              (List.map
                  (fun SRS_elem =>
                    C (BabySNARK.verificationPairingSRS_G1 stmt ChecksIdx.CheckI pairing SRS_elem) *
                      BabySNARK.SRSElementValue_G1 SRS_elem)
                  BabySNARK.ListSRSElements_G1).sum) *
            ((List.map
                  (fun pf_elem =>
                    C (BabySNARK.verificationPairingProof_G2 stmt ChecksIdx.CheckI pairing pf_elem) *
                      (List.map (fun SRS_elem => C (prover.2 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
                          BabySNARK.ListSRSElements_G2).sum)
                  BabySNARK.ListProof_G2).sum +
              (List.map
                  (fun SRS_elem =>
                    C (BabySNARK.verificationPairingSRS_G2 stmt ChecksIdx.CheckI pairing SRS_elem) *
                      BabySNARK.SRSElementValue_G2 SRS_elem)
                  BabySNARK.ListSRSElements_G2).sum))
        (BabySNARK.ListPairings ChecksIdx.CheckI)).sum =
    0
eqnII :
  (List.map
        (fun pairing =>
          ((List.map
                  (fun pf_elem =>
                    C (BabySNARK.verificationPairingProof_G1 stmt ChecksIdx.CheckII pairing pf_elem) *
                      (List.map (fun SRS_elem => C (prover.1 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
                          BabySNARK.ListSRSElements_G1).sum)
                  BabySNARK.ListProof_G1).sum +
              (List.map
                  (fun SRS_elem =>
                    C (BabySNARK.verificationPairingSRS_G1 stmt ChecksIdx.CheckII pairing SRS_elem) *
                      BabySNARK.SRSElementValue_G1 SRS_elem)
                  BabySNARK.ListSRSElements_G1).sum) *
            ((List.map
                  (fun pf_elem =>
                    C (BabySNARK.verificationPairingProof_G2 stmt ChecksIdx.CheckII pairing pf_elem) *
                      (List.map (fun SRS_elem => C (prover.2 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
                          BabySNARK.ListSRSElements_G2).sum)
                  BabySNARK.ListProof_G2).sum +
              (List.map
                  (fun SRS_elem =>
                    C (BabySNARK.verificationPairingSRS_G2 stmt ChecksIdx.CheckII pairing SRS_elem) *
                      BabySNARK.SRSElementValue_G2 SRS_elem)
                  BabySNARK.ListSRSElements_G2).sum))
        (BabySNARK.ListPairings ChecksIdx.CheckII)).sum =
    0
typeI_identification :
  (List.map (fun SRS_elem => C (prover.1 Proof_Idx.H SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
          BabySNARK.ListSRSElements_G1).sum =
      (List.map (fun SRS_elem => C (prover.2 Proof_Idx.H SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
          BabySNARK.ListSRSElements_G2).sum ∧
    (List.map (fun SRS_elem => C (prover.1 Proof_Idx.V SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
            BabySNARK.ListSRSElements_G1).sum =
        (List.map (fun SRS_elem => C (prover.2 Proof_Idx.V SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
            BabySNARK.ListSRSElements_G2).sum ∧
      (List.map (fun SRS_elem => C (prover.1 Proof_Idx.B SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
              BabySNARK.ListSRSElements_G1).sum =
          (List.map (fun SRS_elem => C (prover.2 Proof_Idx.B SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
              BabySNARK.ListSRSElements_G2).sum ∧
        ∀ a ∈ [],
          (List.map (fun SRS_elem => C (prover.1 a.1 SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
                BabySNARK.ListSRSElements_G1).sum =
            (List.map (fun SRS_elem => C (prover.2 a.2 SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
                BabySNARK.ListSRSElements_G2).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_Idx.B (SRS_Elements_Idx.βu i)) prover i) * u_wit i)
                  (List.finRange n_wit)).sum) ^
            2 -
          1).modByMonic
      t =
    0

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
t : Polynomial F
ht : (List.map (fun x => Polynomial.C (t.coeff ↑x) * Polynomial.X ^ ↑x) (List.finRange n_var)).sum = t
ht0 : t.Monic
stmt : BabySNARK.Stmt
prover : Prover F BabySNARK
eqnI :
  (List.map
        (fun pairing =>
          ((List.map
                  (fun pf_elem =>
                    C (BabySNARK.verificationPairingProof_G1 stmt ChecksIdx.CheckI pairing pf_elem) *
                      (List.map (fun SRS_elem => C (prover.1 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
                          BabySNARK.ListSRSElements_G1).sum)
                  BabySNARK.ListProof_G1).sum +
              (List.map
                  (fun SRS_elem =>
                    C (BabySNARK.verificationPairingSRS_G1 stmt ChecksIdx.CheckI pairing SRS_elem) *
                      BabySNARK.SRSElementValue_G1 SRS_elem)
                  BabySNARK.ListSRSElements_G1).sum) *
            ((List.map
                  (fun pf_elem =>
                    C (BabySNARK.verificationPairingProof_G2 stmt ChecksIdx.CheckI pairing pf_elem) *
                      (List.map (fun SRS_elem => C (prover.2 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
                          BabySNARK.ListSRSElements_G2).sum)
                  BabySNARK.ListProof_G2).sum +
              (List.map
                  (fun SRS_elem =>
                    C (BabySNARK.verificationPairingSRS_G2 stmt ChecksIdx.CheckI pairing SRS_elem) *
                      BabySNARK.SRSElementValue_G2 SRS_elem)
                  BabySNARK.ListSRSElements_G2).sum))
        (BabySNARK.ListPairings ChecksIdx.CheckI)).sum =
    0
eqnII :
  (List.map
        (fun pairing =>
          ((List.map
                  (fun pf_elem =>
                    C (BabySNARK.verificationPairingProof_G1 stmt ChecksIdx.CheckII pairing pf_elem) *
                      (List.map (fun SRS_elem => C (prover.1 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
                          BabySNARK.ListSRSElements_G1).sum)
                  BabySNARK.ListProof_G1).sum +
              (List.map
                  (fun SRS_elem =>
                    C (BabySNARK.verificationPairingSRS_G1 stmt ChecksIdx.CheckII pairing SRS_elem) *
                      BabySNARK.SRSElementValue_G1 SRS_elem)
                  BabySNARK.ListSRSElements_G1).sum) *
            ((List.map
                  (fun pf_elem =>
                    C (BabySNARK.verificationPairingProof_G2 stmt ChecksIdx.CheckII pairing pf_elem) *
                      (List.map (fun SRS_elem => C (prover.2 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
                          BabySNARK.ListSRSElements_G2).sum)
                  BabySNARK.ListProof_G2).sum +
              (List.map
                  (fun SRS_elem =>
                    C (BabySNARK.verificationPairingSRS_G2 stmt ChecksIdx.CheckII pairing SRS_elem) *
                      BabySNARK.SRSElementValue_G2 SRS_elem)
                  BabySNARK.ListSRSElements_G2).sum))
        (BabySNARK.ListPairings ChecksIdx.CheckII)).sum =
    0
typeI_identification :
  (List.map (fun SRS_elem => C (prover.1 Proof_Idx.H SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
          BabySNARK.ListSRSElements_G1).sum =
      (List.map (fun SRS_elem => C (prover.2 Proof_Idx.H SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
          BabySNARK.ListSRSElements_G2).sum ∧
    (List.map (fun SRS_elem => C (prover.1 Proof_Idx.V SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
            BabySNARK.ListSRSElements_G1).sum =
        (List.map (fun SRS_elem => C (prover.2 Proof_Idx.V SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
            BabySNARK.ListSRSElements_G2).sum ∧
      (List.map (fun SRS_elem => C (prover.1 Proof_Idx.B SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
              BabySNARK.ListSRSElements_G1).sum =
          (List.map (fun SRS_elem => C (prover.2 Proof_Idx.B SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
              BabySNARK.ListSRSElements_G2).sum ∧
        ∀ a ∈ [],
          (List.map (fun SRS_elem => C (prover.1 a.1 SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
                BabySNARK.ListSRSElements_G1).sum =
            (List.map (fun SRS_elem => C (prover.2 a.2 SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
                BabySNARK.ListSRSElements_G2).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_Idx.B (SRS_Elements_Idx.βu i)) prover i) * u_wit i)
                  (List.finRange n_wit)).sum) ^
            2 -
          1).modByMonic
      t =
    0
Tactic:
simp only [List.find?_nil, List.not_mem_nil, IsEmpty.forall_iff, Prod.forall, implies_true,
  and_true] at typeI_identification
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
t : Polynomial F
ht : (List.map (fun x => Polynomial.C (t.coeff ↑x) * Polynomial.X ^ ↑x) (List.finRange n_var)).sum = t
ht0 : t.Monic
stmt : BabySNARK.Stmt
prover : Prover F BabySNARK
eqnI :
  (List.map
        (fun pairing =>
          ((List.map
                  (fun pf_elem =>
                    C (BabySNARK.verificationPairingProof_G1 stmt ChecksIdx.CheckI pairing pf_elem) *
                      (List.map (fun SRS_elem => C (prover.1 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
                          BabySNARK.ListSRSElements_G1).sum)
                  BabySNARK.ListProof_G1).sum +
              (List.map
                  (fun SRS_elem =>
                    C (BabySNARK.verificationPairingSRS_G1 stmt ChecksIdx.CheckI pairing SRS_elem) *
                      BabySNARK.SRSElementValue_G1 SRS_elem)
                  BabySNARK.ListSRSElements_G1).sum) *
            ((List.map
                  (fun pf_elem =>
                    C (BabySNARK.verificationPairingProof_G2 stmt ChecksIdx.CheckI pairing pf_elem) *
                      (List.map (fun SRS_elem => C (prover.2 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
                          BabySNARK.ListSRSElements_G2).sum)
                  BabySNARK.ListProof_G2).sum +
              (List.map
                  (fun SRS_elem =>
                    C (BabySNARK.verificationPairingSRS_G2 stmt ChecksIdx.CheckI pairing SRS_elem) *
                      BabySNARK.SRSElementValue_G2 SRS_elem)
                  BabySNARK.ListSRSElements_G2).sum))
        (BabySNARK.ListPairings ChecksIdx.CheckI)).sum =
    0
eqnII :
  (List.map
        (fun pairing =>
          ((List.map
                  (fun pf_elem =>
                    C (BabySNARK.verificationPairingProof_G1 stmt ChecksIdx.CheckII pairing pf_elem) *
                      (List.map (fun SRS_elem => C (prover.1 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
                          BabySNARK.ListSRSElements_G1).sum)
                  BabySNARK.ListProof_G1).sum +
              (List.map
                  (fun SRS_elem =>
                    C (BabySNARK.verificationPairingSRS_G1 stmt ChecksIdx.CheckII pairing SRS_elem) *
                      BabySNARK.SRSElementValue_G1 SRS_elem)
                  BabySNARK.ListSRSElements_G1).sum) *
            ((List.map
                  (fun pf_elem =>
                    C (BabySNARK.verificationPairingProof_G2 stmt ChecksIdx.CheckII pairing pf_elem) *
                      (List.map (fun SRS_elem => C (prover.2 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
                          BabySNARK.ListSRSElements_G2).sum)
                  BabySNARK.ListProof_G2).sum +
              (List.map
                  (fun SRS_elem =>
                    C (BabySNARK.verificationPairingSRS_G2 stmt ChecksIdx.CheckII pairing SRS_elem) *
                      BabySNARK.SRSElementValue_G2 SRS_elem)
                  BabySNARK.ListSRSElements_G2).sum))
        (BabySNARK.ListPairings ChecksIdx.CheckII)).sum =
    0
typeI_identification :
  (List.map (fun SRS_elem => C (prover.1 Proof_Idx.H SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
          BabySNARK.ListSRSElements_G1).sum =
      (List.map (fun SRS_elem => C (prover.2 Proof_Idx.H SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
          BabySNARK.ListSRSElements_G2).sum ∧
    (List.map (fun SRS_elem => C (prover.1 Proof_Idx.V SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
            BabySNARK.ListSRSElements_G1).sum =
        (List.map (fun SRS_elem => C (prover.2 Proof_Idx.V SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
            BabySNARK.ListSRSElements_G2).sum ∧
      (List.map (fun SRS_elem => C (prover.1 Proof_Idx.B SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
            BabySNARK.ListSRSElements_G1).sum =
        (List.map (fun SRS_elem => C (prover.2 Proof_Idx.B SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
            BabySNARK.ListSRSElements_G2).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_Idx.B (SRS_Elements_Idx.βu i)) prover i) * u_wit i)
                  (List.finRange n_wit)).sum) ^
            2 -
          1).modByMonic
      t =
    0

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
t : Polynomial F
ht : (List.map (fun x => Polynomial.C (t.coeff ↑x) * Polynomial.X ^ ↑x) (List.finRange n_var)).sum = t
ht0 : t.Monic
stmt : BabySNARK.Stmt
prover : Prover F BabySNARK
eqnI :
  (List.map
        (fun pairing =>
          ((List.map
                  (fun pf_elem =>
                    C (BabySNARK.verificationPairingProof_G1 stmt ChecksIdx.CheckI pairing pf_elem) *
                      (List.map (fun SRS_elem => C (prover.1 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
                          BabySNARK.ListSRSElements_G1).sum)
                  BabySNARK.ListProof_G1).sum +
              (List.map
                  (fun SRS_elem =>
                    C (BabySNARK.verificationPairingSRS_G1 stmt ChecksIdx.CheckI pairing SRS_elem) *
                      BabySNARK.SRSElementValue_G1 SRS_elem)
                  BabySNARK.ListSRSElements_G1).sum) *
            ((List.map
                  (fun pf_elem =>
                    C (BabySNARK.verificationPairingProof_G2 stmt ChecksIdx.CheckI pairing pf_elem) *
                      (List.map (fun SRS_elem => C (prover.2 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
                          BabySNARK.ListSRSElements_G2).sum)
                  BabySNARK.ListProof_G2).sum +
              (List.map
                  (fun SRS_elem =>
                    C (BabySNARK.verificationPairingSRS_G2 stmt ChecksIdx.CheckI pairing SRS_elem) *
                      BabySNARK.SRSElementValue_G2 SRS_elem)
                  BabySNARK.ListSRSElements_G2).sum))
        (BabySNARK.ListPairings ChecksIdx.CheckI)).sum =
    0
eqnII :
  (List.map
        (fun pairing =>
          ((List.map
                  (fun pf_elem =>
                    C (BabySNARK.verificationPairingProof_G1 stmt ChecksIdx.CheckII pairing pf_elem) *
                      (List.map (fun SRS_elem => C (prover.1 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
                          BabySNARK.ListSRSElements_G1).sum)
                  BabySNARK.ListProof_G1).sum +
              (List.map
                  (fun SRS_elem =>
                    C (BabySNARK.verificationPairingSRS_G1 stmt ChecksIdx.CheckII pairing SRS_elem) *
                      BabySNARK.SRSElementValue_G1 SRS_elem)
                  BabySNARK.ListSRSElements_G1).sum) *
            ((List.map
                  (fun pf_elem =>
                    C (BabySNARK.verificationPairingProof_G2 stmt ChecksIdx.CheckII pairing pf_elem) *
                      (List.map (fun SRS_elem => C (prover.2 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
                          BabySNARK.ListSRSElements_G2).sum)
                  BabySNARK.ListProof_G2).sum +
              (List.map
                  (fun SRS_elem =>
                    C (BabySNARK.verificationPairingSRS_G2 stmt ChecksIdx.CheckII pairing SRS_elem) *
                      BabySNARK.SRSElementValue_G2 SRS_elem)
                  BabySNARK.ListSRSElements_G2).sum))
        (BabySNARK.ListPairings ChecksIdx.CheckII)).sum =
    0
typeI_identification :
  (List.map (fun SRS_elem => C (prover.1 Proof_Idx.H SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
          BabySNARK.ListSRSElements_G1).sum =
      (List.map (fun SRS_elem => C (prover.2 Proof_Idx.H SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
          BabySNARK.ListSRSElements_G2).sum ∧
    (List.map (fun SRS_elem => C (prover.1 Proof_Idx.V SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
            BabySNARK.ListSRSElements_G1).sum =
        (List.map (fun SRS_elem => C (prover.2 Proof_Idx.V SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
            BabySNARK.ListSRSElements_G2).sum ∧
      (List.map (fun SRS_elem => C (prover.1 Proof_Idx.B SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
            BabySNARK.ListSRSElements_G1).sum =
        (List.map (fun SRS_elem => C (prover.2 Proof_Idx.B SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
            BabySNARK.ListSRSElements_G2).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_Idx.B (SRS_Elements_Idx.βu i)) prover i) * u_wit i)
                  (List.finRange n_wit)).sum) ^
            2 -
          1).modByMonic
      t =
    0
Tactic:
rcases typeI_identification with ⟨eqnH, eqnV, eqnB⟩
State after:
case intro.intro.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
t : Polynomial F
ht : (List.map (fun x => Polynomial.C (t.coeff ↑x) * Polynomial.X ^ ↑x) (List.finRange n_var)).sum = t
ht0 : t.Monic
stmt : BabySNARK.Stmt
prover : Prover F BabySNARK
eqnI :
  (List.map
        (fun pairing =>
          ((List.map
                  (fun pf_elem =>
                    C (BabySNARK.verificationPairingProof_G1 stmt ChecksIdx.CheckI pairing pf_elem) *
                      (List.map (fun SRS_elem => C (prover.1 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
                          BabySNARK.ListSRSElements_G1).sum)
                  BabySNARK.ListProof_G1).sum +
              (List.map
                  (fun SRS_elem =>
                    C (BabySNARK.verificationPairingSRS_G1 stmt ChecksIdx.CheckI pairing SRS_elem) *
                      BabySNARK.SRSElementValue_G1 SRS_elem)
                  BabySNARK.ListSRSElements_G1).sum) *
            ((List.map
                  (fun pf_elem =>
                    C (BabySNARK.verificationPairingProof_G2 stmt ChecksIdx.CheckI pairing pf_elem) *
                      (List.map (fun SRS_elem => C (prover.2 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
                          BabySNARK.ListSRSElements_G2).sum)
                  BabySNARK.ListProof_G2).sum +
              (List.map
                  (fun SRS_elem =>
                    C (BabySNARK.verificationPairingSRS_G2 stmt ChecksIdx.CheckI pairing SRS_elem) *
                      BabySNARK.SRSElementValue_G2 SRS_elem)
                  BabySNARK.ListSRSElements_G2).sum))
        (BabySNARK.ListPairings ChecksIdx.CheckI)).sum =
    0
eqnII :
  (List.map
        (fun pairing =>
          ((List.map
                  (fun pf_elem =>
                    C (BabySNARK.verificationPairingProof_G1 stmt ChecksIdx.CheckII pairing pf_elem) *
                      (List.map (fun SRS_elem => C (prover.1 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
                          BabySNARK.ListSRSElements_G1).sum)
                  BabySNARK.ListProof_G1).sum +
              (List.map
                  (fun SRS_elem =>
                    C (BabySNARK.verificationPairingSRS_G1 stmt ChecksIdx.CheckII pairing SRS_elem) *
                      BabySNARK.SRSElementValue_G1 SRS_elem)
                  BabySNARK.ListSRSElements_G1).sum) *
            ((List.map
                  (fun pf_elem =>
                    C (BabySNARK.verificationPairingProof_G2 stmt ChecksIdx.CheckII pairing pf_elem) *
                      (List.map (fun SRS_elem => C (prover.2 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
                          BabySNARK.ListSRSElements_G2).sum)
                  BabySNARK.ListProof_G2).sum +
              (List.map
                  (fun SRS_elem =>
                    C (BabySNARK.verificationPairingSRS_G2 stmt ChecksIdx.CheckII pairing SRS_elem) *
                      BabySNARK.SRSElementValue_G2 SRS_elem)
                  BabySNARK.ListSRSElements_G2).sum))
        (BabySNARK.ListPairings ChecksIdx.CheckII)).sum =
    0
eqnH :
  (List.map (fun SRS_elem => C (prover.1 Proof_Idx.H SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
        BabySNARK.ListSRSElements_G1).sum =
    (List.map (fun SRS_elem => C (prover.2 Proof_Idx.H SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
        BabySNARK.ListSRSElements_G2).sum
eqnV :
  (List.map (fun SRS_elem => C (prover.1 Proof_Idx.V SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
        BabySNARK.ListSRSElements_G1).sum =
    (List.map (fun SRS_elem => C (prover.2 Proof_Idx.V SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
        BabySNARK.ListSRSElements_G2).sum
eqnB :
  (List.map (fun SRS_elem => C (prover.1 Proof_Idx.B SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
        BabySNARK.ListSRSElements_G1).sum =
    (List.map (fun SRS_elem => C (prover.2 Proof_Idx.B SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
        BabySNARK.ListSRSElements_G2).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_Idx.B (SRS_Elements_Idx.βu i)) prover i) * u_wit i)
                  (List.finRange n_wit)).sum) ^
            2 -
          1).modByMonic
      t =
    0

State before:
case intro.intro.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
t : Polynomial F
ht : (List.map (fun x => Polynomial.C (t.coeff ↑x) * Polynomial.X ^ ↑x) (List.finRange n_var)).sum = t
ht0 : t.Monic
stmt : BabySNARK.Stmt
prover : Prover F BabySNARK
eqnI :
  (List.map
        (fun pairing =>
          ((List.map
                  (fun pf_elem =>
                    C (BabySNARK.verificationPairingProof_G1 stmt ChecksIdx.CheckI pairing pf_elem) *
                      (List.map (fun SRS_elem => C (prover.1 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
                          BabySNARK.ListSRSElements_G1).sum)
                  BabySNARK.ListProof_G1).sum +
              (List.map
                  (fun SRS_elem =>
                    C (BabySNARK.verificationPairingSRS_G1 stmt ChecksIdx.CheckI pairing SRS_elem) *
                      BabySNARK.SRSElementValue_G1 SRS_elem)
                  BabySNARK.ListSRSElements_G1).sum) *
            ((List.map
                  (fun pf_elem =>
                    C (BabySNARK.verificationPairingProof_G2 stmt ChecksIdx.CheckI pairing pf_elem) *
                      (List.map (fun SRS_elem => C (prover.2 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
                          BabySNARK.ListSRSElements_G2).sum)
                  BabySNARK.ListProof_G2).sum +
              (List.map
                  (fun SRS_elem =>
                    C (BabySNARK.verificationPairingSRS_G2 stmt ChecksIdx.CheckI pairing SRS_elem) *
                      BabySNARK.SRSElementValue_G2 SRS_elem)
                  BabySNARK.ListSRSElements_G2).sum))
        (BabySNARK.ListPairings ChecksIdx.CheckI)).sum =
    0
eqnII :
  (List.map
        (fun pairing =>
          ((List.map
                  (fun pf_elem =>
                    C (BabySNARK.verificationPairingProof_G1 stmt ChecksIdx.CheckII pairing pf_elem) *
                      (List.map (fun SRS_elem => C (prover.1 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
                          BabySNARK.ListSRSElements_G1).sum)
                  BabySNARK.ListProof_G1).sum +
              (List.map
                  (fun SRS_elem =>
                    C (BabySNARK.verificationPairingSRS_G1 stmt ChecksIdx.CheckII pairing SRS_elem) *
                      BabySNARK.SRSElementValue_G1 SRS_elem)
                  BabySNARK.ListSRSElements_G1).sum) *
            ((List.map
                  (fun pf_elem =>
                    C (BabySNARK.verificationPairingProof_G2 stmt ChecksIdx.CheckII pairing pf_elem) *
                      (List.map (fun SRS_elem => C (prover.2 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
                          BabySNARK.ListSRSElements_G2).sum)
                  BabySNARK.ListProof_G2).sum +
              (List.map
                  (fun SRS_elem =>
                    C (BabySNARK.verificationPairingSRS_G2 stmt ChecksIdx.CheckII pairing SRS_elem) *
                      BabySNARK.SRSElementValue_G2 SRS_elem)
                  BabySNARK.ListSRSElements_G2).sum))
        (BabySNARK.ListPairings ChecksIdx.CheckII)).sum =
    0
eqnH :
  (List.map (fun SRS_elem => C (prover.1 Proof_Idx.H SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
        BabySNARK.ListSRSElements_G1).sum =
    (List.map (fun SRS_elem => C (prover.2 Proof_Idx.H SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
        BabySNARK.ListSRSElements_G2).sum
eqnV :
  (List.map (fun SRS_elem => C (prover.1 Proof_Idx.V SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
        BabySNARK.ListSRSElements_G1).sum =
    (List.map (fun SRS_elem => C (prover.2 Proof_Idx.V SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
        BabySNARK.ListSRSElements_G2).sum
eqnB :
  (List.map (fun SRS_elem => C (prover.1 Proof_Idx.B SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
        BabySNARK.ListSRSElements_G1).sum =
    (List.map (fun SRS_elem => C (prover.2 Proof_Idx.B SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
        BabySNARK.ListSRSElements_G2).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_Idx.B (SRS_Elements_Idx.βu i)) prover i) * u_wit i)
                  (List.finRange n_wit)).sum) ^
            2 -
          1).modByMonic
      t =
    0
Tactic:
suffices
    (((List.sum (List.map (fun i => Polynomial.C (stmt i) * u_stmt i) (List.finRange n_stmt)))
          + (List.sum (List.map (fun i => Polynomial.C (prover.fst Proof_Idx.B (SRS_Elements_Idx.βu i)) * u_wit i) (List.finRange n_wit)))) ^ 2
        - 1
      )
    =
    t * (List.sum (List.map (fun i => Polynomial.C (prover.fst Proof_Idx.H (SRS_Elements_Idx.βu i)) * u_wit i) (List.finRange n_wit))) by
  rw [this]
  apply Polynomial.mul_self_modByMonic
  assumption
State after:
case intro.intro.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
t : Polynomial F
ht : (List.map (fun x => Polynomial.C (t.coeff ↑x) * Polynomial.X ^ ↑x) (List.finRange n_var)).sum = t
ht0 : t.Monic
stmt : BabySNARK.Stmt
prover : Prover F BabySNARK
eqnI :
  (List.map
        (fun pairing =>
          ((List.map
                  (fun pf_elem =>
                    C (BabySNARK.verificationPairingProof_G1 stmt ChecksIdx.CheckI pairing pf_elem) *
                      (List.map (fun SRS_elem => C (prover.1 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
                          BabySNARK.ListSRSElements_G1).sum)
                  BabySNARK.ListProof_G1).sum +
              (List.map
                  (fun SRS_elem =>
                    C (BabySNARK.verificationPairingSRS_G1 stmt ChecksIdx.CheckI pairing SRS_elem) *
                      BabySNARK.SRSElementValue_G1 SRS_elem)
                  BabySNARK.ListSRSElements_G1).sum) *
            ((List.map
                  (fun pf_elem =>
                    C (BabySNARK.verificationPairingProof_G2 stmt ChecksIdx.CheckI pairing pf_elem) *
                      (List.map (fun SRS_elem => C (prover.2 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
                          BabySNARK.ListSRSElements_G2).sum)
                  BabySNARK.ListProof_G2).sum +
              (List.map
                  (fun SRS_elem =>
                    C (BabySNARK.verificationPairingSRS_G2 stmt ChecksIdx.CheckI pairing SRS_elem) *
                      BabySNARK.SRSElementValue_G2 SRS_elem)
                  BabySNARK.ListSRSElements_G2).sum))
        (BabySNARK.ListPairings ChecksIdx.CheckI)).sum =
    0
eqnII :
  (List.map
        (fun pairing =>
          ((List.map
                  (fun pf_elem =>
                    C (BabySNARK.verificationPairingProof_G1 stmt ChecksIdx.CheckII pairing pf_elem) *
                      (List.map (fun SRS_elem => C (prover.1 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
                          BabySNARK.ListSRSElements_G1).sum)
                  BabySNARK.ListProof_G1).sum +
              (List.map
                  (fun SRS_elem =>
                    C (BabySNARK.verificationPairingSRS_G1 stmt ChecksIdx.CheckII pairing SRS_elem) *
                      BabySNARK.SRSElementValue_G1 SRS_elem)
                  BabySNARK.ListSRSElements_G1).sum) *
            ((List.map
                  (fun pf_elem =>
                    C (BabySNARK.verificationPairingProof_G2 stmt ChecksIdx.CheckII pairing pf_elem) *
                      (List.map (fun SRS_elem => C (prover.2 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
                          BabySNARK.ListSRSElements_G2).sum)
                  BabySNARK.ListProof_G2).sum +
              (List.map
                  (fun SRS_elem =>
                    C (BabySNARK.verificationPairingSRS_G2 stmt ChecksIdx.CheckII pairing SRS_elem) *
                      BabySNARK.SRSElementValue_G2 SRS_elem)
                  BabySNARK.ListSRSElements_G2).sum))
        (BabySNARK.ListPairings ChecksIdx.CheckII)).sum =
    0
eqnH :
  (List.map (fun SRS_elem => C (prover.1 Proof_Idx.H SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
        BabySNARK.ListSRSElements_G1).sum =
    (List.map (fun SRS_elem => C (prover.2 Proof_Idx.H SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
        BabySNARK.ListSRSElements_G2).sum
eqnV :
  (List.map (fun SRS_elem => C (prover.1 Proof_Idx.V SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
        BabySNARK.ListSRSElements_G1).sum =
    (List.map (fun SRS_elem => C (prover.2 Proof_Idx.V SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
        BabySNARK.ListSRSElements_G2).sum
eqnB :
  (List.map (fun SRS_elem => C (prover.1 Proof_Idx.B SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
        BabySNARK.ListSRSElements_G1).sum =
    (List.map (fun SRS_elem => C (prover.2 Proof_Idx.B SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
        BabySNARK.ListSRSElements_G2).sum
⊢ ((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_Idx.B (SRS_Elements_Idx.βu i)) * u_wit i)
              (List.finRange n_wit)).sum) ^
        2 -
      1 =
    t *
      (List.map (fun i => Polynomial.C (prover.1 Proof_Idx.H (SRS_Elements_Idx.βu i)) * u_wit i)
          (List.finRange n_wit)).sum

State before:
case intro.intro.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
t : Polynomial F
ht : (List.map (fun x => Polynomial.C (t.coeff ↑x) * Polynomial.X ^ ↑x) (List.finRange n_var)).sum = t
ht0 : t.Monic
stmt : BabySNARK.Stmt
prover : Prover F BabySNARK
eqnI :
  (List.map
        (fun pairing =>
          ((List.map
                  (fun pf_elem =>
                    C (BabySNARK.verificationPairingProof_G1 stmt ChecksIdx.CheckI pairing pf_elem) *
                      (List.map (fun SRS_elem => C (prover.1 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
                          BabySNARK.ListSRSElements_G1).sum)
                  BabySNARK.ListProof_G1).sum +
              (List.map
                  (fun SRS_elem =>
                    C (BabySNARK.verificationPairingSRS_G1 stmt ChecksIdx.CheckI pairing SRS_elem) *
                      BabySNARK.SRSElementValue_G1 SRS_elem)
                  BabySNARK.ListSRSElements_G1).sum) *
            ((List.map
                  (fun pf_elem =>
                    C (BabySNARK.verificationPairingProof_G2 stmt ChecksIdx.CheckI pairing pf_elem) *
                      (List.map (fun SRS_elem => C (prover.2 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
                          BabySNARK.ListSRSElements_G2).sum)
                  BabySNARK.ListProof_G2).sum +
              (List.map
                  (fun SRS_elem =>
                    C (BabySNARK.verificationPairingSRS_G2 stmt ChecksIdx.CheckI pairing SRS_elem) *
                      BabySNARK.SRSElementValue_G2 SRS_elem)
                  BabySNARK.ListSRSElements_G2).sum))
        (BabySNARK.ListPairings ChecksIdx.CheckI)).sum =
    0
eqnII :
  (List.map
        (fun pairing =>
          ((List.map
                  (fun pf_elem =>
                    C (BabySNARK.verificationPairingProof_G1 stmt ChecksIdx.CheckII pairing pf_elem) *
                      (List.map (fun SRS_elem => C (prover.1 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
                          BabySNARK.ListSRSElements_G1).sum)
                  BabySNARK.ListProof_G1).sum +
              (List.map
                  (fun SRS_elem =>
                    C (BabySNARK.verificationPairingSRS_G1 stmt ChecksIdx.CheckII pairing SRS_elem) *
                      BabySNARK.SRSElementValue_G1 SRS_elem)
                  BabySNARK.ListSRSElements_G1).sum) *
            ((List.map
                  (fun pf_elem =>
                    C (BabySNARK.verificationPairingProof_G2 stmt ChecksIdx.CheckII pairing pf_elem) *
                      (List.map (fun SRS_elem => C (prover.2 pf_elem SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
                          BabySNARK.ListSRSElements_G2).sum)
                  BabySNARK.ListProof_G2).sum +
              (List.map
                  (fun SRS_elem =>
                    C (BabySNARK.verificationPairingSRS_G2 stmt ChecksIdx.CheckII pairing SRS_elem) *
                      BabySNARK.SRSElementValue_G2 SRS_elem)
                  BabySNARK.ListSRSElements_G2).sum))
        (BabySNARK.ListPairings ChecksIdx.CheckII)).sum =
    0
eqnH :
  (List.map (fun SRS_elem => C (prover.1 Proof_Idx.H SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
        BabySNARK.ListSRSElements_G1).sum =
    (List.map (fun SRS_elem => C (prover.2 Proof_Idx.H SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
        BabySNARK.ListSRSElements_G2).sum
eqnV :
  (List.map (fun SRS_elem => C (prover.1 Proof_Idx.V SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
        BabySNARK.ListSRSElements_G1).sum =
    (List.map (fun SRS_elem => C (prover.2 Proof_Idx.V SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
        BabySNARK.ListSRSElements_G2).sum
eqnB :
  (List.map (fun SRS_elem => C (prover.1 Proof_Idx.B SRS_elem) * BabySNARK.SRSElementValue_G1 SRS_elem)
        BabySNARK.ListSRSElements_G1).sum =
    (List.map (fun SRS_elem => C (prover.2 Proof_Idx.B SRS_elem) * BabySNARK.SRSElementValue_G2 SRS_elem)
        BabySNARK.ListSRSElements_G2).sum
⊢ ((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_Idx.B (SRS_Elements_Idx.βu i)) * u_wit i)
              (List.finRange n_wit)).sum) ^
        2 -
      1 =
    t *
      (List.map (fun i => Polynomial.C (prover.1 Proof_Idx.H (SRS_Elements_Idx.βu i)) * u_wit i)
          (List.finRange n_wit)).sum
Tactic:
simp_rw [BabySNARK] at eqnI eqnII eqnH eqnV eqnB
State after:
case intro.intro.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
t : Polynomial F
ht : (List.map (fun x => Polynomial.C (t.coeff ↑x) * Polynomial.X ^ ↑x) (List.finRange n_var)).sum = t
ht0 : t.Monic
stmt : BabySNARK.Stmt
prover : Prover F BabySNARK
eqnI :
  (List.map
        (fun pairing =>
          ((List.map
                  (fun pf_elem =>
                    C
                        (match pairing with
                        | PairingsI_Idx.ht =>
                          match pf_elem with
                          | Proof_Idx.H => 1
                          | Proof_Idx.V => 0
                          | Proof_Idx.B => 0
                        | PairingsI_Idx.gg =>
                          match pf_elem with
                          | Proof_Idx.H => 0
                          | Proof_Idx.V => 0
                          | Proof_Idx.B => 0
                        | PairingsI_Idx.vv =>
                          match pf_elem with
                          | Proof_Idx.H => 0
                          | Proof_Idx.V => 1
                          | Proof_Idx.B => 0) *
                      (List.map
                          (fun SRS_elem =>
                            C (prover.1 pf_elem SRS_elem) *
                              match SRS_elem with
                              | SRS_Elements_Idx.τ_pow i => X Vars_τ ^ ↑i
                              | SRS_Elements_Idx.γ => X Vars_β
                              | SRS_Elements_Idx.γβ => X Vars_γ * X Vars_β
                              | SRS_Elements_Idx.βu i => X Vars_β * (to_MvPolynomial_Option Vars) (u_wit i))
                          (List.map (fun i => SRS_Elements_Idx.τ_pow i) (List.finRange n_var) ++ [SRS_Elements_Idx.γ] ++
                              [SRS_Elements_Idx.γβ] ++
                            List.map (fun i => SRS_Elements_Idx.βu i) (List.finRange n_wit))).sum)
                  [Proof_Idx.H, Proof_Idx.V, Proof_Idx.B]).sum +
              (List.map
                  (fun SRS_elem =>
                    C
                        (match pairing with
                        | PairingsI_Idx.ht =>
                          match SRS_elem with
                          | SRS_Elements_Idx.τ_pow i => t.coeff ↑i
                          | SRS_Elements_Idx.γ => 0
                          | SRS_Elements_Idx.γβ => 0
                          | SRS_Elements_Idx.βu a => 0
                        | PairingsI_Idx.gg =>
                          match SRS_elem with
                          | SRS_Elements_Idx.τ_pow i => if ↑i = 0 then 1 else 0
                          | SRS_Elements_Idx.γ => 0
                          | SRS_Elements_Idx.γβ => 0
                          | SRS_Elements_Idx.βu a => 0
                        | PairingsI_Idx.vv =>
                          match SRS_elem with
                          | SRS_Elements_Idx.τ_pow i =>
                            (List.map (fun j => stmt j * (u_stmt j).coeff ↑i) (List.finRange n_stmt)).sum
                          | SRS_Elements_Idx.γ => 0
                          | SRS_Elements_Idx.γβ => 0
                          | SRS_Elements_Idx.βu a => 0) *
                      match SRS_elem with
                      | SRS_Elements_Idx.τ_pow i => X Vars_τ ^ ↑i
                      | SRS_Elements_Idx.γ => X Vars_β
                      | SRS_Elements_Idx.γβ => X Vars_γ * X Vars_β
                      | SRS_Elements_Idx.βu i => X Vars_β * (to_MvPolynomial_Option Vars) (u_wit i))
                  (List.map (fun i => SRS_Elements_Idx.τ_pow i) (List.finRange n_var) ++ [SRS_Elements_Idx.γ] ++
                      [SRS_Elements_Idx.γβ] ++
                    List.map (fun i => SRS_Elements_Idx.βu i) (List.finRange n_wit))).sum) *
            ((List.map
                  (fun pf_elem =>
                    C
                        (match pairing with
                        | PairingsI_Idx.ht =>
                          match pf_elem with
                          | Proof_Idx.H => 0
                          | Proof_Idx.V => 0
                          | Proof_Idx.B => 0
                        | PairingsI_Idx.gg =>
                          match pf_elem with
                          | Proof_Idx.H => 0
                          | Proof_Idx.V => 0
                          | Proof_Idx.B => 0
                        | PairingsI_Idx.vv =>
                          match pf_elem with
                          | Proof_Idx.H => 0
                          | Proof_Idx.V => -1
                          | Proof_Idx.B => 0) *
                      (List.map
                          (fun SRS_elem =>
                            C (prover.2 pf_elem SRS_elem) *
                              match SRS_elem with
                              | SRS_Elements_Idx.τ_pow i => X Vars_τ ^ ↑i
                              | SRS_Elements_Idx.γ => X Vars_β
                              | SRS_Elements_Idx.γβ => X Vars_γ * X Vars_β
                              | SRS_Elements_Idx.βu i => X Vars_β * (to_MvPolynomial_Option Vars) (u_wit i))
                          (List.map (fun i => SRS_Elements_Idx.τ_pow i) (List.finRange n_var) ++ [SRS_Elements_Idx.γ] ++
                              [SRS_Elements_Idx.γβ] ++
                            List.map (fun i => SRS_Elements_Idx.βu i) (List.finRange n_wit))).sum)
                  [Proof_Idx.H, Proof_Idx.V, Proof_Idx.B]).sum +
              (List.map
                  (fun SRS_elem =>
                    C
                        (match pairing with
                        | PairingsI_Idx.ht =>
                          match SRS_elem with
                          | SRS_Elements_Idx.τ_pow i => t.coeff ↑i
                          | SRS_Elements_Idx.γ => 0
                          | SRS_Elements_Idx.γβ => 0
                          | SRS_Elements_Idx.βu a => 0
                        | PairingsI_Idx.gg =>
                          match SRS_elem with
                          | SRS_Elements_Idx.τ_pow i => if ↑i = 0 then 1 else 0
                          | SRS_Elements_Idx.γ => 0
                          | SRS_Elements_Idx.γβ => 0
                          | SRS_Elements_Idx.βu a => 0
                        | PairingsI_Idx.vv =>
                          match SRS_elem with
                          | SRS_Elements_Idx.τ_pow i =>
                            -(List.map (fun j => stmt j * (u_stmt j).coeff ↑i) (List.finRange n_stmt)).sum
                          | SRS_Elements_Idx.γ => 0
                          | SRS_Elements_Idx.γβ => 0
                          | SRS_Elements_Idx.βu a => 0) *
                      match SRS_elem with
                      | SRS_Elements_Idx.τ_pow i => X Vars_τ ^ ↑i
                      | SRS_Elements_Idx.γ => X Vars_β
                      | SRS_Elements_Idx.γβ => X Vars_γ * X Vars_β
                      | SRS_Elements_Idx.βu i => X Vars_β * (to_MvPolynomial_Option Vars) (u_wit i))
                  (List.map (fun i => SRS_Elements_Idx.τ_pow i) (List.finRange n_var) ++ [SRS_Elements_Idx.γ] ++
                      [SRS_Elements_Idx.γβ] ++
                    List.map (fun i => SRS_Elements_Idx.βu i) (List.finRange n_wit))).sum))
        [PairingsI_Idx.ht, PairingsI_Idx.gg, PairingsI_Idx.vv]).sum =
    0
eqnII :
  (List.map
        (fun pairing =>
          ((List.map
                  (fun pf_elem =>
                    C
                        (match pairing with
                        | PairingsII_Idx.bγ =>
                          match pf_elem with
                          | Proof_Idx.H => 0
                          | Proof_Idx.V => 0
                          | Proof_Idx.B => 1
                        | PairingsII_Idx.γβv =>
                          match pf_elem with
                          | Proof_Idx.H => 0
                          | Proof_Idx.V => 0
                          | Proof_Idx.B => 0) *
                      (List.map
                          (fun SRS_elem =>
                            C (prover.1 pf_elem SRS_elem) *
                              match SRS_elem with
                              | SRS_Elements_Idx.τ_pow i => X Vars_τ ^ ↑i
                              | SRS_Elements_Idx.γ => X Vars_β
                              | SRS_Elements_Idx.γβ => X Vars_γ * X Vars_β
                              | SRS_Elements_Idx.βu i => X Vars_β * (to_MvPolynomial_Option Vars) (u_wit i))
                          (List.map (fun i => SRS_Elements_Idx.τ_pow i) (List.finRange n_var) ++ [SRS_Elements_Idx.γ] ++
                              [SRS_Elements_Idx.γβ] ++
                            List.map (fun i => SRS_Elements_Idx.βu i) (List.finRange n_wit))).sum)
                  [Proof_Idx.H, Proof_Idx.V, Proof_Idx.B]).sum +
              (List.map
                  (fun SRS_elem =>
                    C
                        (match pairing with
                        | PairingsII_Idx.bγ =>
                          match SRS_elem with
                          | SRS_Elements_Idx.τ_pow a => 0
                          | SRS_Elements_Idx.γ => 0
                          | SRS_Elements_Idx.γβ => 0
                          | SRS_Elements_Idx.βu a => 0
                        | PairingsII_Idx.γβv =>
                          match SRS_elem with
                          | SRS_Elements_Idx.τ_pow a => 0
                          | SRS_Elements_Idx.γ => 0
                          | SRS_Elements_Idx.γβ => 1
                          | SRS_Elements_Idx.βu a => 0) *
                      match SRS_elem with
                      | SRS_Elements_Idx.τ_pow i => X Vars_τ ^ ↑i
                      | SRS_Elements_Idx.γ => X Vars_β
                      | SRS_Elements_Idx.γβ => X Vars_γ * X Vars_β
                      | SRS_Elements_Idx.βu i => X Vars_β * (to_MvPolynomial_Option Vars) (u_wit i))
                  (List.map (fun i => SRS_Elements_Idx.τ_pow i) (List.finRange n_var) ++ [SRS_Elements_Idx.γ] ++
                      [SRS_Elements_Idx.γβ] ++
                    List.map (fun i => SRS_Elements_Idx.βu i) (List.finRange n_wit))).sum) *
            ((List.map
                  (fun pf_elem =>
                    C
                        (match pairing with
                        | PairingsII_Idx.bγ =>
                          match pf_elem with
                          | Proof_Idx.H => 0
                          | Proof_Idx.V => 0
                          | Proof_Idx.B => 0
                        | PairingsII_Idx.γβv =>
                          match pf_elem with
                          | Proof_Idx.H => 0
                          | Proof_Idx.V => -1
                          | Proof_Idx.B => 0) *
                      (List.map
                          (fun SRS_elem =>
                            C (prover.2 pf_elem SRS_elem) *
                              match SRS_elem with
                              | SRS_Elements_Idx.τ_pow i => X Vars_τ ^ ↑i
                              | SRS_Elements_Idx.γ => X Vars_β
                              | SRS_Elements_Idx.γβ => X Vars_γ * X Vars_β
                              | SRS_Elements_Idx.βu i => X Vars_β * (to_MvPolynomial_Option Vars) (u_wit i))
                          (List.map (fun i => SRS_Elements_Idx.τ_pow i) (List.finRange n_var) ++ [SRS_Elements_Idx.γ] ++
                              [SRS_Elements_Idx.γβ] ++
                            List.map (fun i => SRS_Elements_Idx.βu i) (List.finRange n_wit))).sum)
                  [Proof_Idx.H, Proof_Idx.V, Proof_Idx.B]).sum +
              (List.map
                  (fun SRS_elem =>
                    C
                        (match pairing with
                        | PairingsII_Idx.bγ =>
                          match SRS_elem with
                          | SRS_Elements_Idx.τ_pow a => 0
                          | SRS_Elements_Idx.γ => 1
                          | SRS_Elements_Idx.γβ => 0
                          | SRS_Elements_Idx.βu a => 0
                        | PairingsII_Idx.γβv =>
                          match SRS_elem with
                          | SRS_Elements_Idx.τ_pow a => 0
                          | SRS_Elements_Idx.γ => 0
                          | SRS_Elements_Idx.γβ => 0
                          | SRS_Elements_Idx.βu a => 0) *
                      match SRS_elem with
                      | SRS_Elements_Idx.τ_pow i => X Vars_τ ^ ↑i
                      | SRS_Elements_Idx.γ => X Vars_β
                      | SRS_Elements_Idx.γβ => X Vars_γ * X Vars_β
                      | SRS_Elements_Idx.βu i => X Vars_β * (to_MvPolynomial_Option Vars) (u_wit i))
                  (List.map (fun i => SRS_Elements_Idx.τ_pow i) (List.finRange n_var) ++ [SRS_Elements_Idx.γ] ++
                      [SRS_Elements_Idx.γβ] ++
                    List.map (fun i => SRS_Elements_Idx.βu i) (List.finRange n_wit))).sum))
        [PairingsII_Idx.bγ, PairingsII_Idx.γβv]).sum =
    0
eqnH :
  (List.map
        (fun SRS_elem =>
          C (prover.1 Proof_Idx.H SRS_elem) *
            match SRS_elem with
            | SRS_Elements_Idx.τ_pow i => X Vars_τ ^ ↑i
            | SRS_Elements_Idx.γ => X Vars_β
            | SRS_Elements_Idx.γβ => X Vars_γ * X Vars_β
            | SRS_Elements_Idx.βu i => X Vars_β * (to_MvPolynomial_Option Vars) (u_wit i))
        (List.map (fun i => SRS_Elements_Idx.τ_pow i) (List.finRange n_var) ++ [SRS_Elements_Idx.γ] ++
            [SRS_Elements_Idx.γβ] ++
          List.map (fun i => SRS_Elements_Idx.βu i) (List.finRange n_wit))).sum =
    (List.map
        (fun SRS_elem =>
          C (prover.2 Proof_Idx.H SRS_elem) *
            match SRS_elem with
            | SRS_Elements_Idx.τ_pow i => X Vars_τ ^ ↑i
            | SRS_Elements_Idx.γ => X Vars_β
            | SRS_Elements_Idx.γβ => X Vars_γ * X Vars_β
            | SRS_Elements_Idx.βu i => X Vars_β * (to_MvPolynomial_Option Vars) (u_wit i))
        (List.map (fun i => SRS_Elements_Idx.τ_pow i) (List.finRange n_var) ++ [SRS_Elements_Idx.γ] ++
            [SRS_Elements_Idx.γβ] ++
          List.map (fun i => SRS_Elements_Idx.βu i) (List.finRange n_wit))).sum
eqnV :
  (List.map
        (fun SRS_elem =>
          C (prover.1 Proof_Idx.V SRS_elem) *
            match SRS_elem with
            | SRS_Elements_Idx.τ_pow i => X Vars_τ ^ ↑i
            | SRS_Elements_Idx.γ => X Vars_β
            | SRS_Elements_Idx.γβ => X Vars_γ * X Vars_β
            | SRS_Elements_Idx.βu i => X Vars_β * (to_MvPolynomial_Option Vars) (u_wit i))
        (List.map (fun i => SRS_Elements_Idx.τ_pow i) (List.finRange n_var) ++ [SRS_Elements_Idx.γ] ++
            [SRS_Elements_Idx.γβ] ++
          List.map (fun i => SRS_Elements_Idx.βu i) (List.finRange n_wit))).sum =
    (List.map
        (fun SRS_elem =>
          C (prover.2 Proof_Idx.V SRS_elem) *
            match SRS_elem with
            | SRS_Elements_Idx.τ_pow i => X Vars_τ ^ ↑i
            | SRS_Elements_Idx.γ => X Vars_β
            | SRS_Elements_Idx.γβ => X Vars_γ * X Vars_β
            | SRS_Elements_Idx.βu i => X Vars_β * (to_MvPolynomial_Option Vars) (u_wit i))
        (List.map (fun i => SRS_Elements_Idx.τ_pow i) (List.finRange n_var) ++ [SRS_Elements_Idx.γ] ++
            [SRS_Elements_Idx.γβ] ++
          List.map (fun i => SRS_Elements_Idx.βu i) (List.finRange n_wit))).sum
eqnB :
  (List.map
        (fun SRS_elem =>
          C (prover.1 Proof_Idx.B SRS_elem) *
            match SRS_elem with
            | SRS_Elements_Idx.τ_pow i => X Vars_τ ^ ↑i
            | SRS_Elements_Idx.γ => X Vars_β
            | SRS_Elements_Idx.γβ => X Vars_γ * X Vars_β
            | SRS_Elements_Idx.βu i => X Vars_β * (to_MvPolynomial_Option Vars) (u_wit i))
        (List.map (fun i => SRS_Elements_Idx.τ_pow i) (List.finRange n_var) ++ [SRS_Elements_Idx.γ] ++
            [SRS_Elements_Idx.γβ] ++
          List.map (fun i => SRS_Elements_Idx.βu i) (List.finRange n_wit))).sum =
    (List.map
        (fun SRS_elem =>
          C (prover.2 Proof_Idx.B SRS_elem) *
            match SRS_elem with
            | SRS_Elements_Idx.τ_pow i => X Vars_τ ^ ↑i
            | SRS_Elements_Idx.γ => X Vars_β
            | SRS_Elements_Idx.γβ => X Vars_γ * X Vars_β
            | SRS_Elements_Idx.βu i => X Vars_β * (to_MvPolynomial_Option Vars) (u_wit i))
        (List.map (fun i => SRS_Elements_Idx.τ_pow i) (List.finRange n_var) ++ [SRS_Elements_Idx.γ] ++
            [SRS_Elements_Idx.γβ] ++
          List.map (fun i => SRS_Elements_Idx.βu i) (List.finRange n_wit))).sum
⊢ ((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_Idx.B (SRS_Elements_Idx.βu i)) * u_wit i)
              (List.finRange n_wit)).sum) ^
        2 -
      1 =
    t *
      (List.map (fun i => Polynomial.C (prover.1 Proof_Idx.H (SRS_Elements_Idx.βu i)) * u_wit i)
          (List.finRange n_wit)).sum

State before:
case intro.intro.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
t : Polynomial F
ht : (List.map (fun x => Polynomial.C (t.coeff ↑x) * Polynomial.X ^ ↑x) (List.finRange n_var)).sum = t
ht0 : t.Monic
stmt : BabySNARK.Stmt
prover : Prover F BabySNARK
eqnI :
  (List.map
        (fun pairing =>
          ((List.map
                  (fun pf_elem =>
                    C
                        (match pairing with
                        | PairingsI_Idx.ht =>
                          match pf_elem with
                          | Proof_Idx.H => 1
                          | Proof_Idx.V => 0
                          | Proof_Idx.B => 0
                        | PairingsI_Idx.gg =>
                          match pf_elem with
                          | Proof_Idx.H => 0
                          | Proof_Idx.V => 0
                          | Proof_Idx.B => 0
                        | PairingsI_Idx.vv =>
                          match pf_elem with
                          | Proof_Idx.H => 0
                          | Proof_Idx.V => 1
                          | Proof_Idx.B => 0) *
                      (List.map
                          (fun SRS_elem =>
                            C (prover.1 pf_elem SRS_elem) *
                              match SRS_elem with
                              | SRS_Elements_Idx.τ_pow i => X Vars_τ ^ ↑i
                              | SRS_Elements_Idx.γ => X Vars_β
                              | SRS_Elements_Idx.γβ => X Vars_γ * X Vars_β
                              | SRS_Elements_Idx.βu i => X Vars_β * (to_MvPolynomial_Option Vars) (u_wit i))
                          (List.map (fun i => SRS_Elements_Idx.τ_pow i) (List.finRange n_var) ++ [SRS_Elements_Idx.γ] ++
                              [SRS_Elements_Idx.γβ] ++
                            List.map (fun i => SRS_Elements_Idx.βu i) (List.finRange n_wit))).sum)
                  [Proof_Idx.H, Proof_Idx.V, Proof_Idx.B]).sum +
              (List.map
                  (fun SRS_elem =>
                    C
                        (match pairing with
                        | PairingsI_Idx.ht =>
                          match SRS_elem with
                          | SRS_Elements_Idx.τ_pow i => t.coeff ↑i
                          | SRS_Elements_Idx.γ => 0
                          | SRS_Elements_Idx.γβ => 0
                          | SRS_Elements_Idx.βu a => 0
                        | PairingsI_Idx.gg =>
                          match SRS_elem with
                          | SRS_Elements_Idx.τ_pow i => if ↑i = 0 then 1 else 0
                          | SRS_Elements_Idx.γ => 0
                          | SRS_Elements_Idx.γβ => 0
                          | SRS_Elements_Idx.βu a => 0
                        | PairingsI_Idx.vv =>
                          match SRS_elem with
                          | SRS_Elements_Idx.τ_pow i =>
                            (List.map (fun j => stmt j * (u_stmt j).coeff ↑i) (List.finRange n_stmt)).sum
                          | SRS_Elements_Idx.γ => 0
                          | SRS_Elements_Idx.γβ => 0
                          | SRS_Elements_Idx.βu a => 0) *
                      match SRS_elem with
                      | SRS_Elements_Idx.τ_pow i => X Vars_τ ^ ↑i
                      | SRS_Elements_Idx.γ => X Vars_β
                      | SRS_Elements_Idx.γβ => X Vars_γ * X Vars_β
                      | SRS_Elements_Idx.βu i => X Vars_β * (to_MvPolynomial_Option Vars) (u_wit i))
                  (List.map (fun i => SRS_Elements_Idx.τ_pow i) (List.finRange n_var) ++ [SRS_Elements_Idx.γ] ++
                      [SRS_Elements_Idx.γβ] ++
                    List.map (fun i => SRS_Elements_Idx.βu i) (List.finRange n_wit))).sum) *
            ((List.map
                  (fun pf_elem =>
                    C
                        (match pairing with
                        | PairingsI_Idx.ht =>
                          match pf_elem with
                          | Proof_Idx.H => 0
                          | Proof_Idx.V => 0
                          | Proof_Idx.B => 0
                        | PairingsI_Idx.gg =>
                          match pf_elem with
                          | Proof_Idx.H => 0
                          | Proof_Idx.V => 0
                          | Proof_Idx.B => 0
                        | PairingsI_Idx.vv =>
                          match pf_elem with
                          | Proof_Idx.H => 0
                          | Proof_Idx.V => -1
                          | Proof_Idx.B => 0) *
                      (List.map
                          (fun SRS_elem =>
                            C (prover.2 pf_elem SRS_elem) *
                              match SRS_elem with
                              | SRS_Elements_Idx.τ_pow i => X Vars_τ ^ ↑i
                              | SRS_Elements_Idx.γ => X Vars_β
                              | SRS_Elements_Idx.γβ => X Vars_γ * X Vars_β
                              | SRS_Elements_Idx.βu i => X Vars_β * (to_MvPolynomial_Option Vars) (u_wit i))
                          (List.map (fun i => SRS_Elements_Idx.τ_pow i) (List.finRange n_var) ++ [SRS_Elements_Idx.γ] ++
                              [SRS_Elements_Idx.γβ] ++
                            List.map (fun i => SRS_Elements_Idx.βu i) (List.finRange n_wit))).sum)
                  [Proof_Idx.H, Proof_Idx.V, Proof_Idx.B]).sum +
              (List.map
                  (fun SRS_elem =>
                    C
                        (match pairing with
                        | PairingsI_Idx.ht =>
                          match SRS_elem with
                          | SRS_Elements_Idx.τ_pow i => t.coeff ↑i
                          | SRS_Elements_Idx.γ => 0
                          | SRS_Elements_Idx.γβ => 0
                          | SRS_Elements_Idx.βu a => 0
                        | PairingsI_Idx.gg =>
                          match SRS_elem with
                          | SRS_Elements_Idx.τ_pow i => if ↑i = 0 then 1 else 0
                          | SRS_Elements_Idx.γ => 0
                          | SRS_Elements_Idx.γβ => 0
                          | SRS_Elements_Idx.βu a => 0
                        | PairingsI_Idx.vv =>
                          match SRS_elem with
                          | SRS_Elements_Idx.τ_pow i =>
                            -(List.map (fun j => stmt j * (u_stmt j).coeff ↑i) (List.finRange n_stmt)).sum
                          | SRS_Elements_Idx.γ => 0
                          | SRS_Elements_Idx.γβ => 0
                          | SRS_Elements_Idx.βu a => 0) *
                      match SRS_elem with
                      | SRS_Elements_Idx.τ_pow i => X Vars_τ ^ ↑i
                      | SRS_Elements_Idx.γ => X Vars_β
                      | SRS_Elements_Idx.γβ => X Vars_γ * X Vars_β
                      | SRS_Elements_Idx.βu i => X Vars_β * (to_MvPolynomial_Option Vars) (u_wit i))
                  (List.map (fun i => SRS_Elements_Idx.τ_pow i) (List.finRange n_var) ++ [SRS_Elements_Idx.γ] ++
                      [SRS_Elements_Idx.γβ] ++
                    List.map (fun i => SRS_Elements_Idx.βu i) (List.finRange n_wit))).sum))
        [PairingsI_Idx.ht, PairingsI_Idx.gg, PairingsI_Idx.vv]).sum =
    0
eqnII :
  (List.map
        (fun pairing =>
          ((List.map
                  (fun pf_elem =>
                    C
                        (match pairing with
                        | PairingsII_Idx.bγ =>
                          match pf_elem with
                          | Proof_Idx.H => 0
                          | Proof_Idx.V => 0
                          | Proof_Idx.B => 1
                        | PairingsII_Idx.γβv =>
                          match pf_elem with
                          | Proof_Idx.H => 0
                          | Proof_Idx.V => 0
                          | Proof_Idx.B => 0) *
                      (List.map
                          (fun SRS_elem =>
                            C (prover.1 pf_elem SRS_elem) *
                              match SRS_elem with
                              | SRS_Elements_Idx.τ_pow i => X Vars_τ ^ ↑i
                              | SRS_Elements_Idx.γ => X Vars_β
                              | SRS_Elements_Idx.γβ => X Vars_γ * X Vars_β
                              | SRS_Elements_Idx.βu i => X Vars_β * (to_MvPolynomial_Option Vars) (u_wit i))
                          (List.map (fun i => SRS_Elements_Idx.τ_pow i) (List.finRange n_var) ++ [SRS_Elements_Idx.γ] ++
                              [SRS_Elements_Idx.γβ] ++
                            List.map (fun i => SRS_Elements_Idx.βu i) (List.finRange n_wit))).sum)
                  [Proof_Idx.H, Proof_Idx.V, Proof_Idx.B]).sum +
              (List.map
                  (fun SRS_elem =>
                    C
                        (match pairing with
                        | PairingsII_Idx.bγ =>
                          match SRS_elem with
                          | SRS_Elements_Idx.τ_pow a => 0
                          | SRS_Elements_Idx.γ => 0
                          | SRS_Elements_Idx.γβ => 0
                          | SRS_Elements_Idx.βu a => 0
                        | PairingsII_Idx.γβv =>
                          match SRS_elem with
                          | SRS_Elements_Idx.τ_pow a => 0
                          | SRS_Elements_Idx.γ => 0
                          | SRS_Elements_Idx.γβ => 1
                          | SRS_Elements_Idx.βu a => 0) *
                      match SRS_elem with
                      | SRS_Elements_Idx.τ_pow i => X Vars_τ ^ ↑i
                      | SRS_Elements_Idx.γ => X Vars_β
                      | SRS_Elements_Idx.γβ => X Vars_γ * X Vars_β
                      | SRS_Elements_Idx.βu i => X Vars_β * (to_MvPolynomial_Option Vars) (u_wit i))
                  (List.map (fun i => SRS_Elements_Idx.τ_pow i) (List.finRange n_var) ++ [SRS_Elements_Idx.γ] ++
                      [SRS_Elements_Idx.γβ] ++
                    List.map (fun i => SRS_Elements_Idx.βu i) (List.finRange n_wit))).sum) *
            ((List.map
                  (fun pf_elem =>
                    C
                        (match pairing with
                        | PairingsII_Idx.bγ =>
                          match pf_elem with
                          | Proof_Idx.H => 0
                          | Proof_Idx.V => 0
                          | Proof_Idx.B => 0
                        | PairingsII_Idx.γβv =>
                          match pf_elem with
                          | Proof_Idx.H => 0
                          | Proof_Idx.V => -1
                          | Proof_Idx.B => 0) *
                      (List.map
                          (fun SRS_elem =>
                            C (prover.2 pf_elem SRS_elem) *
                              match SRS_elem with
                              | SRS_Elements_Idx.τ_pow i => X Vars_τ ^ ↑i
                              | SRS_Elements_Idx.γ => X Vars_β
                              | SRS_Elements_Idx.γβ => X Vars_γ * X Vars_β
                              | SRS_Elements_Idx.βu i => X Vars_β * (to_MvPolynomial_Option Vars) (u_wit i))
                          (List.map (fun i => SRS_Elements_Idx.τ_pow i) (List.finRange n_var) ++ [SRS_Elements_Idx.γ] ++
                              [SRS_Elements_Idx.γβ] ++
                            List.map (fun i => SRS_Elements_Idx.βu i) (List.finRange n_wit))).sum)
                  [Proof_Idx.H, Proof_Idx.V, Proof_Idx.B]).sum +
              (List.map
                  (fun SRS_elem =>
                    C
                        (match pairing with
                        | PairingsII_Idx.bγ =>
                          match SRS_elem with
                          | SRS_Elements_Idx.τ_pow a => 0
                          | SRS_Elements_Idx.γ => 1
                          | SRS_Elements_Idx.γβ => 0
                          | SRS_Elements_Idx.βu a => 0
                        | PairingsII_Idx.γβv =>
                          match SRS_elem with
                          | SRS_Elements_Idx.τ_pow a => 0
                          | SRS_Elements_Idx.γ => 0
                          | SRS_Elements_Idx.γβ => 0
                          | SRS_Elements_Idx.βu a => 0) *
                      match SRS_elem with
                      | SRS_Elements_Idx.τ_pow i => X Vars_τ ^ ↑i
                      | SRS_Elements_Idx.γ => X Vars_β
                      | SRS_Elements_Idx.γβ => X Vars_γ * X Vars_β
                      | SRS_Elements_Idx.βu i => X Vars_β * (to_MvPolynomial_Option Vars) (u_wit i))
                  (List.map (fun i => SRS_Elements_Idx.τ_pow i) (List.finRange n_var) ++ [SRS_Elements_Idx.γ] ++
                      [SRS_Elements_Idx.γβ] ++
                    List.map (fun i => SRS_Elements_Idx.βu i) (List.finRange n_wit))).sum))
        [PairingsII_Idx.bγ, PairingsII_Idx.γβv]).sum =
    0
eqnH :
  (List.map
        (fun SRS_elem =>
          C (prover.1 Proof_Idx.H SRS_elem) *
            match SRS_elem with
            | SRS_Elements_Idx.τ_pow i => X Vars_τ ^ ↑i
            | SRS_Elements_Idx.γ => X Vars_β
            | SRS_Elements_Idx.γβ => X Vars_γ * X Vars_β
            | SRS_Elements_Idx.βu i => X Vars_β * (to_MvPolynomial_Option Vars) (u_wit i))
        (List.map (fun i => SRS_Elements_Idx.τ_pow i) (List.finRange n_var) ++ [SRS_Elements_Idx.γ] ++
            [SRS_Elements_Idx.γβ] ++
          List.map (fun i => SRS_Elements_Idx.βu i) (List.finRange n_wit))).sum =
    (List.map
        (fun SRS_elem =>
          C (prover.2 Proof_Idx.H SRS_elem) *
            match SRS_elem with
            | SRS_Elements_Idx.τ_pow i => X Vars_τ ^ ↑i
            | SRS_Elements_Idx.γ => X Vars_β
            | SRS_Elements_Idx.γβ => X Vars_γ * X Vars_β
            | SRS_Elements_Idx.βu i => X Vars_β * (to_MvPolynomial_Option Vars) (u_wit i))
        (List.map (fun i => SRS_Elements_Idx.τ_pow i) (List.finRange n_var) ++ [SRS_Elements_Idx.γ] ++
            [SRS_Elements_Idx.γβ] ++
          List.map (fun i => SRS_Elements_Idx.βu i) (List.finRange n_wit))).sum
eqnV :
  (List.map
        (fun SRS_elem =>
          C (prover.1 Proof_Idx.V SRS_elem) *
            match SRS_elem with
            | SRS_Elements_Idx.τ_pow i => X Vars_τ ^ ↑i
            | SRS_Elements_Idx.γ => X Vars_β
            | SRS_Elements_Idx.γβ => X Vars_γ * X Vars_β
            | SRS_Elements_Idx.βu i => X Vars_β * (to_MvPolynomial_Option Vars) (u_wit i))
        (List.map (fun i => SRS_Elements_Idx.τ_pow i) (List.finRange n_var) ++ [SRS_Elements_Idx.γ] ++
            [SRS_Elements_Idx.γβ] ++
          List.map (fun i => SRS_Elements_Idx.βu i) (List.finRange n_wit))).sum =
    (List.map
        (fun SRS_elem =>
          C (prover.2 Proof_Idx.V SRS_elem) *
            match SRS_elem with
            | SRS_Elements_Idx.τ_pow i => X Vars_τ ^ ↑i
            | SRS_Elements_Idx.γ => X Vars_β
            | SRS_Elements_Idx.γβ => X Vars_γ * X Vars_β
            | SRS_Elements_Idx.βu i => X Vars_β * (to_MvPolynomial_Option Vars) (u_wit i))
        (List.map (fun i => SRS_Elements_Idx.τ_pow i) (List.finRange n_var) ++ [SRS_Elements_Idx.γ] ++
            [SRS_Elements_Idx.γβ] ++
          List.map (fun i => SRS_Elements_Idx.βu i) (List.finRange n_wit))).sum
eqnB :
  (List.map
        (fun SRS_elem =>
          C (prover.1 Proof_Idx.B SRS_elem) *
            match SRS_elem with
            | SRS_Elements_Idx.τ_pow i => X Vars_τ ^ ↑i
            | SRS_Elements_Idx.γ => X Vars_β
            | SRS_Elements_Idx.γβ => X Vars_γ * X Vars_β
            | SRS_Elements_Idx.βu i => X Vars_β * (to_MvPolynomial_Option Vars) (u_wit i))
        (List.map (fun i => SRS_Elements_Idx.τ_pow i) (List.finRange n_var) ++ [SRS_Elements_Idx.γ] ++
            [SRS_Elements_Idx.γβ] ++
          List.map (fun i => SRS_Elements_Idx.βu i) (List.finRange n_wit))).sum =
    (List.map
        (fun SRS_elem =>
          C (prover.2 Proof_Idx.B SRS_elem) *
            match SRS_elem with
            | SRS_Elements_Idx.τ_pow i => X Vars_τ ^ ↑i
            | SRS_Elements_Idx.γ => X Vars_β
            | SRS_Elements_Idx.γβ => X Vars_γ * X Vars_β
            | SRS_Elements_Idx.βu i => X Vars_β * (to_MvPolynomial_Option Vars) (u_wit i))
        (List.map (fun i => SRS_Elements_Idx.τ_pow i) (List.finRange n_var) ++ [SRS_Elements_Idx.γ] ++
            [SRS_Elements_Idx.γβ] ++
          List.map (fun i => SRS_Elements_Idx.βu i) (List.finRange n_wit))).sum
⊢ ((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_Idx.B (SRS_Elements_Idx.βu i)) * u_wit i)
              (List.finRange n_wit)).sum) ^
        2 -
      1 =
    t *
      (List.map (fun i => Polynomial.C (prover.1 Proof_Idx.H (SRS_Elements_Idx.βu i)) * u_wit i)
          (List.finRange n_wit)).sum
Tactic:
simp only [monomial_zero', List.singleton_append, List.cons_append, List.append_assoc,
  List.map_cons, Sum.elim_inl, Sum.elim_inr, List.map_append, List.map_map, List.sum_cons,
  List.sum_append, List.map_nil, List.sum_nil, add_zero, Sum.elim_lam_const_lam_const, map_one,
  one_mul, map_zero, zero_mul, map_neg, neg_mul, neg_add_rev, zero_add, mul_zero,
  Function.comp, List.sum_map_zero] at eqnI eqnII eqnH eqnV eqnB
State after:
case intro.intro.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
t : Polynomial F
ht : (List.map (fun x => Polynomial.C (t.coeff ↑x) * Polynomial.X ^ ↑x) (List.finRange n_var)).sum = t
ht0 : t.Monic
stmt : BabySNARK.Stmt
prover : Prover F BabySNARK
eqnI :
  ((List.map (fun x => C (prover.1 Proof_Idx.H (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x) (List.finRange n_var)).sum +
            (C (prover.1 Proof_Idx.H SRS_Elements_Idx.γ) * X Vars_β +
              (C (prover.1 Proof_Idx.H SRS_Elements_Idx.γβ) * (X Vars_γ * X Vars_β) +
                (List.map
                    (fun x =>
                      C (prover.1 Proof_Idx.H (SRS_Elements_Idx.βu x)) *
                        (X Vars_β * (to_MvPolynomial_Option Vars) (u_wit x)))
                    (List.finRange n_wit)).sum)) +
          (List.map (fun x => C (t.coeff ↑x) * X Vars_τ ^ ↑x) (List.finRange n_var)).sum) *
        (List.map (fun x => C (t.coeff ↑x) * X Vars_τ ^ ↑x) (List.finRange n_var)).sum +
      ((List.map (fun x => C (if ↑x = 0 then 1 else 0) * X Vars_τ ^ ↑x) (List.finRange n_var)).sum *
          (List.map (fun x => C (if ↑x = 0 then 1 else 0) * X Vars_τ ^ ↑x) (List.finRange n_var)).sum +
        ((List.map (fun x => C (prover.1 Proof_Idx.V (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x)
                  (List.finRange n_var)).sum +
              (C (prover.1 Proof_Idx.V SRS_Elements_Idx.γ) * X Vars_β +
                (C (prover.1 Proof_Idx.V SRS_Elements_Idx.γβ) * (X Vars_γ * X Vars_β) +
                  (List.map
                      (fun x =>
                        C (prover.1 Proof_Idx.V (SRS_Elements_Idx.βu x)) *
                          (X Vars_β * (to_MvPolynomial_Option Vars) (u_wit x)))
                      (List.finRange n_wit)).sum)) +
            (List.map
                (fun x =>
                  C (List.map (fun j => stmt j * (u_stmt j).coeff ↑x) (List.finRange n_stmt)).sum * X Vars_τ ^ ↑x)
                (List.finRange n_var)).sum) *
          (-(List.map
                        (fun x =>
                          C (prover.2 Proof_Idx.V (SRS_Elements_Idx.βu x)) *
                            (X Vars_β * (to_MvPolynomial_Option Vars) (u_wit x)))
                        (List.finRange n_wit)).sum +
                  -(C (prover.2 Proof_Idx.V SRS_Elements_Idx.γβ) * (X Vars_γ * X Vars_β)) +
                -(C (prover.2 Proof_Idx.V SRS_Elements_Idx.γ) * X Vars_β) +
              -(List.map (fun x => C (prover.2 Proof_Idx.V (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x)
                    (List.finRange n_var)).sum +
            (List.map
                (fun x =>
                  -(C (List.map (fun j => stmt j * (u_stmt j).coeff ↑x) (List.finRange n_stmt)).sum * X Vars_τ ^ ↑x))
                (List.finRange n_var)).sum)) =
    0
eqnII :
  ((List.map (fun x => C (prover.1 Proof_Idx.B (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x) (List.finRange n_var)).sum +
          (C (prover.1 Proof_Idx.B SRS_Elements_Idx.γ) * X Vars_β +
            (C (prover.1 Proof_Idx.B SRS_Elements_Idx.γβ) * (X Vars_γ * X Vars_β) +
              (List.map
                  (fun x =>
                    C (prover.1 Proof_Idx.B (SRS_Elements_Idx.βu x)) *
                      (X Vars_β * (to_MvPolynomial_Option Vars) (u_wit x)))
                  (List.finRange n_wit)).sum))) *
        X Vars_β +
      X Vars_γ * X Vars_β *
        (-(List.map
                    (fun x =>
                      C (prover.2 Proof_Idx.V (SRS_Elements_Idx.βu x)) *
                        (X Vars_β * (to_MvPolynomial_Option Vars) (u_wit x)))
                    (List.finRange n_wit)).sum +
              -(C (prover.2 Proof_Idx.V SRS_Elements_Idx.γβ) * (X Vars_γ * X Vars_β)) +
            -(C (prover.2 Proof_Idx.V SRS_Elements_Idx.γ) * X Vars_β) +
          -(List.map (fun x => C (prover.2 Proof_Idx.V (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x)
                (List.finRange n_var)).sum) =
    0
eqnH :
  (List.map (fun x => C (prover.1 Proof_Idx.H (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x) (List.finRange n_var)).sum +
      (C (prover.1 Proof_Idx.H SRS_Elements_Idx.γ) * X Vars_β +
        (C (prover.1 Proof_Idx.H SRS_Elements_Idx.γβ) * (X Vars_γ * X Vars_β) +
          (List.map
              (fun x =>
                C (prover.1 Proof_Idx.H (SRS_Elements_Idx.βu x)) * (X Vars_β * (to_MvPolynomial_Option Vars) (u_wit x)))
              (List.finRange n_wit)).sum)) =
    (List.map (fun x => C (prover.2 Proof_Idx.H (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x)
          (List.finRange n_var)).sum +
      (C (prover.2 Proof_Idx.H SRS_Elements_Idx.γ) * X Vars_β +
        (C (prover.2 Proof_Idx.H SRS_Elements_Idx.γβ) * (X Vars_γ * X Vars_β) +
          (List.map
              (fun x =>
                C (prover.2 Proof_Idx.H (SRS_Elements_Idx.βu x)) * (X Vars_β * (to_MvPolynomial_Option Vars) (u_wit x)))
              (List.finRange n_wit)).sum))
eqnV :
  (List.map (fun x => C (prover.1 Proof_Idx.V (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x) (List.finRange n_var)).sum +
      (C (prover.1 Proof_Idx.V SRS_Elements_Idx.γ) * X Vars_β +
        (C (prover.1 Proof_Idx.V SRS_Elements_Idx.γβ) * (X Vars_γ * X Vars_β) +
          (List.map
              (fun x =>
                C (prover.1 Proof_Idx.V (SRS_Elements_Idx.βu x)) * (X Vars_β * (to_MvPolynomial_Option Vars) (u_wit x)))
              (List.finRange n_wit)).sum)) =
    (List.map (fun x => C (prover.2 Proof_Idx.V (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x)
          (List.finRange n_var)).sum +
      (C (prover.2 Proof_Idx.V SRS_Elements_Idx.γ) * X Vars_β +
        (C (prover.2 Proof_Idx.V SRS_Elements_Idx.γβ) * (X Vars_γ * X Vars_β) +
          (List.map
              (fun x =>
                C (prover.2 Proof_Idx.V (SRS_Elements_Idx.βu x)) * (X Vars_β * (to_MvPolynomial_Option Vars) (u_wit x)))
              (List.finRange n_wit)).sum))
eqnB :
  (List.map (fun x => C (prover.1 Proof_Idx.B (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x) (List.finRange n_var)).sum +
      (C (prover.1 Proof_Idx.B SRS_Elements_Idx.γ) * X Vars_β +
        (C (prover.1 Proof_Idx.B SRS_Elements_Idx.γβ) * (X Vars_γ * X Vars_β) +
          (List.map
              (fun x =>
                C (prover.1 Proof_Idx.B (SRS_Elements_Idx.βu x)) * (X Vars_β * (to_MvPolynomial_Option Vars) (u_wit x)))
              (List.finRange n_wit)).sum)) =
    (List.map (fun x => C (prover.2 Proof_Idx.B (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x)
          (List.finRange n_var)).sum +
      (C (prover.2 Proof_Idx.B SRS_Elements_Idx.γ) * X Vars_β +
        (C (prover.2 Proof_Idx.B SRS_Elements_Idx.γβ) * (X Vars_γ * X Vars_β) +
          (List.map
              (fun x =>
                C (prover.2 Proof_Idx.B (SRS_Elements_Idx.βu x)) * (X Vars_β * (to_MvPolynomial_Option Vars) (u_wit x)))
              (List.finRange n_wit)).sum))
⊢ ((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_Idx.B (SRS_Elements_Idx.βu i)) * u_wit i)
              (List.finRange n_wit)).sum) ^
        2 -
      1 =
    t *
      (List.map (fun i => Polynomial.C (prover.1 Proof_Idx.H (SRS_Elements_Idx.βu i)) * u_wit i)
          (List.finRange n_wit)).sum

State before:
case intro.intro.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
t : Polynomial F
ht : (List.map (fun x => Polynomial.C (t.coeff ↑x) * Polynomial.X ^ ↑x) (List.finRange n_var)).sum = t
ht0 : t.Monic
stmt : BabySNARK.Stmt
prover : Prover F BabySNARK
eqnI :
  ((List.map (fun x => C (prover.1 Proof_Idx.H (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x) (List.finRange n_var)).sum +
            (C (prover.1 Proof_Idx.H SRS_Elements_Idx.γ) * X Vars_β +
              (C (prover.1 Proof_Idx.H SRS_Elements_Idx.γβ) * (X Vars_γ * X Vars_β) +
                (List.map
                    (fun x =>
                      C (prover.1 Proof_Idx.H (SRS_Elements_Idx.βu x)) *
                        (X Vars_β * (to_MvPolynomial_Option Vars) (u_wit x)))
                    (List.finRange n_wit)).sum)) +
          (List.map (fun x => C (t.coeff ↑x) * X Vars_τ ^ ↑x) (List.finRange n_var)).sum) *
        (List.map (fun x => C (t.coeff ↑x) * X Vars_τ ^ ↑x) (List.finRange n_var)).sum +
      ((List.map (fun x => C (if ↑x = 0 then 1 else 0) * X Vars_τ ^ ↑x) (List.finRange n_var)).sum *
          (List.map (fun x => C (if ↑x = 0 then 1 else 0) * X Vars_τ ^ ↑x) (List.finRange n_var)).sum +
        ((List.map (fun x => C (prover.1 Proof_Idx.V (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x)
                  (List.finRange n_var)).sum +
              (C (prover.1 Proof_Idx.V SRS_Elements_Idx.γ) * X Vars_β +
                (C (prover.1 Proof_Idx.V SRS_Elements_Idx.γβ) * (X Vars_γ * X Vars_β) +
                  (List.map
                      (fun x =>
                        C (prover.1 Proof_Idx.V (SRS_Elements_Idx.βu x)) *
                          (X Vars_β * (to_MvPolynomial_Option Vars) (u_wit x)))
                      (List.finRange n_wit)).sum)) +
            (List.map
                (fun x =>
                  C (List.map (fun j => stmt j * (u_stmt j).coeff ↑x) (List.finRange n_stmt)).sum * X Vars_τ ^ ↑x)
                (List.finRange n_var)).sum) *
          (-(List.map
                        (fun x =>
                          C (prover.2 Proof_Idx.V (SRS_Elements_Idx.βu x)) *
                            (X Vars_β * (to_MvPolynomial_Option Vars) (u_wit x)))
                        (List.finRange n_wit)).sum +
                  -(C (prover.2 Proof_Idx.V SRS_Elements_Idx.γβ) * (X Vars_γ * X Vars_β)) +
                -(C (prover.2 Proof_Idx.V SRS_Elements_Idx.γ) * X Vars_β) +
              -(List.map (fun x => C (prover.2 Proof_Idx.V (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x)
                    (List.finRange n_var)).sum +
            (List.map
                (fun x =>
                  -(C (List.map (fun j => stmt j * (u_stmt j).coeff ↑x) (List.finRange n_stmt)).sum * X Vars_τ ^ ↑x))
                (List.finRange n_var)).sum)) =
    0
eqnII :
  ((List.map (fun x => C (prover.1 Proof_Idx.B (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x) (List.finRange n_var)).sum +
          (C (prover.1 Proof_Idx.B SRS_Elements_Idx.γ) * X Vars_β +
            (C (prover.1 Proof_Idx.B SRS_Elements_Idx.γβ) * (X Vars_γ * X Vars_β) +
              (List.map
                  (fun x =>
                    C (prover.1 Proof_Idx.B (SRS_Elements_Idx.βu x)) *
                      (X Vars_β * (to_MvPolynomial_Option Vars) (u_wit x)))
                  (List.finRange n_wit)).sum))) *
        X Vars_β +
      X Vars_γ * X Vars_β *
        (-(List.map
                    (fun x =>
                      C (prover.2 Proof_Idx.V (SRS_Elements_Idx.βu x)) *
                        (X Vars_β * (to_MvPolynomial_Option Vars) (u_wit x)))
                    (List.finRange n_wit)).sum +
              -(C (prover.2 Proof_Idx.V SRS_Elements_Idx.γβ) * (X Vars_γ * X Vars_β)) +
            -(C (prover.2 Proof_Idx.V SRS_Elements_Idx.γ) * X Vars_β) +
          -(List.map (fun x => C (prover.2 Proof_Idx.V (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x)
                (List.finRange n_var)).sum) =
    0
eqnH :
  (List.map (fun x => C (prover.1 Proof_Idx.H (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x) (List.finRange n_var)).sum +
      (C (prover.1 Proof_Idx.H SRS_Elements_Idx.γ) * X Vars_β +
        (C (prover.1 Proof_Idx.H SRS_Elements_Idx.γβ) * (X Vars_γ * X Vars_β) +
          (List.map
              (fun x =>
                C (prover.1 Proof_Idx.H (SRS_Elements_Idx.βu x)) * (X Vars_β * (to_MvPolynomial_Option Vars) (u_wit x)))
              (List.finRange n_wit)).sum)) =
    (List.map (fun x => C (prover.2 Proof_Idx.H (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x)
          (List.finRange n_var)).sum +
      (C (prover.2 Proof_Idx.H SRS_Elements_Idx.γ) * X Vars_β +
        (C (prover.2 Proof_Idx.H SRS_Elements_Idx.γβ) * (X Vars_γ * X Vars_β) +
          (List.map
              (fun x =>
                C (prover.2 Proof_Idx.H (SRS_Elements_Idx.βu x)) * (X Vars_β * (to_MvPolynomial_Option Vars) (u_wit x)))
              (List.finRange n_wit)).sum))
eqnV :
  (List.map (fun x => C (prover.1 Proof_Idx.V (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x) (List.finRange n_var)).sum +
      (C (prover.1 Proof_Idx.V SRS_Elements_Idx.γ) * X Vars_β +
        (C (prover.1 Proof_Idx.V SRS_Elements_Idx.γβ) * (X Vars_γ * X Vars_β) +
          (List.map
              (fun x =>
                C (prover.1 Proof_Idx.V (SRS_Elements_Idx.βu x)) * (X Vars_β * (to_MvPolynomial_Option Vars) (u_wit x)))
              (List.finRange n_wit)).sum)) =
    (List.map (fun x => C (prover.2 Proof_Idx.V (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x)
          (List.finRange n_var)).sum +
      (C (prover.2 Proof_Idx.V SRS_Elements_Idx.γ) * X Vars_β +
        (C (prover.2 Proof_Idx.V SRS_Elements_Idx.γβ) * (X Vars_γ * X Vars_β) +
          (List.map
              (fun x =>
                C (prover.2 Proof_Idx.V (SRS_Elements_Idx.βu x)) * (X Vars_β * (to_MvPolynomial_Option Vars) (u_wit x)))
              (List.finRange n_wit)).sum))
eqnB :
  (List.map (fun x => C (prover.1 Proof_Idx.B (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x) (List.finRange n_var)).sum +
      (C (prover.1 Proof_Idx.B SRS_Elements_Idx.γ) * X Vars_β +
        (C (prover.1 Proof_Idx.B SRS_Elements_Idx.γβ) * (X Vars_γ * X Vars_β) +
          (List.map
              (fun x =>
                C (prover.1 Proof_Idx.B (SRS_Elements_Idx.βu x)) * (X Vars_β * (to_MvPolynomial_Option Vars) (u_wit x)))
              (List.finRange n_wit)).sum)) =
    (List.map (fun x => C (prover.2 Proof_Idx.B (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x)
          (List.finRange n_var)).sum +
      (C (prover.2 Proof_Idx.B SRS_Elements_Idx.γ) * X Vars_β +
        (C (prover.2 Proof_Idx.B SRS_Elements_Idx.γβ) * (X Vars_γ * X Vars_β) +
          (List.map
              (fun x =>
                C (prover.2 Proof_Idx.B (SRS_Elements_Idx.βu x)) * (X Vars_β * (to_MvPolynomial_Option Vars) (u_wit x)))
              (List.finRange n_wit)).sum))
⊢ ((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_Idx.B (SRS_Elements_Idx.βu i)) * u_wit i)
              (List.finRange n_wit)).sum) ^
        2 -
      1 =
    t *
      (List.map (fun i => Polynomial.C (prover.1 Proof_Idx.H (SRS_Elements_Idx.βu i)) * u_wit i)
          (List.finRange n_wit)).sum
Tactic:
simp only [mul_add, add_mul, List.sum_map_add] at eqnI eqnII eqnH eqnV eqnB
State after:
case intro.intro.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
t : Polynomial F
ht : (List.map (fun x => Polynomial.C (t.coeff ↑x) * Polynomial.X ^ ↑x) (List.finRange n_var)).sum = t
ht0 : t.Monic
stmt : BabySNARK.Stmt
prover : Prover F BabySNARK
eqnH :
  (List.map (fun x => C (prover.1 Proof_Idx.H (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x) (List.finRange n_var)).sum +
      (C (prover.1 Proof_Idx.H SRS_Elements_Idx.γ) * X Vars_β +
        (C (prover.1 Proof_Idx.H SRS_Elements_Idx.γβ) * (X Vars_γ * X Vars_β) +
          (List.map
              (fun x =>
                C (prover.1 Proof_Idx.H (SRS_Elements_Idx.βu x)) * (X Vars_β * (to_MvPolynomial_Option Vars) (u_wit x)))
              (List.finRange n_wit)).sum)) =
    (List.map (fun x => C (prover.2 Proof_Idx.H (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x)
          (List.finRange n_var)).sum +
      (C (prover.2 Proof_Idx.H SRS_Elements_Idx.γ) * X Vars_β +
        (C (prover.2 Proof_Idx.H SRS_Elements_Idx.γβ) * (X Vars_γ * X Vars_β) +
          (List.map
              (fun x =>
                C (prover.2 Proof_Idx.H (SRS_Elements_Idx.βu x)) * (X Vars_β * (to_MvPolynomial_Option Vars) (u_wit x)))
              (List.finRange n_wit)).sum))
eqnV :
  (List.map (fun x => C (prover.1 Proof_Idx.V (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x) (List.finRange n_var)).sum +
      (C (prover.1 Proof_Idx.V SRS_Elements_Idx.γ) * X Vars_β +
        (C (prover.1 Proof_Idx.V SRS_Elements_Idx.γβ) * (X Vars_γ * X Vars_β) +
          (List.map
              (fun x =>
                C (prover.1 Proof_Idx.V (SRS_Elements_Idx.βu x)) * (X Vars_β * (to_MvPolynomial_Option Vars) (u_wit x)))
              (List.finRange n_wit)).sum)) =
    (List.map (fun x => C (prover.2 Proof_Idx.V (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x)
          (List.finRange n_var)).sum +
      (C (prover.2 Proof_Idx.V SRS_Elements_Idx.γ) * X Vars_β +
        (C (prover.2 Proof_Idx.V SRS_Elements_Idx.γβ) * (X Vars_γ * X Vars_β) +
          (List.map
              (fun x =>
                C (prover.2 Proof_Idx.V (SRS_Elements_Idx.βu x)) * (X Vars_β * (to_MvPolynomial_Option Vars) (u_wit x)))
              (List.finRange n_wit)).sum))
eqnB :
  (List.map (fun x => C (prover.1 Proof_Idx.B (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x) (List.finRange n_var)).sum +
      (C (prover.1 Proof_Idx.B SRS_Elements_Idx.γ) * X Vars_β +
        (C (prover.1 Proof_Idx.B SRS_Elements_Idx.γβ) * (X Vars_γ * X Vars_β) +
          (List.map
              (fun x =>
                C (prover.1 Proof_Idx.B (SRS_Elements_Idx.βu x)) * (X Vars_β * (to_MvPolynomial_Option Vars) (u_wit x)))
              (List.finRange n_wit)).sum)) =
    (List.map (fun x => C (prover.2 Proof_Idx.B (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x)
          (List.finRange n_var)).sum +
      (C (prover.2 Proof_Idx.B SRS_Elements_Idx.γ) * X Vars_β +
        (C (prover.2 Proof_Idx.B SRS_Elements_Idx.γβ) * (X Vars_γ * X Vars_β) +
          (List.map
              (fun x =>
                C (prover.2 Proof_Idx.B (SRS_Elements_Idx.βu x)) * (X Vars_β * (to_MvPolynomial_Option Vars) (u_wit x)))
              (List.finRange n_wit)).sum))
eqnI :
  (List.map (fun x => C (prover.1 Proof_Idx.H (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x) (List.finRange n_var)).sum *
            (List.map (fun x => C (t.coeff ↑x) * X Vars_τ ^ ↑x) (List.finRange n_var)).sum +
          (C (prover.1 Proof_Idx.H SRS_Elements_Idx.γ) * X Vars_β *
              (List.map (fun x => C (t.coeff ↑x) * X Vars_τ ^ ↑x) (List.finRange n_var)).sum +
            (C (prover.1 Proof_Idx.H SRS_Elements_Idx.γβ) * (X Vars_γ * X Vars_β) *
                (List.map (fun x => C (t.coeff ↑x) * X Vars_τ ^ ↑x) (List.finRange n_var)).sum +
              (List.map
                    (fun x =>
                      C (prover.1 Proof_Idx.H (SRS_Elements_Idx.βu x)) *
                        (X Vars_β * (to_MvPolynomial_Option Vars) (u_wit x)))
                    (List.finRange n_wit)).sum *
                (List.map (fun x => C (t.coeff ↑x) * X Vars_τ ^ ↑x) (List.finRange n_var)).sum)) +
        (List.map (fun x => C (t.coeff ↑x) * X Vars_τ ^ ↑x) (List.finRange n_var)).sum *
          (List.map (fun x => C (t.coeff ↑x) * X Vars_τ ^ ↑x) (List.finRange n_var)).sum +
      ((List.map (fun x => C (if ↑x = 0 then 1 else 0) * X Vars_τ ^ ↑x) (List.finRange n_var)).sum *
          (List.map (fun x => C (if ↑x = 0 then 1 else 0) * X Vars_τ ^ ↑x) (List.finRange n_var)).sum +
        ((List.map (fun x => C (prover.1 Proof_Idx.V (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x)
                          (List.finRange n_var)).sum *
                      -(List.map
                            (fun x =>
                              C (prover.2 Proof_Idx.V (SRS_Elements_Idx.βu x)) *
                                (X Vars_β * (to_MvPolynomial_Option Vars) (u_wit x)))
                            (List.finRange n_wit)).sum +
                    (C (prover.1 Proof_Idx.V SRS_Elements_Idx.γ) * X Vars_β *
                        -(List.map
                              (fun x =>
                                C (prover.2 Proof_Idx.V (SRS_Elements_Idx.βu x)) *
                                  (X Vars_β * (to_MvPolynomial_Option Vars) (u_wit x)))
                              (List.finRange n_wit)).sum +
                      (C (prover.1 Proof_Idx.V SRS_Elements_Idx.γβ) * (X Vars_γ * X Vars_β) *
                          -(List.map
                                (fun x =>
                                  C (prover.2 Proof_Idx.V (SRS_Elements_Idx.βu x)) *
                                    (X Vars_β * (to_MvPolynomial_Option Vars) (u_wit x)))
                                (List.finRange n_wit)).sum +
                        (List.map
                              (fun x =>
                                C (prover.1 Proof_Idx.V (SRS_Elements_Idx.βu x)) *
                                  (X Vars_β * (to_MvPolynomial_Option Vars) (u_wit x)))
                              (List.finRange n_wit)).sum *
                          -(List.map
                                (fun x =>
                                  C (prover.2 Proof_Idx.V (SRS_Elements_Idx.βu x)) *
                                    (X Vars_β * (to_MvPolynomial_Option Vars) (u_wit x)))
                                (List.finRange n_wit)).sum)) +
                  (List.map
                        (fun x =>
                          C (List.map (fun j => stmt j * (u_stmt j).coeff ↑x) (List.finRange n_stmt)).sum *
                            X Vars_τ ^ ↑x)
                        (List.finRange n_var)).sum *
                    -(List.map
                          (fun x =>
                            C (prover.2 Proof_Idx.V (SRS_Elements_Idx.βu x)) *
                              (X Vars_β * (to_MvPolynomial_Option Vars) (u_wit x)))
                          (List.finRange n_wit)).sum +
                ((List.map (fun x => C (prover.1 Proof_Idx.V (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x)
                          (List.finRange n_var)).sum *
                      -(C (prover.2 Proof_Idx.V SRS_Elements_Idx.γβ) * (X Vars_γ * X Vars_β)) +
                    (C (prover.1 Proof_Idx.V SRS_Elements_Idx.γ) * X Vars_β *
                        -(C (prover.2 Proof_Idx.V SRS_Elements_Idx.γβ) * (X Vars_γ * X Vars_β)) +
                      (C (prover.1 Proof_Idx.V SRS_Elements_Idx.γβ) * (X Vars_γ * X Vars_β) *
                          -(C (prover.2 Proof_Idx.V SRS_Elements_Idx.γβ) * (X Vars_γ * X Vars_β)) +
                        (List.map
                              (fun x =>
                                C (prover.1 Proof_Idx.V (SRS_Elements_Idx.βu x)) *
                                  (X Vars_β * (to_MvPolynomial_Option Vars) (u_wit x)))
                              (List.finRange n_wit)).sum *
                          -(C (prover.2 Proof_Idx.V SRS_Elements_Idx.γβ) * (X Vars_γ * X Vars_β)))) +
                  (List.map
                        (fun x =>
                          C (List.map (fun j => stmt j * (u_stmt j).coeff ↑x) (List.finRange n_stmt)).sum *
                            X Vars_τ ^ ↑x)
                        (List.finRange n_var)).sum *
                    -(C (prover.2 Proof_Idx.V SRS_Elements_Idx.γβ) * (X Vars_γ * X Vars_β))) +
              ((List.map (fun x => C (prover.1 Proof_Idx.V (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x)
                        (List.finRange n_var)).sum *
                    -(C (prover.2 Proof_Idx.V SRS_Elements_Idx.γ) * X Vars_β) +
                  (C (prover.1 Proof_Idx.V SRS_Elements_Idx.γ) * X Vars_β *
                      -(C (prover.2 Proof_Idx.V SRS_Elements_Idx.γ) * X Vars_β) +
                    (C (prover.1 Proof_Idx.V SRS_Elements_Idx.γβ) * (X Vars_γ * X Vars_β) *
                        -(C (prover.2 Proof_Idx.V SRS_Elements_Idx.γ) * X Vars_β) +
                      (List.map
                            (fun x =>
                              C (prover.1 Proof_Idx.V (SRS_Elements_Idx.βu x)) *
                                (X Vars_β * (to_MvPolynomial_Option Vars) (u_wit x)))
                            (List.finRange n_wit)).sum *
                        -(C (prover.2 Proof_Idx.V SRS_Elements_Idx.γ) * X Vars_β))) +
                (List.map
                      (fun x =>
                        C (List.map (fun j => stmt j * (u_stmt j).coeff ↑x) (List.finRange n_stmt)).sum * X Vars_τ ^ ↑x)
                      (List.finRange n_var)).sum *
                  -(C (prover.2 Proof_Idx.V SRS_Elements_Idx.γ) * X Vars_β)) +
            ((List.map (fun x => C (prover.1 Proof_Idx.V (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x)
                      (List.finRange n_var)).sum *
                  -(List.map (fun x => C (prover.2 Proof_Idx.V (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x)
                        (List.finRange n_var)).sum +
                (C (prover.1 Proof_Idx.V SRS_Elements_Idx.γ) * X Vars_β *
                    -(List.map (fun x => C (prover.2 Proof_Idx.V (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x)
                          (List.finRange n_var)).sum +
                  (C (prover.1 Proof_Idx.V SRS_Elements_Idx.γβ) * (X Vars_γ * X Vars_β) *
                      -(List.map (fun x => C (prover.2 Proof_Idx.V (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x)
                            (List.finRange n_var)).sum +
                    (List.map
                          (fun x =>
                            C (prover.1 Proof_Idx.V (SRS_Elements_Idx.βu x)) *
                              (X Vars_β * (to_MvPolynomial_Option Vars) (u_wit x)))
                          (List.finRange n_wit)).sum *
                      -(List.map (fun x => C (prover.2 Proof_Idx.V (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x)
                            (List.finRange n_var)).sum)) +
              (List.map
                    (fun x =>
                      C (List.map (fun j => stmt j * (u_stmt j).coeff ↑x) (List.finRange n_stmt)).sum * X Vars_τ ^ ↑x)
                    (List.finRange n_var)).sum *
                -(List.map (fun x => C (prover.2 Proof_Idx.V (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x)
                      (List.finRange n_var)).sum) +
          ((List.map (fun x => C (prover.1 Proof_Idx.V (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x)
                    (List.finRange n_var)).sum *
                (List.map
                    (fun x =>
                      -(C (List.map (fun j => stmt j * (u_stmt j).coeff ↑x) (List.finRange n_stmt)).sum *
                          X Vars_τ ^ ↑x))
                    (List.finRange n_var)).sum +
              (C (prover.1 Proof_Idx.V SRS_Elements_Idx.γ) * X Vars_β *
                  (List.map
                      (fun x =>
                        -(C (List.map (fun j => stmt j * (u_stmt j).coeff ↑x) (List.finRange n_stmt)).sum *
                            X Vars_τ ^ ↑x))
                      (List.finRange n_var)).sum +
                (C (prover.1 Proof_Idx.V SRS_Elements_Idx.γβ) * (X Vars_γ * X Vars_β) *
                    (List.map
                        (fun x =>
                          -(C (List.map (fun j => stmt j * (u_stmt j).coeff ↑x) (List.finRange n_stmt)).sum *
                              X Vars_τ ^ ↑x))
                        (List.finRange n_var)).sum +
                  (List.map
                        (fun x =>
                          C (prover.1 Proof_Idx.V (SRS_Elements_Idx.βu x)) *
                            (X Vars_β * (to_MvPolynomial_Option Vars) (u_wit x)))
                        (List.finRange n_wit)).sum *
                    (List.map
                        (fun x =>
                          -(C (List.map (fun j => stmt j * (u_stmt j).coeff ↑x) (List.finRange n_stmt)).sum *
                              X Vars_τ ^ ↑x))
                        (List.finRange n_var)).sum)) +
            (List.map
                  (fun x =>
                    C (List.map (fun j => stmt j * (u_stmt j).coeff ↑x) (List.finRange n_stmt)).sum * X Vars_τ ^ ↑x)
                  (List.finRange n_var)).sum *
              (List.map
                  (fun x =>
                    -(C (List.map (fun j => stmt j * (u_stmt j).coeff ↑x) (List.finRange n_stmt)).sum * X Vars_τ ^ ↑x))
                  (List.finRange n_var)).sum))) =
    0
eqnII :
  (List.map (fun x => C (prover.1 Proof_Idx.B (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x) (List.finRange n_var)).sum *
          X Vars_β +
        (C (prover.1 Proof_Idx.B SRS_Elements_Idx.γ) * X Vars_β * X Vars_β +
          (C (prover.1 Proof_Idx.B SRS_Elements_Idx.γβ) * (X Vars_γ * X Vars_β) * X Vars_β +
            (List.map
                  (fun x =>
                    C (prover.1 Proof_Idx.B (SRS_Elements_Idx.βu x)) *
                      (X Vars_β * (to_MvPolynomial_Option Vars) (u_wit x)))
                  (List.finRange n_wit)).sum *
              X Vars_β)) +
      (X Vars_γ * X Vars_β *
              -(List.map
                    (fun x =>
                      C (prover.2 Proof_Idx.V (SRS_Elements_Idx.βu x)) *
                        (X Vars_β * (to_MvPolynomial_Option Vars) (u_wit x)))
                    (List.finRange n_wit)).sum +
            X Vars_γ * X Vars_β * -(C (prover.2 Proof_Idx.V SRS_Elements_Idx.γβ) * (X Vars_γ * X Vars_β)) +
          X Vars_γ * X Vars_β * -(C (prover.2 Proof_Idx.V SRS_Elements_Idx.γ) * X Vars_β) +
        X Vars_γ * X Vars_β *
          -(List.map (fun x => C (prover.2 Proof_Idx.V (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x)
                (List.finRange n_var)).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_Idx.B (SRS_Elements_Idx.βu i)) * u_wit i)
              (List.finRange n_wit)).sum) ^
        2 -
      1 =
    t *
      (List.map (fun i => Polynomial.C (prover.1 Proof_Idx.H (SRS_Elements_Idx.βu i)) * u_wit i)
          (List.finRange n_wit)).sum

State before:
case intro.intro.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
t : Polynomial F
ht : (List.map (fun x => Polynomial.C (t.coeff ↑x) * Polynomial.X ^ ↑x) (List.finRange n_var)).sum = t
ht0 : t.Monic
stmt : BabySNARK.Stmt
prover : Prover F BabySNARK
eqnH :
  (List.map (fun x => C (prover.1 Proof_Idx.H (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x) (List.finRange n_var)).sum +
      (C (prover.1 Proof_Idx.H SRS_Elements_Idx.γ) * X Vars_β +
        (C (prover.1 Proof_Idx.H SRS_Elements_Idx.γβ) * (X Vars_γ * X Vars_β) +
          (List.map
              (fun x =>
                C (prover.1 Proof_Idx.H (SRS_Elements_Idx.βu x)) * (X Vars_β * (to_MvPolynomial_Option Vars) (u_wit x)))
              (List.finRange n_wit)).sum)) =
    (List.map (fun x => C (prover.2 Proof_Idx.H (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x)
          (List.finRange n_var)).sum +
      (C (prover.2 Proof_Idx.H SRS_Elements_Idx.γ) * X Vars_β +
        (C (prover.2 Proof_Idx.H SRS_Elements_Idx.γβ) * (X Vars_γ * X Vars_β) +
          (List.map
              (fun x =>
                C (prover.2 Proof_Idx.H (SRS_Elements_Idx.βu x)) * (X Vars_β * (to_MvPolynomial_Option Vars) (u_wit x)))
              (List.finRange n_wit)).sum))
eqnV :
  (List.map (fun x => C (prover.1 Proof_Idx.V (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x) (List.finRange n_var)).sum +
      (C (prover.1 Proof_Idx.V SRS_Elements_Idx.γ) * X Vars_β +
        (C (prover.1 Proof_Idx.V SRS_Elements_Idx.γβ) * (X Vars_γ * X Vars_β) +
          (List.map
              (fun x =>
                C (prover.1 Proof_Idx.V (SRS_Elements_Idx.βu x)) * (X Vars_β * (to_MvPolynomial_Option Vars) (u_wit x)))
              (List.finRange n_wit)).sum)) =
    (List.map (fun x => C (prover.2 Proof_Idx.V (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x)
          (List.finRange n_var)).sum +
      (C (prover.2 Proof_Idx.V SRS_Elements_Idx.γ) * X Vars_β +
        (C (prover.2 Proof_Idx.V SRS_Elements_Idx.γβ) * (X Vars_γ * X Vars_β) +
          (List.map
              (fun x =>
                C (prover.2 Proof_Idx.V (SRS_Elements_Idx.βu x)) * (X Vars_β * (to_MvPolynomial_Option Vars) (u_wit x)))
              (List.finRange n_wit)).sum))
eqnB :
  (List.map (fun x => C (prover.1 Proof_Idx.B (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x) (List.finRange n_var)).sum +
      (C (prover.1 Proof_Idx.B SRS_Elements_Idx.γ) * X Vars_β +
        (C (prover.1 Proof_Idx.B SRS_Elements_Idx.γβ) * (X Vars_γ * X Vars_β) +
          (List.map
              (fun x =>
                C (prover.1 Proof_Idx.B (SRS_Elements_Idx.βu x)) * (X Vars_β * (to_MvPolynomial_Option Vars) (u_wit x)))
              (List.finRange n_wit)).sum)) =
    (List.map (fun x => C (prover.2 Proof_Idx.B (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x)
          (List.finRange n_var)).sum +
      (C (prover.2 Proof_Idx.B SRS_Elements_Idx.γ) * X Vars_β +
        (C (prover.2 Proof_Idx.B SRS_Elements_Idx.γβ) * (X Vars_γ * X Vars_β) +
          (List.map
              (fun x =>
                C (prover.2 Proof_Idx.B (SRS_Elements_Idx.βu x)) * (X Vars_β * (to_MvPolynomial_Option Vars) (u_wit x)))
              (List.finRange n_wit)).sum))
eqnI :
  (List.map (fun x => C (prover.1 Proof_Idx.H (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x) (List.finRange n_var)).sum *
            (List.map (fun x => C (t.coeff ↑x) * X Vars_τ ^ ↑x) (List.finRange n_var)).sum +
          (C (prover.1 Proof_Idx.H SRS_Elements_Idx.γ) * X Vars_β *
              (List.map (fun x => C (t.coeff ↑x) * X Vars_τ ^ ↑x) (List.finRange n_var)).sum +
            (C (prover.1 Proof_Idx.H SRS_Elements_Idx.γβ) * (X Vars_γ * X Vars_β) *
                (List.map (fun x => C (t.coeff ↑x) * X Vars_τ ^ ↑x) (List.finRange n_var)).sum +
              (List.map
                    (fun x =>
                      C (prover.1 Proof_Idx.H (SRS_Elements_Idx.βu x)) *
                        (X Vars_β * (to_MvPolynomial_Option Vars) (u_wit x)))
                    (List.finRange n_wit)).sum *
                (List.map (fun x => C (t.coeff ↑x) * X Vars_τ ^ ↑x) (List.finRange n_var)).sum)) +
        (List.map (fun x => C (t.coeff ↑x) * X Vars_τ ^ ↑x) (List.finRange n_var)).sum *
          (List.map (fun x => C (t.coeff ↑x) * X Vars_τ ^ ↑x) (List.finRange n_var)).sum +
      ((List.map (fun x => C (if ↑x = 0 then 1 else 0) * X Vars_τ ^ ↑x) (List.finRange n_var)).sum *
          (List.map (fun x => C (if ↑x = 0 then 1 else 0) * X Vars_τ ^ ↑x) (List.finRange n_var)).sum +
        ((List.map (fun x => C (prover.1 Proof_Idx.V (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x)
                          (List.finRange n_var)).sum *
                      -(List.map
                            (fun x =>
                              C (prover.2 Proof_Idx.V (SRS_Elements_Idx.βu x)) *
                                (X Vars_β * (to_MvPolynomial_Option Vars) (u_wit x)))
                            (List.finRange n_wit)).sum +
                    (C (prover.1 Proof_Idx.V SRS_Elements_Idx.γ) * X Vars_β *
                        -(List.map
                              (fun x =>
                                C (prover.2 Proof_Idx.V (SRS_Elements_Idx.βu x)) *
                                  (X Vars_β * (to_MvPolynomial_Option Vars) (u_wit x)))
                              (List.finRange n_wit)).sum +
                      (C (prover.1 Proof_Idx.V SRS_Elements_Idx.γβ) * (X Vars_γ * X Vars_β) *
                          -(List.map
                                (fun x =>
                                  C (prover.2 Proof_Idx.V (SRS_Elements_Idx.βu x)) *
                                    (X Vars_β * (to_MvPolynomial_Option Vars) (u_wit x)))
                                (List.finRange n_wit)).sum +
                        (List.map
                              (fun x =>
                                C (prover.1 Proof_Idx.V (SRS_Elements_Idx.βu x)) *
                                  (X Vars_β * (to_MvPolynomial_Option Vars) (u_wit x)))
                              (List.finRange n_wit)).sum *
                          -(List.map
                                (fun x =>
                                  C (prover.2 Proof_Idx.V (SRS_Elements_Idx.βu x)) *
                                    (X Vars_β * (to_MvPolynomial_Option Vars) (u_wit x)))
                                (List.finRange n_wit)).sum)) +
                  (List.map
                        (fun x =>
                          C (List.map (fun j => stmt j * (u_stmt j).coeff ↑x) (List.finRange n_stmt)).sum *
                            X Vars_τ ^ ↑x)
                        (List.finRange n_var)).sum *
                    -(List.map
                          (fun x =>
                            C (prover.2 Proof_Idx.V (SRS_Elements_Idx.βu x)) *
                              (X Vars_β * (to_MvPolynomial_Option Vars) (u_wit x)))
                          (List.finRange n_wit)).sum +
                ((List.map (fun x => C (prover.1 Proof_Idx.V (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x)
                          (List.finRange n_var)).sum *
                      -(C (prover.2 Proof_Idx.V SRS_Elements_Idx.γβ) * (X Vars_γ * X Vars_β)) +
                    (C (prover.1 Proof_Idx.V SRS_Elements_Idx.γ) * X Vars_β *
                        -(C (prover.2 Proof_Idx.V SRS_Elements_Idx.γβ) * (X Vars_γ * X Vars_β)) +
                      (C (prover.1 Proof_Idx.V SRS_Elements_Idx.γβ) * (X Vars_γ * X Vars_β) *
                          -(C (prover.2 Proof_Idx.V SRS_Elements_Idx.γβ) * (X Vars_γ * X Vars_β)) +
                        (List.map
                              (fun x =>
                                C (prover.1 Proof_Idx.V (SRS_Elements_Idx.βu x)) *
                                  (X Vars_β * (to_MvPolynomial_Option Vars) (u_wit x)))
                              (List.finRange n_wit)).sum *
                          -(C (prover.2 Proof_Idx.V SRS_Elements_Idx.γβ) * (X Vars_γ * X Vars_β)))) +
                  (List.map
                        (fun x =>
                          C (List.map (fun j => stmt j * (u_stmt j).coeff ↑x) (List.finRange n_stmt)).sum *
                            X Vars_τ ^ ↑x)
                        (List.finRange n_var)).sum *
                    -(C (prover.2 Proof_Idx.V SRS_Elements_Idx.γβ) * (X Vars_γ * X Vars_β))) +
              ((List.map (fun x => C (prover.1 Proof_Idx.V (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x)
                        (List.finRange n_var)).sum *
                    -(C (prover.2 Proof_Idx.V SRS_Elements_Idx.γ) * X Vars_β) +
                  (C (prover.1 Proof_Idx.V SRS_Elements_Idx.γ) * X Vars_β *
                      -(C (prover.2 Proof_Idx.V SRS_Elements_Idx.γ) * X Vars_β) +
                    (C (prover.1 Proof_Idx.V SRS_Elements_Idx.γβ) * (X Vars_γ * X Vars_β) *
                        -(C (prover.2 Proof_Idx.V SRS_Elements_Idx.γ) * X Vars_β) +
                      (List.map
                            (fun x =>
                              C (prover.1 Proof_Idx.V (SRS_Elements_Idx.βu x)) *
                                (X Vars_β * (to_MvPolynomial_Option Vars) (u_wit x)))
                            (List.finRange n_wit)).sum *
                        -(C (prover.2 Proof_Idx.V SRS_Elements_Idx.γ) * X Vars_β))) +
                (List.map
                      (fun x =>
                        C (List.map (fun j => stmt j * (u_stmt j).coeff ↑x) (List.finRange n_stmt)).sum * X Vars_τ ^ ↑x)
                      (List.finRange n_var)).sum *
                  -(C (prover.2 Proof_Idx.V SRS_Elements_Idx.γ) * X Vars_β)) +
            ((List.map (fun x => C (prover.1 Proof_Idx.V (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x)
                      (List.finRange n_var)).sum *
                  -(List.map (fun x => C (prover.2 Proof_Idx.V (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x)
                        (List.finRange n_var)).sum +
                (C (prover.1 Proof_Idx.V SRS_Elements_Idx.γ) * X Vars_β *
                    -(List.map (fun x => C (prover.2 Proof_Idx.V (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x)
                          (List.finRange n_var)).sum +
                  (C (prover.1 Proof_Idx.V SRS_Elements_Idx.γβ) * (X Vars_γ * X Vars_β) *
                      -(List.map (fun x => C (prover.2 Proof_Idx.V (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x)
                            (List.finRange n_var)).sum +
                    (List.map
                          (fun x =>
                            C (prover.1 Proof_Idx.V (SRS_Elements_Idx.βu x)) *
                              (X Vars_β * (to_MvPolynomial_Option Vars) (u_wit x)))
                          (List.finRange n_wit)).sum *
                      -(List.map (fun x => C (prover.2 Proof_Idx.V (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x)
                            (List.finRange n_var)).sum)) +
              (List.map
                    (fun x =>
                      C (List.map (fun j => stmt j * (u_stmt j).coeff ↑x) (List.finRange n_stmt)).sum * X Vars_τ ^ ↑x)
                    (List.finRange n_var)).sum *
                -(List.map (fun x => C (prover.2 Proof_Idx.V (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x)
                      (List.finRange n_var)).sum) +
          ((List.map (fun x => C (prover.1 Proof_Idx.V (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x)
                    (List.finRange n_var)).sum *
                (List.map
                    (fun x =>
                      -(C (List.map (fun j => stmt j * (u_stmt j).coeff ↑x) (List.finRange n_stmt)).sum *
                          X Vars_τ ^ ↑x))
                    (List.finRange n_var)).sum +
              (C (prover.1 Proof_Idx.V SRS_Elements_Idx.γ) * X Vars_β *
                  (List.map
                      (fun x =>
                        -(C (List.map (fun j => stmt j * (u_stmt j).coeff ↑x) (List.finRange n_stmt)).sum *
                            X Vars_τ ^ ↑x))
                      (List.finRange n_var)).sum +
                (C (prover.1 Proof_Idx.V SRS_Elements_Idx.γβ) * (X Vars_γ * X Vars_β) *
                    (List.map
                        (fun x =>
                          -(C (List.map (fun j => stmt j * (u_stmt j).coeff ↑x) (List.finRange n_stmt)).sum *
                              X Vars_τ ^ ↑x))
                        (List.finRange n_var)).sum +
                  (List.map
                        (fun x =>
                          C (prover.1 Proof_Idx.V (SRS_Elements_Idx.βu x)) *
                            (X Vars_β * (to_MvPolynomial_Option Vars) (u_wit x)))
                        (List.finRange n_wit)).sum *
                    (List.map
                        (fun x =>
                          -(C (List.map (fun j => stmt j * (u_stmt j).coeff ↑x) (List.finRange n_stmt)).sum *
                              X Vars_τ ^ ↑x))
                        (List.finRange n_var)).sum)) +
            (List.map
                  (fun x =>
                    C (List.map (fun j => stmt j * (u_stmt j).coeff ↑x) (List.finRange n_stmt)).sum * X Vars_τ ^ ↑x)
                  (List.finRange n_var)).sum *
              (List.map
                  (fun x =>
                    -(C (List.map (fun j => stmt j * (u_stmt j).coeff ↑x) (List.finRange n_stmt)).sum * X Vars_τ ^ ↑x))
                  (List.finRange n_var)).sum))) =
    0
eqnII :
  (List.map (fun x => C (prover.1 Proof_Idx.B (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x) (List.finRange n_var)).sum *
          X Vars_β +
        (C (prover.1 Proof_Idx.B SRS_Elements_Idx.γ) * X Vars_β * X Vars_β +
          (C (prover.1 Proof_Idx.B SRS_Elements_Idx.γβ) * (X Vars_γ * X Vars_β) * X Vars_β +
            (List.map
                  (fun x =>
                    C (prover.1 Proof_Idx.B (SRS_Elements_Idx.βu x)) *
                      (X Vars_β * (to_MvPolynomial_Option Vars) (u_wit x)))
                  (List.finRange n_wit)).sum *
              X Vars_β)) +
      (X Vars_γ * X Vars_β *
              -(List.map
                    (fun x =>
                      C (prover.2 Proof_Idx.V (SRS_Elements_Idx.βu x)) *
                        (X Vars_β * (to_MvPolynomial_Option Vars) (u_wit x)))
                    (List.finRange n_wit)).sum +
            X Vars_γ * X Vars_β * -(C (prover.2 Proof_Idx.V SRS_Elements_Idx.γβ) * (X Vars_γ * X Vars_β)) +
          X Vars_γ * X Vars_β * -(C (prover.2 Proof_Idx.V SRS_Elements_Idx.γ) * X Vars_β) +
        X Vars_γ * X Vars_β *
          -(List.map (fun x => C (prover.2 Proof_Idx.V (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x)
                (List.finRange n_var)).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_Idx.B (SRS_Elements_Idx.βu i)) * u_wit i)
              (List.finRange n_wit)).sum) ^
        2 -
      1 =
    t *
      (List.map (fun i => Polynomial.C (prover.1 Proof_Idx.H (SRS_Elements_Idx.βu i)) * u_wit i)
          (List.finRange n_wit)).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 eqnI eqnII eqnH eqnV eqnB
State after:
case intro.intro.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
t : Polynomial F
ht : (List.map (fun x => Polynomial.C (t.coeff ↑x) * Polynomial.X ^ ↑x) (List.finRange n_var)).sum = t
ht0 : t.Monic
stmt : BabySNARK.Stmt
prover : Prover F BabySNARK
eqnI :
  (List.map (fun x => C (prover.1 Proof_Idx.H (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x) (List.finRange n_var)).sum *
            (List.map (fun x => C (t.coeff ↑x) * X Vars_τ ^ ↑x) (List.finRange n_var)).sum +
          (X Vars_β *
              (C (prover.1 Proof_Idx.H SRS_Elements_Idx.γ) *
                (List.map (fun x => C (t.coeff ↑x) * X Vars_τ ^ ↑x) (List.finRange n_var)).sum) +
            (X Vars_γ *
                (X Vars_β *
                  (C (prover.1 Proof_Idx.H SRS_Elements_Idx.γβ) *
                    (List.map (fun x => C (t.coeff ↑x) * X Vars_τ ^ ↑x) (List.finRange n_var)).sum)) +
              X Vars_β *
                ((List.map
                      (fun b =>
                        C (prover.1 Proof_Idx.H (SRS_Elements_Idx.βu b)) * (to_MvPolynomial_Option Vars) (u_wit b))
                      (List.finRange n_wit)).sum *
                  (List.map (fun x => C (t.coeff ↑x) * X Vars_τ ^ ↑x) (List.finRange n_var)).sum))) +
        (List.map (fun x => C (t.coeff ↑x) * X Vars_τ ^ ↑x) (List.finRange n_var)).sum *
          (List.map (fun x => C (t.coeff ↑x) * X Vars_τ ^ ↑x) (List.finRange n_var)).sum +
      ((List.map (fun x => C (if ↑x = 0 then 1 else 0) * X Vars_τ ^ ↑x) (List.finRange n_var)).sum *
          (List.map (fun x => C (if ↑x = 0 then 1 else 0) * X Vars_τ ^ ↑x) (List.finRange n_var)).sum +
        (-(X Vars_β *
                        ((List.map (fun x => C (prover.1 Proof_Idx.V (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x)
                              (List.finRange n_var)).sum *
                          (List.map
                              (fun b =>
                                C (prover.2 Proof_Idx.V (SRS_Elements_Idx.βu b)) *
                                  (to_MvPolynomial_Option Vars) (u_wit b))
                              (List.finRange n_wit)).sum)) +
                    (-(X Vars_β *
                          (X Vars_β *
                            (C (prover.1 Proof_Idx.V SRS_Elements_Idx.γ) *
                              (List.map
                                  (fun b =>
                                    C (prover.2 Proof_Idx.V (SRS_Elements_Idx.βu b)) *
                                      (to_MvPolynomial_Option Vars) (u_wit b))
                                  (List.finRange n_wit)).sum))) +
                      (-(X Vars_γ *
                            (X Vars_β *
                              (X Vars_β *
                                (C (prover.1 Proof_Idx.V SRS_Elements_Idx.γβ) *
                                  (List.map
                                      (fun b =>
                                        C (prover.2 Proof_Idx.V (SRS_Elements_Idx.βu b)) *
                                          (to_MvPolynomial_Option Vars) (u_wit b))
                                      (List.finRange n_wit)).sum)))) +
                        -(X Vars_β *
                            (X Vars_β *
                              ((List.map
                                    (fun b =>
                                      C (prover.1 Proof_Idx.V (SRS_Elements_Idx.βu b)) *
                                        (to_MvPolynomial_Option Vars) (u_wit b))
                                    (List.finRange n_wit)).sum *
                                (List.map
                                    (fun b =>
                                      C (prover.2 Proof_Idx.V (SRS_Elements_Idx.βu b)) *
                                        (to_MvPolynomial_Option Vars) (u_wit b))
                                    (List.finRange n_wit)).sum))))) +
                  -(X Vars_β *
                      ((List.map
                            (fun x =>
                              C (List.map (fun j => stmt j * (u_stmt j).coeff ↑x) (List.finRange n_stmt)).sum *
                                X Vars_τ ^ ↑x)
                            (List.finRange n_var)).sum *
                        (List.map
                            (fun b =>
                              C (prover.2 Proof_Idx.V (SRS_Elements_Idx.βu b)) *
                                (to_MvPolynomial_Option Vars) (u_wit b))
                            (List.finRange n_wit)).sum)) +
                (-(X Vars_γ *
                        (X Vars_β *
                          ((List.map (fun x => C (prover.1 Proof_Idx.V (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x)
                                (List.finRange n_var)).sum *
                            C (prover.2 Proof_Idx.V SRS_Elements_Idx.γβ)))) +
                    (-(X Vars_β *
                          (X Vars_γ *
                            (X Vars_β *
                              (C (prover.1 Proof_Idx.V SRS_Elements_Idx.γ) *
                                C (prover.2 Proof_Idx.V SRS_Elements_Idx.γβ))))) +
                      (-(X Vars_γ *
                            (X Vars_β *
                              (X Vars_γ *
                                (X Vars_β *
                                  (C (prover.1 Proof_Idx.V SRS_Elements_Idx.γβ) *
                                    C (prover.2 Proof_Idx.V SRS_Elements_Idx.γβ)))))) +
                        -(X Vars_β *
                            (X Vars_γ *
                              (X Vars_β *
                                ((List.map
                                      (fun b =>
                                        C (prover.1 Proof_Idx.V (SRS_Elements_Idx.βu b)) *
                                          (to_MvPolynomial_Option Vars) (u_wit b))
                                      (List.finRange n_wit)).sum *
                                  C (prover.2 Proof_Idx.V SRS_Elements_Idx.γβ))))))) +
                  -(X Vars_γ *
                      (X Vars_β *
                        ((List.map
                              (fun x =>
                                C (List.map (fun j => stmt j * (u_stmt j).coeff ↑x) (List.finRange n_stmt)).sum *
                                  X Vars_τ ^ ↑x)
                              (List.finRange n_var)).sum *
                          C (prover.2 Proof_Idx.V SRS_Elements_Idx.γβ))))) +
              (-(X Vars_β *
                      ((List.map (fun x => C (prover.1 Proof_Idx.V (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x)
                            (List.finRange n_var)).sum *
                        C (prover.2 Proof_Idx.V SRS_Elements_Idx.γ))) +
                  (-(X Vars_β *
                        (X Vars_β *
                          (C (prover.1 Proof_Idx.V SRS_Elements_Idx.γ) *
                            C (prover.2 Proof_Idx.V SRS_Elements_Idx.γ)))) +
                    (-(X Vars_γ *
                          (X Vars_β *
                            (X Vars_β *
                              (C (prover.1 Proof_Idx.V SRS_Elements_Idx.γβ) *
                                C (prover.2 Proof_Idx.V SRS_Elements_Idx.γ))))) +
                      -(X Vars_β *
                          (X Vars_β *
                            ((List.map
                                  (fun b =>
                                    C (prover.1 Proof_Idx.V (SRS_Elements_Idx.βu b)) *
                                      (to_MvPolynomial_Option Vars) (u_wit b))
                                  (List.finRange n_wit)).sum *
                              C (prover.2 Proof_Idx.V SRS_Elements_Idx.γ)))))) +
                -(X Vars_β *
                    ((List.map
                          (fun x =>
                            C (List.map (fun j => stmt j * (u_stmt j).coeff ↑x) (List.finRange n_stmt)).sum *
                              X Vars_τ ^ ↑x)
                          (List.finRange n_var)).sum *
                      C (prover.2 Proof_Idx.V SRS_Elements_Idx.γ)))) +
            (-((List.map (fun x => C (prover.1 Proof_Idx.V (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x)
                        (List.finRange n_var)).sum *
                    (List.map (fun x => C (prover.2 Proof_Idx.V (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x)
                        (List.finRange n_var)).sum) +
                (-(X Vars_β *
                      (C (prover.1 Proof_Idx.V SRS_Elements_Idx.γ) *
                        (List.map (fun x => C (prover.2 Proof_Idx.V (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x)
                            (List.finRange n_var)).sum)) +
                  (-(X Vars_γ *
                        (X Vars_β *
                          (C (prover.1 Proof_Idx.V SRS_Elements_Idx.γβ) *
                            (List.map (fun x => C (prover.2 Proof_Idx.V (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x)
                                (List.finRange n_var)).sum))) +
                    -(X Vars_β *
                        ((List.map
                              (fun b =>
                                C (prover.1 Proof_Idx.V (SRS_Elements_Idx.βu b)) *
                                  (to_MvPolynomial_Option Vars) (u_wit b))
                              (List.finRange n_wit)).sum *
                          (List.map (fun x => C (prover.2 Proof_Idx.V (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x)
                              (List.finRange n_var)).sum)))) +
              -((List.map
                      (fun x =>
                        C (List.map (fun j => stmt j * (u_stmt j).coeff ↑x) (List.finRange n_stmt)).sum * X Vars_τ ^ ↑x)
                      (List.finRange n_var)).sum *
                  (List.map (fun x => C (prover.2 Proof_Idx.V (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x)
                      (List.finRange n_var)).sum)) +
          ((List.map (fun x => C (prover.1 Proof_Idx.V (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x)
                    (List.finRange n_var)).sum *
                (List.map
                    (fun x =>
                      -(C (List.map (fun j => stmt j * (u_stmt j).coeff ↑x) (List.finRange n_stmt)).sum *
                          X Vars_τ ^ ↑x))
                    (List.finRange n_var)).sum +
              (X Vars_β *
                  (C (prover.1 Proof_Idx.V SRS_Elements_Idx.γ) *
                    (List.map
                        (fun x =>
                          -(C (List.map (fun j => stmt j * (u_stmt j).coeff ↑x) (List.finRange n_stmt)).sum *
                              X Vars_τ ^ ↑x))
                        (List.finRange n_var)).sum) +
                (X Vars_γ *
                    (X Vars_β *
                      (C (prover.1 Proof_Idx.V SRS_Elements_Idx.γβ) *
                        (List.map
                            (fun x =>
                              -(C (List.map (fun j => stmt j * (u_stmt j).coeff ↑x) (List.finRange n_stmt)).sum *
                                  X Vars_τ ^ ↑x))
                            (List.finRange n_var)).sum)) +
                  X Vars_β *
                    ((List.map
                          (fun b =>
                            C (prover.1 Proof_Idx.V (SRS_Elements_Idx.βu b)) * (to_MvPolynomial_Option Vars) (u_wit b))
                          (List.finRange n_wit)).sum *
                      (List.map
                          (fun x =>
                            -(C (List.map (fun j => stmt j * (u_stmt j).coeff ↑x) (List.finRange n_stmt)).sum *
                                X Vars_τ ^ ↑x))
                          (List.finRange n_var)).sum))) +
            (List.map
                  (fun x =>
                    C (List.map (fun j => stmt j * (u_stmt j).coeff ↑x) (List.finRange n_stmt)).sum * X Vars_τ ^ ↑x)
                  (List.finRange n_var)).sum *
              (List.map
                  (fun x =>
                    -(C (List.map (fun j => stmt j * (u_stmt j).coeff ↑x) (List.finRange n_stmt)).sum * X Vars_τ ^ ↑x))
                  (List.finRange n_var)).sum))) =
    0
eqnII :
  X Vars_β *
          (List.map (fun x => C (prover.1 Proof_Idx.B (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x)
              (List.finRange n_var)).sum +
        (X Vars_β * (X Vars_β * C (prover.1 Proof_Idx.B SRS_Elements_Idx.γ)) +
          (X Vars_γ * (X Vars_β * (X Vars_β * C (prover.1 Proof_Idx.B SRS_Elements_Idx.γβ))) +
            X Vars_β *
              (X Vars_β *
                (List.map
                    (fun b =>
                      C (prover.1 Proof_Idx.B (SRS_Elements_Idx.βu b)) * (to_MvPolynomial_Option Vars) (u_wit b))
                    (List.finRange n_wit)).sum))) +
      (-(X Vars_γ *
                (X Vars_β *
                  (X Vars_β *
                    (List.map
                        (fun b =>
                          C (prover.2 Proof_Idx.V (SRS_Elements_Idx.βu b)) * (to_MvPolynomial_Option Vars) (u_wit b))
                        (List.finRange n_wit)).sum))) +
            -(X Vars_γ * (X Vars_β * (X Vars_γ * (X Vars_β * C (prover.2 Proof_Idx.V SRS_Elements_Idx.γβ))))) +
          -(X Vars_γ * (X Vars_β * (X Vars_β * C (prover.2 Proof_Idx.V SRS_Elements_Idx.γ)))) +
        -(X Vars_γ *
            (X Vars_β *
              (List.map (fun x => C (prover.2 Proof_Idx.V (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x)
                  (List.finRange n_var)).sum))) =
    0
eqnH :
  (List.map (fun x => C (prover.1 Proof_Idx.H (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x) (List.finRange n_var)).sum +
      (X Vars_β * C (prover.1 Proof_Idx.H SRS_Elements_Idx.γ) +
        (X Vars_γ * (X Vars_β * C (prover.1 Proof_Idx.H SRS_Elements_Idx.γβ)) +
          X Vars_β *
            (List.map
                (fun b => C (prover.1 Proof_Idx.H (SRS_Elements_Idx.βu b)) * (to_MvPolynomial_Option Vars) (u_wit b))
                (List.finRange n_wit)).sum)) =
    (List.map (fun x => C (prover.2 Proof_Idx.H (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x)
          (List.finRange n_var)).sum +
      (X Vars_β * C (prover.2 Proof_Idx.H SRS_Elements_Idx.γ) +
        (X Vars_γ * (X Vars_β * C (prover.2 Proof_Idx.H SRS_Elements_Idx.γβ)) +
          X Vars_β *
            (List.map
                (fun b => C (prover.2 Proof_Idx.H (SRS_Elements_Idx.βu b)) * (to_MvPolynomial_Option Vars) (u_wit b))
                (List.finRange n_wit)).sum))
eqnV :
  (List.map (fun x => C (prover.1 Proof_Idx.V (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x) (List.finRange n_var)).sum +
      (X Vars_β * C (prover.1 Proof_Idx.V SRS_Elements_Idx.γ) +
        (X Vars_γ * (X Vars_β * C (prover.1 Proof_Idx.V SRS_Elements_Idx.γβ)) +
          X Vars_β *
            (List.map
                (fun b => C (prover.1 Proof_Idx.V (SRS_Elements_Idx.βu b)) * (to_MvPolynomial_Option Vars) (u_wit b))
                (List.finRange n_wit)).sum)) =
    (List.map (fun x => C (prover.2 Proof_Idx.V (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x)
          (List.finRange n_var)).sum +
      (X Vars_β * C (prover.2 Proof_Idx.V SRS_Elements_Idx.γ) +
        (X Vars_γ * (X Vars_β * C (prover.2 Proof_Idx.V SRS_Elements_Idx.γβ)) +
          X Vars_β *
            (List.map
                (fun b => C (prover.2 Proof_Idx.V (SRS_Elements_Idx.βu b)) * (to_MvPolynomial_Option Vars) (u_wit b))
                (List.finRange n_wit)).sum))
eqnB :
  (List.map (fun x => C (prover.1 Proof_Idx.B (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x) (List.finRange n_var)).sum +
      (X Vars_β * C (prover.1 Proof_Idx.B SRS_Elements_Idx.γ) +
        (X Vars_γ * (X Vars_β * C (prover.1 Proof_Idx.B SRS_Elements_Idx.γβ)) +
          X Vars_β *
            (List.map
                (fun b => C (prover.1 Proof_Idx.B (SRS_Elements_Idx.βu b)) * (to_MvPolynomial_Option Vars) (u_wit b))
                (List.finRange n_wit)).sum)) =
    (List.map (fun x => C (prover.2 Proof_Idx.B (SRS_Elements_Idx.τ_pow x)) * X Vars_τ ^ ↑x)
          (List.finRange n_var)).sum +
      (X Vars_β * C (prover.2 Proof_Idx.B SRS_Elements_Idx.γ) +
        (X Vars_γ * (X Vars_β * C (prover.2 Proof_Idx.B SRS_Elements_Idx.γβ)) +
          X Vars_β *
            (List.map
                (fun b => C (prover.2 Proof_Idx.B (SRS_Elements_Idx.βu b)) * (to_MvPolynomial_Option Vars) (u_wit b))
                (List.finRange n_wit)).sum))
⊢ ((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_Idx.B (SRS_Elements_Idx.βu i)) * u_wit i)
              (List.finRange n_wit)).sum) ^
        2 -
      1 =
    t *
      (List.map (fun i => Polynomial.C (prover.1 Proof_Idx.H (SRS_Elements_Idx.βu i)) * u_wit i)
          (List.finRange n_wit)).sum