Imports
import Mathlib.Tactic
set_option doc.verso.suggestions false

Analysis I, Section 7.1: Finite series

I have attempted to make the translation as faithful a paraphrasing as possible of the original text. When there is a choice between a more idiomatic Lean solution and a more faithful translation, I have generally chosen the latter. In particular, there will be places where the Lean code could be "golfed" to be more elegant and idiomatic, but I have consciously avoided doing so.

Technical note: it is convenient in Lean to extend finite sequences (usually by zero) to be functions on the entire integers.

Main constructions and results of this section:

-- This makes available the convenient notation `∑ n ∈ A, f n` to denote summation of `f n` for -- `n` ranging over a finite set `A`. open BigOperators
  • API for summation over finite sets (encoded using Mathlib's Finset type), using the Finset.­sum method and the ∑ n ∈ A, f n notation.

  • Fubini's theorem for finite series

We do not attempt to replicate the full API for Finset.­sum here, but in subsequent sections we shall make liberal use of this API.

-- This is a technical device to avoid Mathlib's insistence on decidable equality for finite sets. open Classicalnamespace Finset-- We use `Finset.Icc` to describe finite intervals in the integers. `Finset.mem_Icc` is the -- standard Mathlib tool for checking membership in such intervals. Finset.mem_Icc.{u_1} {α : Type u_1} [Preorder α] [LocallyFiniteOrder α] {a b x : α} : x Icc a b a x x b#check mem_Icc

Definition 7.1.1

theorem sum_of_empty {n m:} (h: n < m) (a: ) : i Icc m n, a i = 0 := n:m:h:n < ma: i Icc m n, a i = 0 n:m:h:n < ma: x Icc m n, a x = 0; n:m:h:n < ma: x✝:x✝ Icc m n a x✝ = 0; n:m:h:n < ma: x✝:m x✝ x✝ n a x✝ = 0; All goals completed! 🐙

Definition 7.1.1. This is similar to Mathlib's Finset.­sum_Icc_succ_top except that the latter involves summation over the natural numbers rather than integers.

theorem sum_of_nonempty {n m:} (h: n m-1) (a: ) : i Icc m (n+1), a i = i Icc m n, a i + a (n+1) := n:m:h:n m - 1a: i Icc m (n + 1), a i = i Icc m n, a i + a (n + 1) n:m:h:n m - 1a: i Icc m (n + 1), a i = a (n + 1) + i Icc m n, a i n:m:h:n m - 1a: Icc m (n + 1) = insert (n + 1) (Icc m n)n:m:h:n m - 1a: DecidableEq n:m:h:n m - 1a: n + 1 Icc m n n:m:h:n m - 1a: Icc m (n + 1) = insert (n + 1) (Icc m n) n:m:h:n m - 1a: a✝:a✝ Icc m (n + 1) a✝ insert (n + 1) (Icc m n); n:m:h:n m - 1a: a✝:m a✝ a✝ n + 1 a✝ = n + 1 m a✝ a✝ n; All goals completed! 🐙 n:m:h:n m - 1a: DecidableEq All goals completed! 🐙 All goals completed! 🐙
declaration uses `sorry`example (a: ) (m:) : i Icc m (m-2), a i = 0 := a: m: i Icc m (m - 2), a i = 0 All goals completed! 🐙declaration uses `sorry`example (a: ) (m:) : i Icc m (m-1), a i = 0 := a: m: i Icc m (m - 1), a i = 0 All goals completed! 🐙declaration uses `sorry`example (a: ) (m:) : i Icc m m, a i = a m := a: m: i Icc m m, a i = a m All goals completed! 🐙declaration uses `sorry`example (a: ) (m:) : i Icc m (m+1), a i = a m + a (m+1) := a: m: i Icc m (m + 1), a i = a m + a (m + 1) All goals completed! 🐙declaration uses `sorry`example (a: ) (m:) : i Icc m (m+2), a i = a m + a (m+1) + a (m+2) := a: m: i Icc m (m + 2), a i = a m + a (m + 1) + a (m + 2) All goals completed! 🐙/-- Remark 7.1.3 -/ example (a: ) (m n:) : i Icc m n, a i = j Icc m n, a j := rfl

Lemma 7.1.4(a) / Exercise 7.1.1

theorem declaration uses `sorry`concat_finite_series {m n p:} (hmn: m n+1) (hpn : n p) (a: ) : i Icc m n, a i + i Icc (n+1) p, a i = i Icc m p, a i := m:n:p:hmn:m n + 1hpn:n pa: i Icc m n, a i + i Icc (n + 1) p, a i = i Icc m p, a i All goals completed! 🐙

Lemma 7.1.4(b) / Exercise 7.1.1

theorem declaration uses `sorry`shift_finite_series {m n k:} (a: ) : i Icc m n, a i = i Icc (m+k) (n+k), a (i-k) := m:n:k:a: i Icc m n, a i = i Icc (m + k) (n + k), a (i - k) All goals completed! 🐙

Lemma 7.1.4(c) / Exercise 7.1.1

theorem declaration uses `sorry`finite_series_add {m n:} (a b: ) : i Icc m n, (a i + b i) = i Icc m n, a i + i Icc m n, b i := m:n:a: b: i Icc m n, (a i + b i) = i Icc m n, a i + i Icc m n, b i All goals completed! 🐙

Lemma 7.1.4(d) / Exercise 7.1.1

theorem declaration uses `sorry`finite_series_const_mul {m n:} (a: ) (c:) : i Icc m n, c * a i = c * i Icc m n, a i := m:n:a: c: i Icc m n, c * a i = c * i Icc m n, a i All goals completed! 🐙

Lemma 7.1.4(e) / Exercise 7.1.1

theorem declaration uses `sorry`abs_finite_series_le {m n:} (a: ) : | i Icc m n, a i| i Icc m n, |a i| := m:n:a: | i Icc m n, a i| i Icc m n, |a i| All goals completed! 🐙

Lemma 7.1.4(f) / Exercise 7.1.1

theorem declaration uses `sorry`finite_series_of_le {m n:} {a b: } (h: i, m i i n a i b i) : i Icc m n, a i i Icc m n, b i := m:n:a: b: h: (i : ), m i i n a i b i i Icc m n, a i i Icc m n, b i All goals completed! 🐙
Finset.sum_congr.{u_1, u_4} {ι : Type u_1} {M : Type u_4} {s₁ s₂ : Finset ι} [AddCommMonoid M] {f g : ι M} (h : s₁ = s₂) : (∀ x s₂, f x = g x) s₁.sum f = s₂.sum g#check sum_congr
Finset.sum_congr.{u_1, u_4} {ι : Type u_1} {M : Type u_4} {s₁ s₂ : Finset ι} [AddCommMonoid M] {f g : ι  M}
  (h : s₁ = s₂) : (∀ x  s₂, f x = g x)  s₁.sum f = s₂.sum g

Proposition 7.1.8.

set_option maxHeartbeats 210000 intheorem declaration uses `sorry`finite_series_of_rearrange {n:} {X':Type*} (X: Finset X') (hcard: X.card = n) (f: X' ) (g h: Icc (1:) n X) (hg: Function.Bijective g) (hh: Function.Bijective h) : i Icc (1:) n, (if hi:i Icc (1:) n then f (g i, hi ) else 0) = i Icc (1:) n, (if hi: i Icc (1:) n then f (h i, hi ) else 0) := n:X':Type u_1X:Finset X'hcard:#X = nf:X' g:(Icc 1 n) Xh:(Icc 1 n) Xhg:Function.Bijective ghh:Function.Bijective h(∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0 -- This proof is written to broadly follow the structure of the original text. X':Type u_1f:X' {n : } (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0; X':Type u_1f:X' n: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0 X':Type u_1f:X' (X : Finset X'), #X = 0 (g h : (Icc 1 0) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 0, if hi : i Icc 1 0 then f (g i, hi) else 0) = i Icc 1 0, if hi : i Icc 1 0 then f (h i, hi) else 0X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0 (X : Finset X'), #X = n + 1 (g h : (Icc 1 (n + 1)) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (h i, hi) else 0 X':Type u_1f:X' (X : Finset X'), #X = 0 (g h : (Icc 1 0) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 0, if hi : i Icc 1 0 then f (g i, hi) else 0) = i Icc 1 0, if hi : i Icc 1 0 then f (h i, hi) else 0 All goals completed! 🐙 intro X X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1 (g h : (Icc 1 (n + 1)) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (h i, hi) else 0 X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) X (h : (Icc 1 (n + 1)) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (h i, hi) else 0 X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) XFunction.Bijective g Function.Bijective h (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (h i, hi) else 0 X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective gFunction.Bijective h (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (h i, hi) else 0 X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective h(∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (h i, hi) else 0 -- A technical step: we extend g, h to the entire integers using a slightly artificial map π set π : Icc (1:) (n+1) := fun i if hi: i Icc (1:) (n+1) then i, hi else 1, X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective hi:hi:i Icc 1 (n + 1)1 Icc 1 (n + 1) All goals completed! 🐙 have (g : Icc (1:) (n+1) X) : i Icc (1:) (n+1), (if hi:i Icc (1:) (n+1) then f (g i, hi ) else 0) = i Icc (1:) (n+1), f (g (π i)) := n:X':Type u_1X:Finset X'hcard:#X = nf:X' g:(Icc 1 n) Xh:(Icc 1 n) Xhg:Function.Bijective ghh:Function.Bijective h(∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0 X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g✝:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective hπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, g:(Icc 1 (n + 1)) X x Icc 1 (n + 1), (if hi : x Icc 1 (n + 1) then f (g x, hi) else 0) = f (g (π x)) intro i X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g✝:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective hπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, g:(Icc 1 (n + 1)) Xi:hi:i Icc 1 (n + 1)(if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = f (g (π i)); All goals completed! 🐙 X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective hπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, : (g : (Icc 1 (n + 1)) X), (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), f (g (π i)) i Icc 1 (n + 1), f (g (π i)) = i Icc 1 (n + 1), f (h (π i)) X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective hπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, : (g : (Icc 1 (n + 1)) X), (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), f (g (π i)) i Icc 1 n, f (g (π i)) + f (g (π (n + 1))) = i Icc 1 (n + 1), f (h (π i)) X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective hπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, : (g : (Icc 1 (n + 1)) X), (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), f (g (π i))x:X := g (π (n + 1)) i Icc 1 n, f (g (π i)) + f x = i Icc 1 (n + 1), f (h (π i)) X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective hπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, : (g : (Icc 1 (n + 1)) X), (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), f (g (π i))x:X := g (π (n + 1))j:hj':j Icc 1 (n + 1)hj:h j, hj' = x i Icc 1 n, f (g (π i)) + f x = i Icc 1 (n + 1), f (h (π i)) X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective hπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, : (g : (Icc 1 (n + 1)) X), (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), f (g (π i))x:X := g (π (n + 1))j:hj'✝:j Icc 1 (n + 1)hj:h j, hj' = xhj':1 j j n + 1 i Icc 1 n, f (g (π i)) + f x = i Icc 1 (n + 1), f (h (π i)); X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective hπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, : (g : (Icc 1 (n + 1)) X), (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), f (g (π i))x:X := g (π (n + 1))j:hj':j Icc 1 (n + 1)hj:h j, hj' = xhj1:1 jhj2:j n + 1 i Icc 1 n, f (g (π i)) + f x = i Icc 1 (n + 1), f (h (π i)) X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective hπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, : (g : (Icc 1 (n + 1)) X), (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), f (g (π i))x:X := g (π (n + 1))j:hj':j Icc 1 (n + 1)hj:h j, hj' = xhj1:1 jhj2:j n + 1h': X := fun i if i < j then h (π i) else h (π (i + 1)) i Icc 1 n, f (g (π i)) + f x = i Icc 1 (n + 1), f (h (π i)) have : i Icc (1:) (n + 1), f (h (π i)) = i Icc (1:) n, f (h' i) + f x := calc _ = i Icc (1:) j, f (h (π i)) + i Icc (j+1:) (n + 1), f (h (π i)) := X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective hπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, : (g : (Icc 1 (n + 1)) X), (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), f (g (π i))x:X := g (π (n + 1))j:hj':j Icc 1 (n + 1)hj:h j, hj' = xhj1:1 jhj2:j n + 1h': X := fun i if i < j then h (π i) else h (π (i + 1)) i Icc 1 (n + 1), f (h (π i)) = i Icc 1 j, f (h (π i)) + i Icc (j + 1) (n + 1), f (h (π i)) X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective hπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, : (g : (Icc 1 (n + 1)) X), (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), f (g (π i))x:X := g (π (n + 1))j:hj':j Icc 1 (n + 1)hj:h j, hj' = xhj1:1 jhj2:j n + 1h': X := fun i if i < j then h (π i) else h (π (i + 1)) i Icc 1 j, f (h (π i)) + i Icc (j + 1) (n + 1), f (h (π i)) = i Icc 1 (n + 1), f (h (π i)); X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective hπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, : (g : (Icc 1 (n + 1)) X), (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), f (g (π i))x:X := g (π (n + 1))j:hj':j Icc 1 (n + 1)hj:h j, hj' = xhj1:1 jhj2:j n + 1h': X := fun i if i < j then h (π i) else h (π (i + 1))1 j + 1X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective hπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, : (g : (Icc 1 (n + 1)) X), (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), f (g (π i))x:X := g (π (n + 1))j:hj':j Icc 1 (n + 1)hj:h j, hj' = xhj1:1 jhj2:j n + 1h': X := fun i if i < j then h (π i) else h (π (i + 1))j n + 1 X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective hπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, : (g : (Icc 1 (n + 1)) X), (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), f (g (π i))x:X := g (π (n + 1))j:hj':j Icc 1 (n + 1)hj:h j, hj' = xhj1:1 jhj2:j n + 1h': X := fun i if i < j then h (π i) else h (π (i + 1))1 j + 1X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective hπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, : (g : (Icc 1 (n + 1)) X), (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), f (g (π i))x:X := g (π (n + 1))j:hj':j Icc 1 (n + 1)hj:h j, hj' = xhj1:1 jhj2:j n + 1h': X := fun i if i < j then h (π i) else h (π (i + 1))j n + 1 All goals completed! 🐙 _ = i Icc (1:) (j-1), f (h (π i)) + f ( h (π j) ) + i Icc (j+1:) (n + 1), f (h (π i)) := X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective hπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, : (g : (Icc 1 (n + 1)) X), (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), f (g (π i))x:X := g (π (n + 1))j:hj':j Icc 1 (n + 1)hj:h j, hj' = xhj1:1 jhj2:j n + 1h': X := fun i if i < j then h (π i) else h (π (i + 1)) i Icc 1 j, f (h (π i)) + i Icc (j + 1) (n + 1), f (h (π i)) = i Icc 1 (j - 1), f (h (π i)) + f (h (π j)) + i Icc (j + 1) (n + 1), f (h (π i)) X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective hπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, : (g : (Icc 1 (n + 1)) X), (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), f (g (π i))x:X := g (π (n + 1))j:hj':j Icc 1 (n + 1)hj:h j, hj' = xhj1:1 jhj2:j n + 1h': X := fun i if i < j then h (π i) else h (π (i + 1)) i Icc 1 j, f (h (π i)) = i Icc 1 (j - 1), f (h (π i)) + f (h (π j)); X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective hπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, : (g : (Icc 1 (n + 1)) X), (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), f (g (π i))x:X := g (π (n + 1))j:hj':j Icc 1 (n + 1)hj:h j, hj' = xhj1:1 jhj2:j n + 1h': X := fun i if i < j then h (π i) else h (π (i + 1))j = j - 1 + 1X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective hπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, : (g : (Icc 1 (n + 1)) X), (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), f (g (π i))x:X := g (π (n + 1))j:hj':j Icc 1 (n + 1)hj:h j, hj' = xhj1:1 jhj2:j n + 1h': X := fun i if i < j then h (π i) else h (π (i + 1))π j = π (j - 1 + 1)X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective hπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, : (g : (Icc 1 (n + 1)) X), (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), f (g (π i))x:X := g (π (n + 1))j:hj':j Icc 1 (n + 1)hj:h j, hj' = xhj1:1 jhj2:j n + 1h': X := fun i if i < j then h (π i) else h (π (i + 1))j - 1 1 - 1 X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective hπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, : (g : (Icc 1 (n + 1)) X), (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), f (g (π i))x:X := g (π (n + 1))j:hj':j Icc 1 (n + 1)hj:h j, hj' = xhj1:1 jhj2:j n + 1h': X := fun i if i < j then h (π i) else h (π (i + 1))j = j - 1 + 1X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective hπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, : (g : (Icc 1 (n + 1)) X), (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), f (g (π i))x:X := g (π (n + 1))j:hj':j Icc 1 (n + 1)hj:h j, hj' = xhj1:1 jhj2:j n + 1h': X := fun i if i < j then h (π i) else h (π (i + 1))π j = π (j - 1 + 1)X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective hπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, : (g : (Icc 1 (n + 1)) X), (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), f (g (π i))x:X := g (π (n + 1))j:hj':j Icc 1 (n + 1)hj:h j, hj' = xhj1:1 jhj2:j n + 1h': X := fun i if i < j then h (π i) else h (π (i + 1))j - 1 1 - 1 All goals completed! 🐙 _ = i Icc (1:) (j-1), f (h (π i)) + f x + i Icc (j:) n, f (h (π (i+1))) := X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective hπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, : (g : (Icc 1 (n + 1)) X), (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), f (g (π i))x:X := g (π (n + 1))j:hj':j Icc 1 (n + 1)hj:h j, hj' = xhj1:1 jhj2:j n + 1h': X := fun i if i < j then h (π i) else h (π (i + 1)) i Icc 1 (j - 1), f (h (π i)) + f (h (π j)) + i Icc (j + 1) (n + 1), f (h (π i)) = i Icc 1 (j - 1), f (h (π i)) + f x + i Icc j n, f (h (π (i + 1))) X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective hπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, : (g : (Icc 1 (n + 1)) X), (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), f (g (π i))x:X := g (π (n + 1))j:hj':j Icc 1 (n + 1)hj:h j, hj' = xhj1:1 jhj2:j n + 1h': X := fun i if i < j then h (π i) else h (π (i + 1)) i Icc 1 (j - 1), f (h (π i)) + f (h (π j)) = i Icc 1 (j - 1), f (h (π i)) + f xX':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective hπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, : (g : (Icc 1 (n + 1)) X), (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), f (g (π i))x:X := g (π (n + 1))j:hj':j Icc 1 (n + 1)hj:h j, hj' = xhj1:1 jhj2:j n + 1h': X := fun i if i < j then h (π i) else h (π (i + 1)) i Icc (j + 1) (n + 1), f (h (π i)) = i Icc j n, f (h (π (i + 1))) X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective hπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, : (g : (Icc 1 (n + 1)) X), (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), f (g (π i))x:X := g (π (n + 1))j:hj':j Icc 1 (n + 1)hj:h j, hj' = xhj1:1 jhj2:j n + 1h': X := fun i if i < j then h (π i) else h (π (i + 1)) i Icc 1 (j - 1), f (h (π i)) + f (h (π j)) = i Icc 1 (j - 1), f (h (π i)) + f x All goals completed! 🐙 X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective hπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, : (g : (Icc 1 (n + 1)) X), (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), f (g (π i))x:X := g (π (n + 1))j:hj':j Icc 1 (n + 1)hj:h j, hj' = xhj1:1 jhj2:j n + 1h': X := fun i if i < j then h (π i) else h (π (i + 1)) i Icc j n, f (h (π (i + 1))) = i Icc (j + 1) (n + 1), f (h (π i)); X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective hπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, : (g : (Icc 1 (n + 1)) X), (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), f (g (π i))x:X := g (π (n + 1))j:hj':j Icc 1 (n + 1)hj:h j, hj' = xhj1:1 jhj2:j n + 1h': X := fun i if i < j then h (π i) else h (π (i + 1))x✝:a✝:x✝ Icc (j + 1) (n + 1)π x✝ = π (x✝ - 1 + 1); All goals completed! 🐙 _ = i Icc (1:) (j-1), f (h (π i)) + i Icc (j:) n, f (h (π (i+1))) + f x := X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective hπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, : (g : (Icc 1 (n + 1)) X), (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), f (g (π i))x:X := g (π (n + 1))j:hj':j Icc 1 (n + 1)hj:h j, hj' = xhj1:1 jhj2:j n + 1h': X := fun i if i < j then h (π i) else h (π (i + 1)) i Icc 1 (j - 1), f (h (π i)) + f x + i Icc j n, f (h (π (i + 1))) = i Icc 1 (j - 1), f (h (π i)) + i Icc j n, f (h (π (i + 1))) + f x All goals completed! 🐙 _ = i Icc (1:) (j-1), f (h' i) + i Icc (j:) n, f (h' i) + f x := X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective hπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, : (g : (Icc 1 (n + 1)) X), (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), f (g (π i))x:X := g (π (n + 1))j:hj':j Icc 1 (n + 1)hj:h j, hj' = xhj1:1 jhj2:j n + 1h': X := fun i if i < j then h (π i) else h (π (i + 1)) i Icc 1 (j - 1), f (h (π i)) + i Icc j n, f (h (π (i + 1))) + f x = i Icc 1 (j - 1), f (h' i) + i Icc j n, f (h' i) + f x X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective hπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, : (g : (Icc 1 (n + 1)) X), (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), f (g (π i))x:X := g (π (n + 1))j:hj':j Icc 1 (n + 1)hj:h j, hj' = xhj1:1 jhj2:j n + 1h': X := fun i if i < j then h (π i) else h (π (i + 1)) i Icc 1 (j - 1), f (h (π i)) = i Icc 1 (j - 1), f (h' i)X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective hπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, : (g : (Icc 1 (n + 1)) X), (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), f (g (π i))x:X := g (π (n + 1))j:hj':j Icc 1 (n + 1)hj:h j, hj' = xhj1:1 jhj2:j n + 1h': X := fun i if i < j then h (π i) else h (π (i + 1)) i Icc j n, f (h (π (i + 1))) = i Icc j n, f (h' i) all_goals X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective hπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, : (g : (Icc 1 (n + 1)) X), (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), f (g (π i))x:X := g (π (n + 1))j:hj':j Icc 1 (n + 1)hj:h j, hj' = xhj1:1 jhj2:j n + 1h': X := fun i if i < j then h (π i) else h (π (i + 1)) x Icc j n, f (h (π (x + 1))) = f (h' x); intro i X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective hπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, : (g : (Icc 1 (n + 1)) X), (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), f (g (π i))x:X := g (π (n + 1))j:hj':j Icc 1 (n + 1)hj:h j, hj' = xhj1:1 jhj2:j n + 1h': X := fun i if i < j then h (π i) else h (π (i + 1))i:hi:i Icc j nf (h (π (i + 1))) = f (h' i); X':Type u_1f:X' n:X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, x:X := g (π (n + 1))j:hj':j Icc 1 (n + 1)hj:h j, hj' = xhj1:1 jhj2:j n + 1h': X := fun i if i < j then h (π i) else h (π (i + 1))i:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Multiset.map g (Icc 1 n).val.attach = X.val.attach Multiset.map h (Icc 1 n).val.attach = X.val.attach (∑ x Icc 1 n, if h : 1 x x n then f (g x, ) else 0) = x Icc 1 n, if h_1 : 1 x x n then f (h x, ) else 0hg:Multiset.map g (Icc 1 (n + 1)).val.attach = X.val.attachhh:Multiset.map h (Icc 1 (n + 1)).val.attach = X.val.attach: (g : (Icc 1 (n + 1)) X), (∑ x Icc 1 (n + 1), if h : 1 x x n + 1 then f (g x, ) else 0) = i Icc 1 (n + 1), f (g (π i))hi:j i i nf (h (π (i + 1))) = f (if i < j then h (π i) else h (π (i + 1))) X':Type u_1f:X' n:X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, x:X := g (π (n + 1))j:hj':j Icc 1 (n + 1)hj:h j, hj' = xhj1:1 jhj2:j n + 1h': X := fun i if i < j then h (π i) else h (π (i + 1))i:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Multiset.map g (Icc 1 n).val.attach = X.val.attach Multiset.map h (Icc 1 n).val.attach = X.val.attach (∑ x Icc 1 n, if h : 1 x x n then f (g x, ) else 0) = x Icc 1 n, if h_1 : 1 x x n then f (h x, ) else 0hg:Multiset.map g (Icc 1 (n + 1)).val.attach = X.val.attachhh:Multiset.map h (Icc 1 (n + 1)).val.attach = X.val.attach: (g : (Icc 1 (n + 1)) X), (∑ x Icc 1 (n + 1), if h : 1 x x n + 1 then f (g x, ) else 0) = i Icc 1 (n + 1), f (g (π i))hi:1 i i < jf (h (π i)) = f (if i < j then h (π i) else h (π (i + 1))) All goals completed! 🐙 All goals completed! 🐙 _ = _ := X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective hπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, : (g : (Icc 1 (n + 1)) X), (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), f (g (π i))x:X := g (π (n + 1))j:hj':j Icc 1 (n + 1)hj:h j, hj' = xhj1:1 jhj2:j n + 1h': X := fun i if i < j then h (π i) else h (π (i + 1)) i Icc 1 (j - 1), f (h' i) + i Icc j n, f (h' i) + f x = i Icc 1 n, f (h' i) + f x X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective hπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, : (g : (Icc 1 (n + 1)) X), (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), f (g (π i))x:X := g (π (n + 1))j:hj':j Icc 1 (n + 1)hj:h j, hj' = xhj1:1 jhj2:j n + 1h': X := fun i if i < j then h (π i) else h (π (i + 1)) i Icc 1 (j - 1), f (h' i) + i Icc j n, f (h' i) = i Icc 1 n, f (h' i); X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective hπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, : (g : (Icc 1 (n + 1)) X), (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), f (g (π i))x:X := g (π (n + 1))j:hj':j Icc 1 (n + 1)hj:h j, hj' = xhj1:1 jhj2:j n + 1h': X := fun i if i < j then h (π i) else h (π (i + 1))j = j - 1 + 1X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective hπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, : (g : (Icc 1 (n + 1)) X), (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), f (g (π i))x:X := g (π (n + 1))j:hj':j Icc 1 (n + 1)hj:h j, hj' = xhj1:1 jhj2:j n + 1h': X := fun i if i < j then h (π i) else h (π (i + 1))1 j - 1 + 1X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective hπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, : (g : (Icc 1 (n + 1)) X), (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), f (g (π i))x:X := g (π (n + 1))j:hj':j Icc 1 (n + 1)hj:h j, hj' = xhj1:1 jhj2:j n + 1h': X := fun i if i < j then h (π i) else h (π (i + 1))j - 1 n X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective hπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, : (g : (Icc 1 (n + 1)) X), (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), f (g (π i))x:X := g (π (n + 1))j:hj':j Icc 1 (n + 1)hj:h j, hj' = xhj1:1 jhj2:j n + 1h': X := fun i if i < j then h (π i) else h (π (i + 1))j = j - 1 + 1X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective hπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, : (g : (Icc 1 (n + 1)) X), (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), f (g (π i))x:X := g (π (n + 1))j:hj':j Icc 1 (n + 1)hj:h j, hj' = xhj1:1 jhj2:j n + 1h': X := fun i if i < j then h (π i) else h (π (i + 1))1 j - 1 + 1X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective hπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, : (g : (Icc 1 (n + 1)) X), (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), f (g (π i))x:X := g (π (n + 1))j:hj':j Icc 1 (n + 1)hj:h j, hj' = xhj1:1 jhj2:j n + 1h': X := fun i if i < j then h (π i) else h (π (i + 1))j - 1 n All goals completed! 🐙 X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective hπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, : (g : (Icc 1 (n + 1)) X), (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), f (g (π i))x:X := g (π (n + 1))j:hj':j Icc 1 (n + 1)hj:h j, hj' = xhj1:1 jhj2:j n + 1h': X := fun i if i < j then h (π i) else h (π (i + 1))this: i Icc 1 (n + 1), f (h (π i)) = i Icc 1 n, f (h' i) + f x i Icc 1 n, f (g (π i)) + f x = i Icc 1 n, f (h' i) + f x X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective hπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, : (g : (Icc 1 (n + 1)) X), (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), f (g (π i))x:X := g (π (n + 1))j:hj':j Icc 1 (n + 1)hj:h j, hj' = xhj1:1 jhj2:j n + 1h': X := fun i if i < j then h (π i) else h (π (i + 1))this: i Icc 1 (n + 1), f (h (π i)) = i Icc 1 n, f (h' i) + f x i Icc 1 n, f (g (π i)) = i Icc 1 n, f (h' i) have g_ne_x {i:} (hi : i Icc (1:) n) : g (π i) x := n:X':Type u_1X:Finset X'hcard:#X = nf:X' g:(Icc 1 n) Xh:(Icc 1 n) Xhg:Function.Bijective ghh:Function.Bijective h(∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0 X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective hπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, : (g : (Icc 1 (n + 1)) X), (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), f (g (π i))x:X := g (π (n + 1))j:hj':j Icc 1 (n + 1)hj:h j, hj' = xhj1:1 jhj2:j n + 1h': X := fun i if i < j then h (π i) else h (π (i + 1))this: i Icc 1 (n + 1), f (h (π i)) = i Icc 1 n, f (h' i) + f xi:hi:1 i i ng (π i) x X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective hπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, : (g : (Icc 1 (n + 1)) X), (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), f (g (π i))x:X := g (π (n + 1))j:hj':j Icc 1 (n + 1)hj:h j, hj' = xhj1:1 jhj2:j n + 1h': X := fun i if i < j then h (π i) else h (π (i + 1))this: i Icc 1 (n + 1), f (h (π i)) = i Icc 1 n, f (h' i) + f xi:hi:1 i i n¬i = n + 1 All goals completed! 🐙 have h'_ne_x {i:} (hi : i Icc (1:) n) : h' i x := n:X':Type u_1X:Finset X'hcard:#X = nf:X' g:(Icc 1 n) Xh:(Icc 1 n) Xhg:Function.Bijective ghh:Function.Bijective h(∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0 X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective hπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, : (g : (Icc 1 (n + 1)) X), (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), f (g (π i))x:X := g (π (n + 1))j:hj':j Icc 1 (n + 1)hj:h j, hj' = xhj1:1 jhj2:j n + 1h': X := fun i if i < j then h (π i) else h (π (i + 1))this: i Icc 1 (n + 1), f (h (π i)) = i Icc 1 n, f (h' i) + f xg_ne_x: {i : }, i Icc 1 n g (π i) xi:hi:1 i i nh' i x have hi' : 0 i := n:X':Type u_1X:Finset X'hcard:#X = nf:X' g:(Icc 1 n) Xh:(Icc 1 n) Xhg:Function.Bijective ghh:Function.Bijective h(∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0 All goals completed! 🐙 have hi'' : i n+1 := n:X':Type u_1X:Finset X'hcard:#X = nf:X' g:(Icc 1 n) Xh:(Icc 1 n) Xhg:Function.Bijective ghh:Function.Bijective h(∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0 All goals completed! 🐙 X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective hπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, : (g : (Icc 1 (n + 1)) X), (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), f (g (π i))x:X := g (π (n + 1))j:hj':j Icc 1 (n + 1)hj:h j, hj' = xhj1:1 jhj2:j n + 1h': X := fun i if i < j then h (π i) else h (π (i + 1))this: i Icc 1 (n + 1), f (h (π i)) = i Icc 1 n, f (h' i) + f xg_ne_x: {i : }, i Icc 1 n g (π i) xi:hi:1 i i nhi':0 ihi'':i n + 1hlt:i < jh' i xX':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective hπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, : (g : (Icc 1 (n + 1)) X), (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), f (g (π i))x:X := g (π (n + 1))j:hj':j Icc 1 (n + 1)hj:h j, hj' = xhj1:1 jhj2:j n + 1h': X := fun i if i < j then h (π i) else h (π (i + 1))this: i Icc 1 (n + 1), f (h (π i)) = i Icc 1 n, f (h' i) + f xg_ne_x: {i : }, i Icc 1 n g (π i) xi:hi:1 i i nhi':0 ihi'':i n + 1hlt:¬i < jh' i x X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective hπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, : (g : (Icc 1 (n + 1)) X), (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), f (g (π i))x:X := g (π (n + 1))j:hj':j Icc 1 (n + 1)hj:h j, hj' = xhj1:1 jhj2:j n + 1h': X := fun i if i < j then h (π i) else h (π (i + 1))this: i Icc 1 (n + 1), f (h (π i)) = i Icc 1 n, f (h' i) + f xg_ne_x: {i : }, i Icc 1 n g (π i) xi:hi:1 i i nhi':0 ihi'':i n + 1hlt:i < jh' i xX':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective hπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, : (g : (Icc 1 (n + 1)) X), (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), f (g (π i))x:X := g (π (n + 1))j:hj':j Icc 1 (n + 1)hj:h j, hj' = xhj1:1 jhj2:j n + 1h': X := fun i if i < j then h (π i) else h (π (i + 1))this: i Icc 1 (n + 1), f (h (π i)) = i Icc 1 n, f (h' i) + f xg_ne_x: {i : }, i Icc 1 n g (π i) xi:hi:1 i i nhi':0 ihi'':i n + 1hlt:¬i < jh' i x X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective hπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, : (g : (Icc 1 (n + 1)) X), (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), f (g (π i))x:X := g (π (n + 1))j:hj':j Icc 1 (n + 1)hj:h j, hj' = xhj1:1 jhj2:j n + 1h': X := fun i if i < j then h (π i) else h (π (i + 1))this: i Icc 1 (n + 1), f (h (π i)) = i Icc 1 n, f (h' i) + f xg_ne_x: {i : }, i Icc 1 n g (π i) xi:hi:1 i i nhi':0 ihi'':i n + 1hlt:¬i < jheq:h' i = xFalse all_goals X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective hπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, : (g : (Icc 1 (n + 1)) X), (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), f (g (π i))x:X := g (π (n + 1))j:hj':j Icc 1 (n + 1)hj:h j, hj' = xhj1:1 jhj2:j n + 1h': X := fun i if i < j then h (π i) else h (π (i + 1))this: i Icc 1 (n + 1), f (h (π i)) = i Icc 1 n, f (h' i) + f xg_ne_x: {i : }, i Icc 1 n g (π i) xi:hi:1 i i nhi':0 ihi'':i n + 1hlt:¬i < jheq:i + 1 = jFalse X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective hπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, : (g : (Icc 1 (n + 1)) X), (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), f (g (π i))x:X := g (π (n + 1))j:hj':j Icc 1 (n + 1)hj:h j, hj' = xhj1:1 jhj2:j n + 1h': X := fun i if i < j then h (π i) else h (π (i + 1))this: i Icc 1 (n + 1), f (h (π i)) = i Icc 1 n, f (h' i) + f xg_ne_x: {i : }, i Icc 1 n g (π i) xi:hi:1 i i nhi':0 ihi'':i n + 1hlt:i < jheq:i = jFalse All goals completed! 🐙 X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective hπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, : (g : (Icc 1 (n + 1)) X), (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), f (g (π i))x:X := g (π (n + 1))j:hj':j Icc 1 (n + 1)hj:h j, hj' = xhj1:1 jhj2:j n + 1h': X := fun i if i < j then h (π i) else h (π (i + 1))this: i Icc 1 (n + 1), f (h (π i)) = i Icc 1 n, f (h' i) + f xg_ne_x: {i : }, i Icc 1 n g (π i) xi:hi:1 i i nhi':0 ihi'':i n + 1heq:i + 1 = jhlt:Truei < j; All goals completed! 🐙 set gtil : Icc (1:) n X.erase x := fun i (g (π i)).val, X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective hπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, : (g : (Icc 1 (n + 1)) X), (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), f (g (π i))x:X := g (π (n + 1))j:hj':j Icc 1 (n + 1)hj:h j, hj' = xhj1:1 jhj2:j n + 1h': X := fun i if i < j then h (π i) else h (π (i + 1))this: i Icc 1 (n + 1), f (h (π i)) = i Icc 1 n, f (h' i) + f xg_ne_x: {i : }, i Icc 1 n g (π i) xh'_ne_x: {i : }, i Icc 1 n h' i xi:(Icc 1 n)(g (π i)) X.erase x All goals completed! 🐙 set htil : Icc (1:) n X.erase x := fun i (h' i).val, X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective hπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, : (g : (Icc 1 (n + 1)) X), (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), f (g (π i))x:X := g (π (n + 1))j:hj':j Icc 1 (n + 1)hj:h j, hj' = xhj1:1 jhj2:j n + 1h': X := fun i if i < j then h (π i) else h (π (i + 1))this: i Icc 1 (n + 1), f (h (π i)) = i Icc 1 n, f (h' i) + f xg_ne_x: {i : }, i Icc 1 n g (π i) xh'_ne_x: {i : }, i Icc 1 n h' i xgtil:(Icc 1 n) (X.erase x) := fun i (g (π i)), i:(Icc 1 n)(h' i) X.erase x All goals completed! 🐙 X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective hπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, : (g : (Icc 1 (n + 1)) X), (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), f (g (π i))x:X := g (π (n + 1))j:hj':j Icc 1 (n + 1)hj:h j, hj' = xhj1:1 jhj2:j n + 1h': X := fun i if i < j then h (π i) else h (π (i + 1))this: i Icc 1 (n + 1), f (h (π i)) = i Icc 1 n, f (h' i) + f xg_ne_x: {i : }, i Icc 1 n g (π i) xh'_ne_x: {i : }, i Icc 1 n h' i xgtil:(Icc 1 n) (X.erase x) := fun i (g (π i)), htil:(Icc 1 n) (X.erase x) := fun i (h' i), ftil:(X.erase x) := fun y f y i Icc 1 n, f (g (π i)) = i Icc 1 n, f (h' i) have why : Function.Bijective gtil := n:X':Type u_1X:Finset X'hcard:#X = nf:X' g:(Icc 1 n) Xh:(Icc 1 n) Xhg:Function.Bijective ghh:Function.Bijective h(∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0 All goals completed! 🐙 have why2 : Function.Bijective htil := n:X':Type u_1X:Finset X'hcard:#X = nf:X' g:(Icc 1 n) Xh:(Icc 1 n) Xhg:Function.Bijective ghh:Function.Bijective h(∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0 All goals completed! 🐙 calc _ = i Icc (1:) n, if hi: i Icc (1:) n then ftil (gtil i, hi ) else 0 := X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective hπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, : (g : (Icc 1 (n + 1)) X), (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), f (g (π i))x:X := g (π (n + 1))j:hj':j Icc 1 (n + 1)hj:h j, hj' = xhj1:1 jhj2:j n + 1h': X := fun i if i < j then h (π i) else h (π (i + 1))this: i Icc 1 (n + 1), f (h (π i)) = i Icc 1 n, f (h' i) + f xg_ne_x: {i : }, i Icc 1 n g (π i) xh'_ne_x: {i : }, i Icc 1 n h' i xgtil:(Icc 1 n) (X.erase x) := fun i (g (π i)), htil:(Icc 1 n) (X.erase x) := fun i (h' i), ftil:(X.erase x) := fun y f ywhy:Function.Bijective gtilwhy2:Function.Bijective htil i Icc 1 n, f (g (π i)) = i Icc 1 n, if hi : i Icc 1 n then ftil (gtil i, hi) else 0 X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective hπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, : (g : (Icc 1 (n + 1)) X), (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), f (g (π i))x:X := g (π (n + 1))j:hj':j Icc 1 (n + 1)hj:h j, hj' = xhj1:1 jhj2:j n + 1h': X := fun i if i < j then h (π i) else h (π (i + 1))this: i Icc 1 (n + 1), f (h (π i)) = i Icc 1 n, f (h' i) + f xg_ne_x: {i : }, i Icc 1 n g (π i) xh'_ne_x: {i : }, i Icc 1 n h' i xgtil:(Icc 1 n) (X.erase x) := fun i (g (π i)), htil:(Icc 1 n) (X.erase x) := fun i (h' i), ftil:(X.erase x) := fun y f ywhy:Function.Bijective gtilwhy2:Function.Bijective htil x Icc 1 n, f (g (π x)) = if hi : x Icc 1 n then ftil (gtil x, hi) else 0; All goals completed! 🐙 _ = i Icc (1:) n, if hi: i Icc (1:) n then ftil (htil i, hi ) else 0 := X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective hπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, : (g : (Icc 1 (n + 1)) X), (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), f (g (π i))x:X := g (π (n + 1))j:hj':j Icc 1 (n + 1)hj:h j, hj' = xhj1:1 jhj2:j n + 1h': X := fun i if i < j then h (π i) else h (π (i + 1))this: i Icc 1 (n + 1), f (h (π i)) = i Icc 1 n, f (h' i) + f xg_ne_x: {i : }, i Icc 1 n g (π i) xh'_ne_x: {i : }, i Icc 1 n h' i xgtil:(Icc 1 n) (X.erase x) := fun i (g (π i)), htil:(Icc 1 n) (X.erase x) := fun i (h' i), ftil:(X.erase x) := fun y f ywhy:Function.Bijective gtilwhy2:Function.Bijective htil(∑ i Icc 1 n, if hi : i Icc 1 n then ftil (gtil i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then ftil (htil i, hi) else 0 X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective hπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, : (g : (Icc 1 (n + 1)) X), (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), f (g (π i))x:X := g (π (n + 1))j:hj':j Icc 1 (n + 1)hj:h j, hj' = xhj1:1 jhj2:j n + 1h': X := fun i if i < j then h (π i) else h (π (i + 1))this: i Icc 1 (n + 1), f (h (π i)) = i Icc 1 n, f (h' i) + f xg_ne_x: {i : }, i Icc 1 n g (π i) xh'_ne_x: {i : }, i Icc 1 n h' i xgtil:(Icc 1 n) (X.erase x) := fun i (g (π i)), htil:(Icc 1 n) (X.erase x) := fun i (h' i), ftil:(X.erase x) := fun y f ywhy:Function.Bijective gtilwhy2:Function.Bijective htil#(X.erase x) = n X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective hπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, : (g : (Icc 1 (n + 1)) X), (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), f (g (π i))x:X := g (π (n + 1))j:hj':j Icc 1 (n + 1)hj:h j, hj' = xhj1:1 jhj2:j n + 1h': X := fun i if i < j then h (π i) else h (π (i + 1))this: i Icc 1 (n + 1), f (h (π i)) = i Icc 1 n, f (h' i) + f xg_ne_x: {i : }, i Icc 1 n g (π i) xh'_ne_x: {i : }, i Icc 1 n h' i xgtil:(Icc 1 n) (X.erase x) := fun i (g (π i)), htil:(Icc 1 n) (X.erase x) := fun i (h' i), ftil:(X.erase x) := fun y f ywhy:Function.Bijective gtilwhy2:Function.Bijective htiln + 1 - 1 = nX':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective hπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, : (g : (Icc 1 (n + 1)) X), (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), f (g (π i))x:X := g (π (n + 1))j:hj':j Icc 1 (n + 1)hj:h j, hj' = xhj1:1 jhj2:j n + 1h': X := fun i if i < j then h (π i) else h (π (i + 1))this: i Icc 1 (n + 1), f (h (π i)) = i Icc 1 n, f (h' i) + f xg_ne_x: {i : }, i Icc 1 n g (π i) xh'_ne_x: {i : }, i Icc 1 n h' i xgtil:(Icc 1 n) (X.erase x) := fun i (g (π i)), htil:(Icc 1 n) (X.erase x) := fun i (h' i), ftil:(X.erase x) := fun y f ywhy:Function.Bijective gtilwhy2:Function.Bijective htilx X X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective hπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, : (g : (Icc 1 (n + 1)) X), (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), f (g (π i))x:X := g (π (n + 1))j:hj':j Icc 1 (n + 1)hj:h j, hj' = xhj1:1 jhj2:j n + 1h': X := fun i if i < j then h (π i) else h (π (i + 1))this: i Icc 1 (n + 1), f (h (π i)) = i Icc 1 n, f (h' i) + f xg_ne_x: {i : }, i Icc 1 n g (π i) xh'_ne_x: {i : }, i Icc 1 n h' i xgtil:(Icc 1 n) (X.erase x) := fun i (g (π i)), htil:(Icc 1 n) (X.erase x) := fun i (h' i), ftil:(X.erase x) := fun y f ywhy:Function.Bijective gtilwhy2:Function.Bijective htiln + 1 - 1 = nX':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective hπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, : (g : (Icc 1 (n + 1)) X), (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), f (g (π i))x:X := g (π (n + 1))j:hj':j Icc 1 (n + 1)hj:h j, hj' = xhj1:1 jhj2:j n + 1h': X := fun i if i < j then h (π i) else h (π (i + 1))this: i Icc 1 (n + 1), f (h (π i)) = i Icc 1 n, f (h' i) + f xg_ne_x: {i : }, i Icc 1 n g (π i) xh'_ne_x: {i : }, i Icc 1 n h' i xgtil:(Icc 1 n) (X.erase x) := fun i (g (π i)), htil:(Icc 1 n) (X.erase x) := fun i (h' i), ftil:(X.erase x) := fun y f ywhy:Function.Bijective gtilwhy2:Function.Bijective htilx X All goals completed! 🐙 _ = _ := X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective hπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, : (g : (Icc 1 (n + 1)) X), (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), f (g (π i))x:X := g (π (n + 1))j:hj':j Icc 1 (n + 1)hj:h j, hj' = xhj1:1 jhj2:j n + 1h': X := fun i if i < j then h (π i) else h (π (i + 1))this: i Icc 1 (n + 1), f (h (π i)) = i Icc 1 n, f (h' i) + f xg_ne_x: {i : }, i Icc 1 n g (π i) xh'_ne_x: {i : }, i Icc 1 n h' i xgtil:(Icc 1 n) (X.erase x) := fun i (g (π i)), htil:(Icc 1 n) (X.erase x) := fun i (h' i), ftil:(X.erase x) := fun y f ywhy:Function.Bijective gtilwhy2:Function.Bijective htil(∑ i Icc 1 n, if hi : i Icc 1 n then ftil (htil i, hi) else 0) = i Icc 1 n, f (h' i) X':Type u_1f:X' n:hn: (X : Finset X'), #X = n (g h : (Icc 1 n) X), Function.Bijective g Function.Bijective h (∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i Icc 1 n, if hi : i Icc 1 n then f (h i, hi) else 0X:Finset X'hX:#X = n + 1g:(Icc 1 (n + 1)) Xh:(Icc 1 (n + 1)) Xhg:Function.Bijective ghh:Function.Bijective hπ: (Icc 1 (n + 1)) := fun i if hi : i Icc 1 (n + 1) then i, hi else 1, : (g : (Icc 1 (n + 1)) X), (∑ i Icc 1 (n + 1), if hi : i Icc 1 (n + 1) then f (g i, hi) else 0) = i Icc 1 (n + 1), f (g (π i))x:X := g (π (n + 1))j:hj':j Icc 1 (n + 1)hj:h j, hj' = xhj1:1 jhj2:j n + 1h': X := fun i if i < j then h (π i) else h (π (i + 1))this: i Icc 1 (n + 1), f (h (π i)) = i Icc 1 n, f (h' i) + f xg_ne_x: {i : }, i Icc 1 n g (π i) xh'_ne_x: {i : }, i Icc 1 n h' i xgtil:(Icc 1 n) (X.erase x) := fun i (g (π i)), htil:(Icc 1 n) (X.erase x) := fun i (h' i), ftil:(X.erase x) := fun y f ywhy:Function.Bijective gtilwhy2:Function.Bijective htil x Icc 1 n, (if hi : x Icc 1 n then ftil (htil x, hi) else 0) = f (h' x); All goals completed! 🐙

This fact ensures that Definition 7.1.6 would be well-defined even if we did not appeal to the existing Finset.­sum method.

theorem exist_bijection {n:} {Y:Type*} (X: Finset Y) (hcard: X.card = n) : g: Icc (1:) n X, Function.Bijective g := n:Y:Type u_1X:Finset Yhcard:#X = n g, Function.Bijective g have := Finset.equivOfCardEq (show (Icc (1:) n).card = X.card n:Y:Type u_1X:Finset Yhcard:#X = n g, Function.Bijective g All goals completed! 🐙) All goals completed! 🐙

Definition 7.1.6

theorem finite_series_eq {n:} {Y:Type*} (X: Finset Y) (f: Y ) (g: Icc (1:) n X) (hg: Function.Bijective g) : i X, f i = i Icc (1:) n, (if hi:i Icc (1:) n then f (g i, hi ) else 0) := n:Y:Type u_1X:Finset Yf:Y g:(Icc 1 n) Xhg:Function.Bijective g i X, f i = i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0 n:Y:Type u_1X:Finset Yf:Y g:(Icc 1 n) Xhg:Function.Bijective g(∑ i Icc 1 n, if hi : i Icc 1 n then f (g i, hi) else 0) = i X, f i n:Y:Type u_1X:Finset Yf:Y g:(Icc 1 n) Xhg:Function.Bijective g (a : ) (ha : a Icc 1 n), (fun i hi (g i, hi)) a ha Xn:Y:Type u_1X:Finset Yf:Y g:(Icc 1 n) Xhg:Function.Bijective g (a₁ : ) (ha₁ : a₁ Icc 1 n) (a₂ : ) (ha₂ : a₂ Icc 1 n), (fun i hi (g i, hi)) a₁ ha₁ = (fun i hi (g i, hi)) a₂ ha₂ a₁ = a₂n:Y:Type u_1X:Finset Yf:Y g:(Icc 1 n) Xhg:Function.Bijective g b X, a, (ha : a Icc 1 n), (fun i hi (g i, hi)) a ha = bn:Y:Type u_1X:Finset Yf:Y g:(Icc 1 n) Xhg:Function.Bijective g (a : ) (ha : a Icc 1 n), (if hi : a Icc 1 n then f (g a, hi) else 0) = f ((fun i hi (g i, hi)) a ha) n:Y:Type u_1X:Finset Yf:Y g:(Icc 1 n) Xhg:Function.Bijective g (a : ) (ha : a Icc 1 n), (fun i hi (g i, hi)) a ha X All goals completed! 🐙 n:Y:Type u_1X:Finset Yf:Y g:(Icc 1 n) Xhg:Function.Bijective g (a₁ : ) (ha₁ : a₁ Icc 1 n) (a₂ : ) (ha₂ : a₂ Icc 1 n), (fun i hi (g i, hi)) a₁ ha₁ = (fun i hi (g i, hi)) a₂ ha₂ a₁ = a₂ intro _ n:Y:Type u_1X:Finset Yf:Y g:(Icc 1 n) Xhg:Function.Bijective ga₁✝:ha₁✝:a₁✝ Icc 1 n (a₂ : ) (ha₂ : a₂ Icc 1 n), (fun i hi (g i, hi)) a₁✝ ha₁✝ = (fun i hi (g i, hi)) a₂ ha₂ a₁✝ = a₂ n:Y:Type u_1X:Finset Yf:Y g:(Icc 1 n) Xhg:Function.Bijective ga₁✝:ha₁✝:a₁✝ Icc 1 na₂✝: (ha₂ : a₂✝ Icc 1 n), (fun i hi (g i, hi)) a₁✝ ha₁✝ = (fun i hi (g i, hi)) a₂✝ ha₂ a₁✝ = a₂✝ n:Y:Type u_1X:Finset Yf:Y g:(Icc 1 n) Xhg:Function.Bijective ga₁✝:ha₁✝:a₁✝ Icc 1 na₂✝:ha₂✝:a₂✝ Icc 1 n(fun i hi (g i, hi)) a₁✝ ha₁✝ = (fun i hi (g i, hi)) a₂✝ ha₂✝ a₁✝ = a₂✝ n:Y:Type u_1X:Finset Yf:Y g:(Icc 1 n) Xhg:Function.Bijective ga₁✝:ha₁✝:a₁✝ Icc 1 na₂✝:ha₂✝:a₂✝ Icc 1 nh:(fun i hi (g i, hi)) a₁✝ ha₁✝ = (fun i hi (g i, hi)) a₂✝ ha₂✝a₁✝ = a₂✝; All goals completed! 🐙 n:Y:Type u_1X:Finset Yf:Y g:(Icc 1 n) Xhg:Function.Bijective g b X, a, (ha : a Icc 1 n), (fun i hi (g i, hi)) a ha = b intro b n:Y:Type u_1X:Finset Yf:Y g:(Icc 1 n) Xhg:Function.Bijective gb:Yhb:b X a, (ha : a Icc 1 n), (fun i hi (g i, hi)) a ha = b; n:Y:Type u_1X:Finset Yf:Y g:(Icc 1 n) Xhg:Function.Bijective gb:Yhb:b Xthis: a, g a = b, hb a, (ha : a Icc 1 n), (fun i hi (g i, hi)) a ha = b; All goals completed! 🐙 n:Y:Type u_1X:Finset Yf:Y g:(Icc 1 n) Xhg:Function.Bijective ga✝:ha✝:a✝ Icc 1 n(if hi : a✝ Icc 1 n then f (g a✝, hi) else 0) = f ((fun i hi (g i, hi)) a✝ ha✝); All goals completed! 🐙

Proposition 7.1.11(a) / Exercise 7.1.2

theorem declaration uses `sorry`finite_series_of_empty {X':Type*} (f: X' ) : i , f i = 0 := X':Type u_1f:X' i , f i = 0 All goals completed! 🐙

Proposition 7.1.11(b) / Exercise 7.1.2

theorem declaration uses `sorry`finite_series_of_singleton {X':Type*} (f: X' ) (x₀:X') : i {x₀}, f i = f x₀ := X':Type u_1f:X' x₀:X' i {x₀}, f i = f x₀ All goals completed! 🐙

A technical lemma relating a sum over a finset with a sum over a fintype. Combines well with tools such as map_finite_series below.

theorem finite_series_of_fintype {X':Type*} (f: X' ) (X: Finset X') : x X, f x = x:X, f x.val := (sum_coe_sort X f).symm

Proposition 7.1.11(c) / Exercise 7.1.2

theorem declaration uses `sorry`map_finite_series {X:Type*} [Fintype X] [Fintype Y] (f: X ) {g:Y X} (hg: Function.Bijective g) : x, f x = y, f (g y) := Y:Type u_2X:Type u_1inst✝¹:Fintype Xinst✝:Fintype Yf:X g:Y Xhg:Function.Bijective g x, f x = y, f (g y) All goals completed! 🐙

Proposition 7.1.11(e) / Exercise 7.1.2

-- Proposition 7.1.11(d) is `rfl` in our formalism and is therefore omitted. theorem declaration uses `sorry`finite_series_of_disjoint_union {Z:Type*} {X Y: Finset Z} (hdisj: Disjoint X Y) (f: Z ) : z X Y, f z = z X, f z + z Y, f z := Z:Type u_1X:Finset ZY:Finset Zhdisj:Disjoint X Yf:Z z X Y, f z = z X, f z + z Y, f z All goals completed! 🐙

Proposition 7.1.11(f) / Exercise 7.1.2

theorem declaration uses `sorry`finite_series_of_add {X':Type*} (f g: X' ) (X: Finset X') : x X, (f + g) x = x X, f x + x X, g x := X':Type u_1f:X' g:X' X:Finset X' x X, (f + g) x = x X, f x + x X, g x All goals completed! 🐙

Proposition 7.1.11(g) / Exercise 7.1.2

theorem declaration uses `sorry`finite_series_of_const_mul {X':Type*} (f: X' ) (X: Finset X') (c:) : x X, c * f x = c * x X, f x := X':Type u_1f:X' X:Finset X'c: x X, c * f x = c * x X, f x All goals completed! 🐙

Proposition 7.1.11(h) / Exercise 7.1.2

theorem declaration uses `sorry`finite_series_of_le' {X':Type*} (f g: X' ) (X: Finset X') (h: x X, f x g x) : x X, f x x X, g x := X':Type u_1f:X' g:X' X:Finset X'h: x X, f x g x x X, f x x X, g x All goals completed! 🐙

Proposition 7.1.11(i) / Exercise 7.1.2

theorem declaration uses `sorry`abs_finite_series_le' {X':Type*} (f: X' ) (X: Finset X') : | x X, f x| x X, |f x| := X':Type u_1f:X' X:Finset X'| x X, f x| x X, |f x| All goals completed! 🐙

Lemma 7.1.13 -

theorem declaration uses `sorry`finite_series_of_finite_series {XX YY:Type*} (X: Finset XX) (Y: Finset YY) (f: XX × YY ) : x X, y Y, f (x, y) = z X.product Y, f z := XX:Type u_1YY:Type u_2X:Finset XXY:Finset YYf:XX × YY x X, y Y, f (x, y) = z X.product Y, f z XX:Type u_1YY:Type u_2X:Finset XXY:Finset YYf:XX × YY n:h:#X = n x X, y Y, f (x, y) = z X.product Y, f z XX:Type u_1YY:Type u_2Y:Finset YYf:XX × YY n: (X : Finset XX), #X = n x X, y Y, f (x, y) = z X.product Y, f z; XX:Type u_1YY:Type u_2Y:Finset YYf:XX × YY (X : Finset XX), #X = 0 x X, y Y, f (x, y) = z X.product Y, f zXX:Type u_1YY:Type u_2Y:Finset YYf:XX × YY n:hn: (X : Finset XX), #X = n x X, y Y, f (x, y) = z X.product Y, f z (X : Finset XX), #X = n + 1 x X, y Y, f (x, y) = z X.product Y, f z XX:Type u_1YY:Type u_2Y:Finset YYf:XX × YY (X : Finset XX), #X = 0 x X, y Y, f (x, y) = z X.product Y, f z All goals completed! 🐙 intro X XX:Type u_1YY:Type u_2Y:Finset YYf:XX × YY n:hn: (X : Finset XX), #X = n x X, y Y, f (x, y) = z X.product Y, f zX:Finset XXhX:#X = n + 1 x X, y Y, f (x, y) = z X.product Y, f z have hnon : X.Nonempty := XX:Type u_1YY:Type u_2X:Finset XXY:Finset YYf:XX × YY x X, y Y, f (x, y) = z X.product Y, f z All goals completed! 🐙 XX:Type u_1YY:Type u_2Y:Finset YYf:XX × YY n:hn: (X : Finset XX), #X = n x X, y Y, f (x, y) = z X.product Y, f zX:Finset XXhX:#X = n + 1hnon:X.Nonemptyx₀:XXhx₀:x₀ X x X, y Y, f (x, y) = z X.product Y, f z XX:Type u_1YY:Type u_2Y:Finset YYf:XX × YY n:hn: (X : Finset XX), #X = n x X, y Y, f (x, y) = z X.product Y, f zX:Finset XXhX:#X = n + 1hnon:X.Nonemptyx₀:XXhx₀:x₀ XX':Finset XX := X.erase x₀ x X, y Y, f (x, y) = z X.product Y, f z have hcard : X'.card = n := XX:Type u_1YY:Type u_2X:Finset XXY:Finset YYf:XX × YY x X, y Y, f (x, y) = z X.product Y, f z All goals completed! 🐙 have hunion : X = X' {x₀} := XX:Type u_1YY:Type u_2X:Finset XXY:Finset YYf:XX × YY x X, y Y, f (x, y) = z X.product Y, f z XX:Type u_1YY:Type u_2Y:Finset YYf:XX × YY n:hn: (X : Finset XX), #X = n x X, y Y, f (x, y) = z X.product Y, f zX:Finset XXhX:#X = n + 1hnon:X.Nonemptyx₀:XXhx₀:x₀ XX':Finset XX := X.erase x₀hcard:#X' = nx:XXx X x X' {x₀}; XX:Type u_1YY:Type u_2Y:Finset YYf:XX × YY n:hn: (X : Finset XX), #X = n x X, y Y, f (x, y) = z X.product Y, f zX:Finset XXhX:#X = n + 1hnon:X.Nonemptyx₀:XXhx₀:x₀ XX':Finset XX := X.erase x₀hcard:#X' = nx:XXh✝:x = x₀x X x X' {x₀}XX:Type u_1YY:Type u_2Y:Finset YYf:XX × YY n:hn: (X : Finset XX), #X = n x X, y Y, f (x, y) = z X.product Y, f zX:Finset XXhX:#X = n + 1hnon:X.Nonemptyx₀:XXhx₀:x₀ XX':Finset XX := X.erase x₀hcard:#X' = nx:XXh✝:¬x = x₀x X x X' {x₀} XX:Type u_1YY:Type u_2Y:Finset YYf:XX × YY n:hn: (X : Finset XX), #X = n x X, y Y, f (x, y) = z X.product Y, f zX:Finset XXhX:#X = n + 1hnon:X.Nonemptyx₀:XXhx₀:x₀ XX':Finset XX := X.erase x₀hcard:#X' = nx:XXh✝:x = x₀x X x X' {x₀}XX:Type u_1YY:Type u_2Y:Finset YYf:XX × YY n:hn: (X : Finset XX), #X = n x X, y Y, f (x, y) = z X.product Y, f zX:Finset XXhX:#X = n + 1hnon:X.Nonemptyx₀:XXhx₀:x₀ XX':Finset XX := X.erase x₀hcard:#X' = nx:XXh✝:¬x = x₀x X x X' {x₀} All goals completed! 🐙 have hdisj : Disjoint X' {x₀} := XX:Type u_1YY:Type u_2X:Finset XXY:Finset YYf:XX × YY x X, y Y, f (x, y) = z X.product Y, f z All goals completed! 🐙 calc _ = x X', y Y, f (x, y) + x {x₀}, y Y, f (x, y) := XX:Type u_1YY:Type u_2Y:Finset YYf:XX × YY n:hn: (X : Finset XX), #X = n x X, y Y, f (x, y) = z X.product Y, f zX:Finset XXhX:#X = n + 1hnon:X.Nonemptyx₀:XXhx₀:x₀ XX':Finset XX := X.erase x₀hcard:#X' = nhunion:X = X' {x₀}hdisj:Disjoint X' {x₀} x X, y Y, f (x, y) = x X', y Y, f (x, y) + x {x₀}, y Y, f (x, y) All goals completed! 🐙 _ = x X', y Y, f (x, y) + y Y, f (x₀, y) := XX:Type u_1YY:Type u_2Y:Finset YYf:XX × YY n:hn: (X : Finset XX), #X = n x X, y Y, f (x, y) = z X.product Y, f zX:Finset XXhX:#X = n + 1hnon:X.Nonemptyx₀:XXhx₀:x₀ XX':Finset XX := X.erase x₀hcard:#X' = nhunion:X = X' {x₀}hdisj:Disjoint X' {x₀} x X', y Y, f (x, y) + x {x₀}, y Y, f (x, y) = x X', y Y, f (x, y) + y Y, f (x₀, y) All goals completed! 🐙 _ = z X'.product Y, f z + y Y, f (x₀, y) := XX:Type u_1YY:Type u_2Y:Finset YYf:XX × YY n:hn: (X : Finset XX), #X = n x X, y Y, f (x, y) = z X.product Y, f zX:Finset XXhX:#X = n + 1hnon:X.Nonemptyx₀:XXhx₀:x₀ XX':Finset XX := X.erase x₀hcard:#X' = nhunion:X = X' {x₀}hdisj:Disjoint X' {x₀} x X', y Y, f (x, y) + y Y, f (x₀, y) = z X'.product Y, f z + y Y, f (x₀, y) All goals completed! 🐙 _ = z X'.product Y, f z + z .product {x₀} Y, f z := XX:Type u_1YY:Type u_2Y:Finset YYf:XX × YY n:hn: (X : Finset XX), #X = n x X, y Y, f (x, y) = z X.product Y, f zX:Finset XXhX:#X = n + 1hnon:X.Nonemptyx₀:XXhx₀:x₀ XX':Finset XX := X.erase x₀hcard:#X' = nhunion:X = X' {x₀}hdisj:Disjoint X' {x₀} z X'.product Y, f z + y Y, f (x₀, y) = z X'.product Y, f z + z {x₀}.product Y, f z XX:Type u_1YY:Type u_2Y:Finset YYf:XX × YY n:hn: (X : Finset XX), #X = n x X, y Y, f (x, y) = z X.product Y, f zX:Finset XXhX:#X = n + 1hnon:X.Nonemptyx₀:XXhx₀:x₀ XX':Finset XX := X.erase x₀hcard:#X' = nhunion:X = X' {x₀}hdisj:Disjoint X' {x₀} y Y, f (x₀, y) = z {x₀}.product Y, f z XX:Type u_1YY:Type u_2Y:Finset YYf:XX × YY n:hn: (X : Finset XX), #X = n x X, y Y, f (x, y) = z X.product Y, f zX:Finset XXhX:#X = n + 1hnon:X.Nonemptyx₀:XXhx₀:x₀ XX':Finset XX := X.erase x₀hcard:#X' = nhunion:X = X' {x₀}hdisj:Disjoint X' {x₀} x, f (x₀, x) = x, f x set π : Finset.product {x₀} Y Y := fun z z.val.2, XX:Type u_1YY:Type u_2Y:Finset YYf:XX × YY n:hn: (X : Finset XX), #X = n x X, y Y, f (x, y) = z X.product Y, f zX:Finset XXhX:#X = n + 1hnon:X.Nonemptyx₀:XXhx₀:x₀ XX':Finset XX := X.erase x₀hcard:#X' = nhunion:X = X' {x₀}hdisj:Disjoint X' {x₀}z:({x₀}.product Y)(↑z).2 Y XX:Type u_1YY:Type u_2Y:Finset YYf:XX × YY n:hn: (X : Finset XX), #X = n x X, y Y, f (x, y) = z X.product Y, f zX:Finset XXhX:#X = n + 1hnon:X.Nonemptyx₀:XXhx₀:x₀ XX':Finset XX := X.erase x₀hcard:#X' = nhunion:X = X' {x₀}hdisj:Disjoint X' {x₀}z:XX × YYhz:z {x₀}.product Y(↑z, hz).2 Y; XX:Type u_1YY:Type u_2Y:Finset YYf:XX × YY n:hn: (X : Finset XX), #X = n x X, y Y, f (x, y) = z X.product Y, f zX:Finset XXhX:#X = n + 1hnon:X.Nonemptyx₀:XXhx₀:x₀ XX':Finset XX := X.erase x₀hcard:#X' = nhunion:X = X' {x₀}hdisj:Disjoint X' {x₀}z:XX × YYhz: a Y, (x₀, a) = zz.2 Y; All goals completed! 🐙 have : Function.Bijective π := XX:Type u_1YY:Type u_2Y:Finset YYf:XX × YY n:hn: (X : Finset XX), #X = n x X, y Y, f (x, y) = z X.product Y, f zX:Finset XXhX:#X = n + 1hnon:X.Nonemptyx₀:XXhx₀:x₀ XX':Finset XX := X.erase x₀hcard:#X' = nhunion:X = X' {x₀}hdisj:Disjoint X' {x₀} z X'.product Y, f z + y Y, f (x₀, y) = z X'.product Y, f z + z {x₀}.product Y, f z XX:Type u_1YY:Type u_2Y:Finset YYf:XX × YY n:hn: (X : Finset XX), #X = n x X, y Y, f (x, y) = z X.product Y, f zX:Finset XXhX:#X = n + 1hnon:X.Nonemptyx₀:XXhx₀:x₀ XX':Finset XX := X.erase x₀hcard:#X' = nhunion:X = X' {x₀}hdisj:Disjoint X' {x₀}π:({x₀}.product Y) Y := fun z (↑z).2, Function.Injective πXX:Type u_1YY:Type u_2Y:Finset YYf:XX × YY n:hn: (X : Finset XX), #X = n x X, y Y, f (x, y) = z X.product Y, f zX:Finset XXhX:#X = n + 1hnon:X.Nonemptyx₀:XXhx₀:x₀ XX':Finset XX := X.erase x₀hcard:#X' = nhunion:X = X' {x₀}hdisj:Disjoint X' {x₀}π:({x₀}.product Y) Y := fun z (↑z).2, Function.Surjective π XX:Type u_1YY:Type u_2Y:Finset YYf:XX × YY n:hn: (X : Finset XX), #X = n x X, y Y, f (x, y) = z X.product Y, f zX:Finset XXhX:#X = n + 1hnon:X.Nonemptyx₀:XXhx₀:x₀ XX':Finset XX := X.erase x₀hcard:#X' = nhunion:X = X' {x₀}hdisj:Disjoint X' {x₀}π:({x₀}.product Y) Y := fun z (↑z).2, Function.Injective π intro x, y , hz XX:Type u_1YY:Type u_2Y:Finset YYf:XX × YY n:hn: (X : Finset XX), #X = n x X, y Y, f (x, y) = z X.product Y, f zX:Finset XXhX:#X = n + 1hnon:X.Nonemptyx₀:XXhx₀:x₀ XX':Finset XX := X.erase x₀hcard:#X' = nhunion:X = X' {x₀}hdisj:Disjoint X' {x₀}π:({x₀}.product Y) Y := fun z (↑z).2, x:XXy:YYhz:(x, y) {x₀}.product Yx':XXy':YYhz':(x', y') {x₀}.product Yπ (x, y), hz = π (x', y'), hz' (x, y), hz = (x', y'), hz' XX:Type u_1YY:Type u_2Y:Finset YYf:XX × YY n:hn: (X : Finset XX), #X = n x X, y Y, f (x, y) = z X.product Y, f zX:Finset XXhX:#X = n + 1hnon:X.Nonemptyx₀:XXhx₀:x₀ XX':Finset XX := X.erase x₀hcard:#X' = nhunion:X = X' {x₀}hdisj:Disjoint X' {x₀}π:({x₀}.product Y) Y := fun z (↑z).2, x:XXy:YYhz:(x, y) {x₀}.product Yx':XXy':YYhz':(x', y') {x₀}.product Yhzz':π (x, y), hz = π (x', y'), hz'(x, y), hz = (x', y'), hz'; XX:Type u_1YY:Type u_2Y:Finset YYf:XX × YY n:hn: (X : Finset XX), #X = n x X, y Y, f (x, y) = z X.product Y, f zX:Finset XXhX:#X = n + 1hnon:X.Nonemptyx₀:XXhx₀:x₀ XX':Finset XX := X.erase x₀hcard:#X' = nhunion:X = X' {x₀}hdisj:Disjoint X' {x₀}π:({x₀}.product Y) Y := fun z (↑z).2, x:XXy:YYx':XXy':YYhz:y Y x₀ = xhz':y' Y x₀ = x'hzz':y = y'x = x' y = y'; All goals completed! 🐙 XX:Type u_1YY:Type u_2Y:Finset YYf:XX × YY n:hn: (X : Finset XX), #X = n x X, y Y, f (x, y) = z X.product Y, f zX:Finset XXhX:#X = n + 1hnon:X.Nonemptyx₀:XXhx₀:x₀ XX':Finset XX := X.erase x₀hcard:#X' = nhunion:X = X' {x₀}hdisj:Disjoint X' {x₀}π:({x₀}.product Y) Y := fun z (↑z).2, y:YYhy:y Y a, π a = y, hy; use (x₀, y), XX:Type u_1YY:Type u_2Y:Finset YYf:XX × YY n:hn: (X : Finset XX), #X = n x X, y Y, f (x, y) = z X.product Y, f zX:Finset XXhX:#X = n + 1hnon:X.Nonemptyx₀:XXhx₀:x₀ XX':Finset XX := X.erase x₀hcard:#X' = nhunion:X = X' {x₀}hdisj:Disjoint X' {x₀}π:({x₀}.product Y) Y := fun z (↑z).2, y:YYhy:y Y(x₀, y) {x₀}.product Y All goals completed! 🐙 XX:Type u_1YY:Type u_2Y:Finset YYf:XX × YY n:hn: (X : Finset XX), #X = n x X, y Y, f (x, y) = z X.product Y, f zX:Finset XXhX:#X = n + 1hnon:X.Nonemptyx₀:XXhx₀:x₀ XX':Finset XX := X.erase x₀hcard:#X' = nhunion:X = X' {x₀}hdisj:Disjoint X' {x₀}π:({x₀}.product Y) Y := fun z (↑z).2, :Function.Bijective πz:({x₀}.product Y)a✝:z univz.1.1 = x₀ XX:Type u_1YY:Type u_2Y:Finset YYf:XX × YY n:hn: (X : Finset XX), #X = n x X, y Y, f (x, y) = z X.product Y, f zX:Finset XXhX:#X = n + 1hnon:X.Nonemptyx₀:XXhx₀:x₀ XX':Finset XX := X.erase x₀hcard:#X' = nhunion:X = X' {x₀}hdisj:Disjoint X' {x₀}π:({x₀}.product Y) Y := fun z (↑z).2, :Function.Bijective πx:XXy:YYhz:(x, y) {x₀}.product Ya✝:(x, y), hz univ(x, y), hz.1.1 = x₀ XX:Type u_1YY:Type u_2Y:Finset YYf:XX × YY n:hn: (X : Finset XX), #X = n x X, y Y, f (x, y) = z X.product Y, f zX:Finset XXhX:#X = n + 1hnon:X.Nonemptyx₀:XXhx₀:x₀ XX':Finset XX := X.erase x₀hcard:#X' = nhunion:X = X' {x₀}hdisj:Disjoint X' {x₀}π:({x₀}.product Y) Y := fun z (↑z).2, :Function.Bijective πx:XXy:YYhz✝:(x, y) {x₀}.product Ya✝:(x, y), hz univhz:y Y x₀ = xx = x₀; All goals completed! 🐙 _ = _ := XX:Type u_1YY:Type u_2Y:Finset YYf:XX × YY n:hn: (X : Finset XX), #X = n x X, y Y, f (x, y) = z X.product Y, f zX:Finset XXhX:#X = n + 1hnon:X.Nonemptyx₀:XXhx₀:x₀ XX':Finset XX := X.erase x₀hcard:#X' = nhunion:X = X' {x₀}hdisj:Disjoint X' {x₀} z X'.product Y, f z + z {x₀}.product Y, f z = z X.product Y, f z XX:Type u_1YY:Type u_2Y:Finset YYf:XX × YY n:hn: (X : Finset XX), #X = n x X, y Y, f (x, y) = z X.product Y, f zX:Finset XXhX:#X = n + 1hnon:X.Nonemptyx₀:XXhx₀:x₀ XX':Finset XX := X.erase x₀hcard:#X' = nhunion:X = X' {x₀}hdisj:Disjoint X' {x₀} z X.product Y, f z = z X'.product Y, f z + z {x₀}.product Y, f z; XX:Type u_1YY:Type u_2Y:Finset YYf:XX × YY n:hn: (X : Finset XX), #X = n x X, y Y, f (x, y) = z X.product Y, f zX:Finset XXhX:#X = n + 1hnon:X.Nonemptyx₀:XXhx₀:x₀ XX':Finset XX := X.erase x₀hcard:#X' = nhunion:X = X' {x₀}hdisj:Disjoint X' {x₀}X.product Y = X'.product Y {x₀}.product YXX:Type u_1YY:Type u_2Y:Finset YYf:XX × YY n:hn: (X : Finset XX), #X = n x X, y Y, f (x, y) = z X.product Y, f zX:Finset XXhX:#X = n + 1hnon:X.Nonemptyx₀:XXhx₀:x₀ XX':Finset XX := X.erase x₀hcard:#X' = nhunion:X = X' {x₀}hdisj:Disjoint X' {x₀}Disjoint (X'.product Y) ({x₀}.product Y) XX:Type u_1YY:Type u_2Y:Finset YYf:XX × YY n:hn: (X : Finset XX), #X = n x X, y Y, f (x, y) = z X.product Y, f zX:Finset XXhX:#X = n + 1hnon:X.Nonemptyx₀:XXhx₀:x₀ XX':Finset XX := X.erase x₀hcard:#X' = nhunion:X = X' {x₀}hdisj:Disjoint X' {x₀}X.product Y = X'.product Y {x₀}.product Y All goals completed! 🐙 All goals completed! 🐙

Corollary 7.1.14 (Fubini's theorem for finite series)

theorem finite_series_refl {XX YY:Type*} (X: Finset XX) (Y: Finset YY) (f: XX × YY ) : z X.product Y, f z = z Y.product X, f (z.2, z.1) := XX:Type u_1YY:Type u_2X:Finset XXY:Finset YYf:XX × YY z X.product Y, f z = z Y.product X, f (z.2, z.1) set h : Y.product X X.product Y := fun z (z.val.2, z.val.1), XX:Type u_1YY:Type u_2X:Finset XXY:Finset YYf:XX × YY z:(Y.product X)((↑z).2, (↑z).1) X.product Y XX:Type u_1YY:Type u_2X:Finset XXY:Finset YYf:XX × YY z:YY × XXhz:z Y.product X((↑z, hz).2, (↑z, hz).1) X.product Y; XX:Type u_1YY:Type u_2X:Finset XXY:Finset YYf:XX × YY z:YY × XXhz:z.1 Y z.2 Xz.2 X z.1 Y; All goals completed! 🐙 have hh : Function.Bijective h := XX:Type u_1YY:Type u_2X:Finset XXY:Finset YYf:XX × YY z X.product Y, f z = z Y.product X, f (z.2, z.1) XX:Type u_1YY:Type u_2X:Finset XXY:Finset YYf:XX × YY h:(Y.product X) (X.product Y) := fun z ((↑z).2, (↑z).1), Function.Injective hXX:Type u_1YY:Type u_2X:Finset XXY:Finset YYf:XX × YY h:(Y.product X) (X.product Y) := fun z ((↑z).2, (↑z).1), Function.Surjective h XX:Type u_1YY:Type u_2X:Finset XXY:Finset YYf:XX × YY h:(Y.product X) (X.product Y) := fun z ((↑z).2, (↑z).1), Function.Injective h intro _, _ , _ XX:Type u_1YY:Type u_2X:Finset XXY:Finset YYf:XX × YY h:(Y.product X) (X.product Y) := fun z ((↑z).2, (↑z).1), fst✝¹:YYsnd✝¹:XXproperty✝¹:(fst✝¹, snd✝¹) Y.product Xfst✝:YYsnd✝:XXproperty✝:(fst✝, snd✝) Y.product Xh (fst✝¹, snd✝¹), property✝¹ = h (fst✝, snd✝), property✝ (fst✝¹, snd✝¹), property✝¹ = (fst✝, snd✝), property✝ XX:Type u_1YY:Type u_2X:Finset XXY:Finset YYf:XX × YY h:(Y.product X) (X.product Y) := fun z ((↑z).2, (↑z).1), fst✝¹:YYsnd✝¹:XXproperty✝¹:(fst✝¹, snd✝¹) Y.product Xfst✝:YYsnd✝:XXproperty✝:(fst✝, snd✝) Y.product Xa✝:h (fst✝¹, snd✝¹), property✝¹ = h (fst✝, snd✝), property✝(fst✝¹, snd✝¹), property✝¹ = (fst✝, snd✝), property✝ All goals completed! 🐙 XX:Type u_1YY:Type u_2X:Finset XXY:Finset YYf:XX × YY h:(Y.product X) (X.product Y) := fun z ((↑z).2, (↑z).1), z:XX × YYhz:z X.product Y a, h a = z, hz; XX:Type u_1YY:Type u_2X:Finset XXY:Finset YYf:XX × YY h:(Y.product X) (X.product Y) := fun z ((↑z).2, (↑z).1), z:XX × YYhz✝:z X.product Yhz:z.1 X z.2 Y a, h a = z, hz use (z.2, z.1), XX:Type u_1YY:Type u_2X:Finset XXY:Finset YYf:XX × YY h:(Y.product X) (X.product Y) := fun z ((↑z).2, (↑z).1), z:XX × YYhz✝:z X.product Yhz:z.1 X z.2 Y(z.2, z.1) Y.product X All goals completed! 🐙 XX:Type u_1YY:Type u_2X:Finset XXY:Finset YYf:XX × YY h:(Y.product X) (X.product Y) := fun z ((↑z).2, (↑z).1), hh:Function.Bijective h x, f x = z Y.product X, f (z.2, z.1) XX:Type u_1YY:Type u_2X:Finset XXY:Finset YYf:XX × YY h:(Y.product X) (X.product Y) := fun z ((↑z).2, (↑z).1), hh:Function.Bijective h x, f x = x, f ((↑x).2, (↑x).1) All goals completed! 🐙
theorem finite_series_comm {XX YY:Type*} (X: Finset XX) (Y: Finset YY) (f: XX × YY ) : x X, y Y, f (x, y) = y Y, x X, f (x, y) := XX:Type u_1YY:Type u_2X:Finset XXY:Finset YYf:XX × YY x X, y Y, f (x, y) = y Y, x X, f (x, y) All goals completed! 🐙-- Exercise 7.1.3 : develop as many analogues as you can of the above theory for finite products -- instead of finite sums. Nat.factorial_zero : Nat.factorial 0 = 1#check Nat.factorial_zeroNat.factorial_succ (n : ) : (n + 1).factorial = (n + 1) * n.factorial#check Nat.factorial_succ
Nat.factorial_succ (n : ) : (n + 1).factorial = (n + 1) * n.factorial

Exercise 7.1.4. Note: there may be some technicalities passing back and forth between natural numbers and integers. Look into the tactics zify, norm_cast, and omega

theorem declaration uses `sorry`binomial_theorem (x y:) (n:) : (x + y)^n = j Icc (0:) n, n.factorial / (j.toNat.factorial * (n-j).toNat.factorial) * x^j * y^(n - j) := x:y:n:(x + y) ^ n = j Icc 0 n, n.factorial / (j.toNat.factorial * (n - j).toNat.factorial) * x ^ j * y ^ (n - j) All goals completed! 🐙

Exercise 7.1.5

theorem declaration uses `sorry`lim_of_finite_series {X:Type*} [Fintype X] (a: X ) (L : X ) (h: x, Filter.atTop.Tendsto (a x) (nhds (L x))) : Filter.atTop.Tendsto (fun n x, a x n) (nhds ( x, L x)) := X:Type u_1inst✝:Fintype Xa:X L:X h: (x : X), Filter.Tendsto (a x) Filter.atTop (nhds (L x))Filter.Tendsto (fun n x, a x n) Filter.atTop (nhds (∑ x, L x)) All goals completed! 🐙

Exercise 7.1.6

theorem declaration uses `sorry`sum_union_disjoint {n : } {S : Type*} [Fintype S] (E : Fin n Finset S) (disj : i j : Fin n, i j Disjoint (E i) (E j)) (cover : s : S, i, s E i) (f : S ) : s, f s = i, s E i, f s := n:S:Type u_1inst✝:Fintype SE:Fin n Finset Sdisj: (i j : Fin n), i j Disjoint (E i) (E j)cover: (s : S), i, s E if:S s, f s = i, s E i, f s All goals completed! 🐙

aᵢ Exercise 7.1.7. Uses Fin m (so aᵢ < m) instead of the book's aᵢ m; the bound is baked into the type, and < replaces to match the 0-indexed shift.

theorem declaration uses `sorry`sum_finite_col_row_counts {n m : } (a : Fin n Fin m) : i, (a i : ) = j : Fin m, {i : Fin n | j < a i}.toFinset.card := n:m:a:Fin n Fin m i, (a i) = j, #{i | j < a i}.toFinset All goals completed! 🐙
end Finset