-- Mathlib/Combinatorics/Optimization/ValuedCSP.lean
lemma Function.HasMaxCutProperty.forbids_commutativeFractionalPolymorphism
    {f : (Fin 2 → D) → C} (mcf : f.HasMaxCutProperty)
    {ω : FractionalOperation D 2} (valid : ω.IsValid) (symmega : ω.IsSymmetric) :
    ¬ f.AdmitsFractional ω

Proof state:
D : Type u_1
C : Type u_3
inst✝ : OrderedCancelAddCommMonoid C
f : (Fin 2 → D) → C
ω : FractionalOperation D 2
valid : ω.IsValid
symmega : ω.IsSymmetric
a b : D
hab : a ≠ b
mcfab : HasMaxCutPropertyAt f a b
contr : 2 • (Multiset.map f (ω.tt ![![a, b], ![b, a]])).sum ≤ ω.size • 2 • f ![a, b]
half_sharp :
  (Multiset.map (fun x => f ![a, b]) (ω.tt ![![a, b], ![b, a]])).sum < (Multiset.map f (ω.tt ![![a, b], ![b, a]])).sum
⊢ 2 • (Multiset.map (fun x => f ![a, b]) (ω.tt ![![a, b], ![b, a]])).sum <
    2 • (Multiset.map f (ω.tt ![![a, b], ![b, a]])).sum

Tactic:
rw [two_nsmul, two_nsmul]

Result:
D : Type u_1
C : Type u_3
inst✝ : OrderedCancelAddCommMonoid C
f : (Fin 2 → D) → C
ω : FractionalOperation D 2
valid : ω.IsValid
symmega : ω.IsSymmetric
a b : D
hab : a ≠ b
mcfab : HasMaxCutPropertyAt f a b
contr : 2 • (Multiset.map f (ω.tt ![![a, b], ![b, a]])).sum ≤ ω.size • 2 • f ![a, b]
half_sharp :
  (Multiset.map (fun x => f ![a, b]) (ω.tt ![![a, b], ![b, a]])).sum < (Multiset.map f (ω.tt ![![a, b], ![b, a]])).sum
⊢ (Multiset.map (fun x => f ![a, b]) (ω.tt ![![a, b], ![b, a]])).sum +
      (Multiset.map (fun x => f ![a, b]) (ω.tt ![![a, b], ![b, a]])).sum <
    (Multiset.map f (ω.tt ![![a, b], ![b, a]])).sum + (Multiset.map f (ω.tt ![![a, b], ![b, a]])).sum

Proof state:
D : Type u_1
C : Type u_3
inst✝ : OrderedCancelAddCommMonoid C
f : (Fin 2 → D) → C
ω : FractionalOperation D 2
valid : ω.IsValid
symmega : ω.IsSymmetric
a b : D
hab : a ≠ b
mcfab : HasMaxCutPropertyAt f a b
contr : 2 • (Multiset.map f (ω.tt ![![a, b], ![b, a]])).sum ≤ ω.size • 2 • f ![a, b]
sharp :
  2 • (Multiset.map (fun x => f ![a, b]) (ω.tt ![![a, b], ![b, a]])).sum <
    2 • (Multiset.map f (ω.tt ![![a, b], ![b, a]])).sum
⊢ 2 • (Multiset.map (fun x => f ![a, b]) ω).sum < ω.size • 2 • f ![a, b]

Tactic:
convert lt_of_lt_of_le sharp contr

Result:
case h.e'_3.h.e'_6.h.e'_3
D : Type u_1
C : Type u_3
inst✝ : OrderedCancelAddCommMonoid C
f : (Fin 2 → D) → C
ω : FractionalOperation D 2
valid : ω.IsValid
symmega : ω.IsSymmetric
a b : D
hab : a ≠ b
mcfab : HasMaxCutPropertyAt f a b
contr : 2 • (Multiset.map f (ω.tt ![![a, b], ![b, a]])).sum ≤ ω.size • 2 • f ![a, b]
sharp :
  2 • (Multiset.map (fun x => f ![a, b]) (ω.tt ![![a, b], ![b, a]])).sum <
    2 • (Multiset.map f (ω.tt ![![a, b], ![b, a]])).sum
⊢ Multiset.map (fun x => f ![a, b]) ω = Multiset.map (fun x => f ![a, b]) (ω.tt ![![a, b], ![b, a]])

Proof state:
D : Type u_1
C : Type u_3
inst✝ : OrderedCancelAddCommMonoid C
f : (Fin 2 → D) → C
ω : FractionalOperation D 2
valid : ω.IsValid
symmega : ω.IsSymmetric
a b : D
hab : a ≠ b
mcfab : HasMaxCutPropertyAt f a b
contr : 2 • (Multiset.map f (ω.tt ![![a, b], ![b, a]])).sum ≤ ω.size • 2 • f ![a, b]
g : (Fin 2 → D) → D
h✝ : g ∈ ω
⊢ ∃ a_1 ∈ ω, (fun i => a_1 (swap ![![a, b], ![b, a]] i)) = fun i => g (swap ![![a, b], ![b, a]] i)

Tactic:
use g

Result:
no goals

Proof state:
D : Type u_1
C : Type u_3
inst✝ : OrderedCancelAddCommMonoid C
f : (Fin 2 → D) → C
ω : FractionalOperation D 2
valid : ω.IsValid
symmega : ω.IsSymmetric
a b : D
hab : a ≠ b
mcfab : HasMaxCutPropertyAt f a b
contr : 2 • (Multiset.map f (ω.tt ![![a, b], ![b, a]])).sum ≤ ω.size • 2 • f ![a, b]
g : (Fin 2 → D) → D
h✝ : g ∈ ω
⊢ (fun i => g (swap ![![a, b], ![b, a]] i)) ∈ ω.tt ![![a, b], ![b, a]]

Tactic:
simp only [FractionalOperation.tt, Multiset.mem_map]

Result:
D : Type u_1
C : Type u_3
inst✝ : OrderedCancelAddCommMonoid C
f : (Fin 2 → D) → C
ω : FractionalOperation D 2
valid : ω.IsValid
symmega : ω.IsSymmetric
a b : D
hab : a ≠ b
mcfab : HasMaxCutPropertyAt f a b
contr : 2 • (Multiset.map f (ω.tt ![![a, b], ![b, a]])).sum ≤ ω.size • 2 • f ![a, b]
g : (Fin 2 → D) → D
h✝ : g ∈ ω
⊢ ∃ a_1 ∈ ω, (fun i => a_1 (swap ![![a, b], ![b, a]] i)) = fun i => g (swap ![![a, b], ![b, a]] i)

Proof state:
case intro.intro.intro
D : Type u_1
C : Type u_3
inst✝ : OrderedCancelAddCommMonoid C
f : (Fin 2 → D) → C
ω : FractionalOperation D 2
valid : ω.IsValid
symmega : ω.IsSymmetric
a b : D
hab : a ≠ b
mcfab : HasMaxCutPropertyAt f a b
contr : 2 • (Multiset.map f (ω.tt ![![a, b], ![b, a]])).sum ≤ ω.size • 2 • f ![a, b]
sharp :
  2 • (Multiset.map (fun x => f ![a, b]) (ω.tt ![![a, b], ![b, a]])).sum <
    2 • (Multiset.map f (ω.tt ![![a, b], ![b, a]])).sum
impos : 2 • (Multiset.map (fun x => f ![a, b]) ω).sum < ω.size • 2 • f ![a, b]
⊢ False

Tactic:
have rhs_swap : ω.size • 2 • f ![a, b] = 2 • ω.size • f ![a, b] := nsmul_left_comm ..

Result:
case intro.intro.intro
D : Type u_1
C : Type u_3
inst✝ : OrderedCancelAddCommMonoid C
f : (Fin 2 → D) → C
ω : FractionalOperation D 2
valid : ω.IsValid
symmega : ω.IsSymmetric
a b : D
hab : a ≠ b
mcfab : HasMaxCutPropertyAt f a b
contr : 2 • (Multiset.map f (ω.tt ![![a, b], ![b, a]])).sum ≤ ω.size • 2 • f ![a, b]
sharp :
  2 • (Multiset.map (fun x => f ![a, b]) (ω.tt ![![a, b], ![b, a]])).sum <
    2 • (Multiset.map f (ω.tt ![![a, b], ![b, a]])).sum
impos : 2 • (Multiset.map (fun x => f ![a, b]) ω).sum < ω.size • 2 • f ![a, b]
rhs_swap : ω.size • 2 • f ![a, b] = 2 • ω.size • f ![a, b]
⊢ False