Theorem: Imo1998P2.A_fibre_over_contestant_card (Compfiles/Imo1998P2.lean)

State before:
C : Type u_1
J : Type u_2
r : C → J → Prop
inst✝¹ : Fintype J
inst✝ : Fintype C
c : C
⊢ (Finset.filter (fun p => JudgePair.Agree r p c ∧ p.Distinct) Finset.univ).card =
    (Finset.filter (fun a => a.contestant = c) (A r)).card
Tactic:
rw [A_fibre_over_contestant r]
State after:
C : Type u_1
J : Type u_2
r : C → J → Prop
inst✝¹ : Fintype J
inst✝ : Fintype C
c : C
⊢ (Finset.image Prod.snd (Finset.filter (fun a => a.contestant = c) (A r))).card =
    (Finset.filter (fun a => a.contestant = c) (A r)).card

State before:
C : Type u_1
J : Type u_2
r : C → J → Prop
inst✝¹ : Fintype J
inst✝ : Fintype C
c : C
⊢ (Finset.image Prod.snd (Finset.filter (fun a => a.contestant = c) (A r))).card =
    (Finset.filter (fun a => a.contestant = c) (A r)).card
Tactic:
apply Finset.card_image_of_injOn
State after:
case H
C : Type u_1
J : Type u_2
r : C → J → Prop
inst✝¹ : Fintype J
inst✝ : Fintype C
c : C
⊢ Set.InjOn Prod.snd ↑(Finset.filter (fun a => a.contestant = c) (A r))

State before:
case H
C : Type u_1
J : Type u_2
r : C → J → Prop
inst✝¹ : Fintype J
inst✝ : Fintype C
c : C
⊢ Set.InjOn Prod.snd ↑(Finset.filter (fun a => a.contestant = c) (A r))
Tactic:
unfold Set.InjOn
State after:
case H
C : Type u_1
J : Type u_2
r : C → J → Prop
inst✝¹ : Fintype J
inst✝ : Fintype C
c : C
⊢ ∀ ⦃x₁ : C × JudgePair J⦄,
    x₁ ∈ ↑(Finset.filter (fun a => a.contestant = c) (A r)) →
      ∀ ⦃x₂ : C × JudgePair J⦄, x₂ ∈ ↑(Finset.filter (fun a => a.contestant = c) (A r)) → x₁.2 = x₂.2 → x₁ = x₂

State before:
case H
C : Type u_1
J : Type u_2
r : C → J → Prop
inst✝¹ : Fintype J
inst✝ : Fintype C
c : C
⊢ ∀ ⦃x₁ : C × JudgePair J⦄,
    x₁ ∈ ↑(Finset.filter (fun a => a.contestant = c) (A r)) →
      ∀ ⦃x₂ : C × JudgePair J⦄, x₂ ∈ ↑(Finset.filter (fun a => a.contestant = c) (A r)) → x₁.2 = x₂.2 → x₁ = x₂
Tactic:
intros
State after:
case H
C : Type u_1
J : Type u_2
r : C → J → Prop
inst✝¹ : Fintype J
inst✝ : Fintype C
c : C
x₁✝ : C × JudgePair J
a✝² : x₁✝ ∈ ↑(Finset.filter (fun a => a.contestant = c) (A r))
x₂✝ : C × JudgePair J
a✝¹ : x₂✝ ∈ ↑(Finset.filter (fun a => a.contestant = c) (A r))
a✝ : x₁✝.2 = x₂✝.2
⊢ x₁✝ = x₂✝

State before:
case H
C : Type u_1
J : Type u_2
r : C → J → Prop
inst✝¹ : Fintype J
inst✝ : Fintype C
c : C
x₁✝ : C × JudgePair J
a✝² : x₁✝ ∈ ↑(Finset.filter (fun a => a.contestant = c) (A r))
x₂✝ : C × JudgePair J
a✝¹ : x₂✝ ∈ ↑(Finset.filter (fun a => a.contestant = c) (A r))
a✝ : x₁✝.2 = x₂✝.2
⊢ x₁✝ = x₂✝
Tactic:
ext
State after:
case H.a
C : Type u_1
J : Type u_2
r : C → J → Prop
inst✝¹ : Fintype J
inst✝ : Fintype C
c : C
x₁✝ : C × JudgePair J
a✝² : x₁✝ ∈ ↑(Finset.filter (fun a => a.contestant = c) (A r))
x₂✝ : C × JudgePair J
a✝¹ : x₂✝ ∈ ↑(Finset.filter (fun a => a.contestant = c) (A r))
a✝ : x₁✝.2 = x₂✝.2
⊢ x₁✝.1 = x₂✝.1

case H.a.a
C : Type u_1
J : Type u_2
r : C → J → Prop
inst✝¹ : Fintype J
inst✝ : Fintype C
c : C
x₁✝ : C × JudgePair J
a✝² : x₁✝ ∈ ↑(Finset.filter (fun a => a.contestant = c) (A r))
x₂✝ : C × JudgePair J
a✝¹ : x₂✝ ∈ ↑(Finset.filter (fun a => a.contestant = c) (A r))
a✝ : x₁✝.2 = x₂✝.2
⊢ x₁✝.2.1 = x₂✝.2.1

case H.a.a
C : Type u_1
J : Type u_2
r : C → J → Prop
inst✝¹ : Fintype J
inst✝ : Fintype C
c : C
x₁✝ : C × JudgePair J
a✝² : x₁✝ ∈ ↑(Finset.filter (fun a => a.contestant = c) (A r))
x₂✝ : C × JudgePair J
a✝¹ : x₂✝ ∈ ↑(Finset.filter (fun a => a.contestant = c) (A r))
a✝ : x₁✝.2 = x₂✝.2
⊢ x₁✝.2.2 = x₂✝.2.2

State before:
case H.a
C : Type u_1
J : Type u_2
r : C → J → Prop
inst✝¹ : Fintype J
inst✝ : Fintype C
c : C
x₁✝ : C × JudgePair J
a✝² : x₁✝ ∈ ↑(Finset.filter (fun a => a.contestant = c) (A r))
x₂✝ : C × JudgePair J
a✝¹ : x₂✝ ∈ ↑(Finset.filter (fun a => a.contestant = c) (A r))
a✝ : x₁✝.2 = x₂✝.2
⊢ x₁✝.1 = x₂✝.1

case H.a.a
C : Type u_1
J : Type u_2
r : C → J → Prop
inst✝¹ : Fintype J
inst✝ : Fintype C
c : C
x₁✝ : C × JudgePair J
a✝² : x₁✝ ∈ ↑(Finset.filter (fun a => a.contestant = c) (A r))
x₂✝ : C × JudgePair J
a✝¹ : x₂✝ ∈ ↑(Finset.filter (fun a => a.contestant = c) (A r))
a✝ : x₁✝.2 = x₂✝.2
⊢ x₁✝.2.1 = x₂✝.2.1

case H.a.a
C : Type u_1
J : Type u_2
r : C → J → Prop
inst✝¹ : Fintype J
inst✝ : Fintype C
c : C
x₁✝ : C × JudgePair J
a✝² : x₁✝ ∈ ↑(Finset.filter (fun a => a.contestant = c) (A r))
x₂✝ : C × JudgePair J
a✝¹ : x₂✝ ∈ ↑(Finset.filter (fun a => a.contestant = c) (A r))
a✝ : x₁✝.2 = x₂✝.2
⊢ x₁✝.2.2 = x₂✝.2.2
Tactic:
all_goals aesop
State after:
no goals

State before:
case H.a.a
C : Type u_1
J : Type u_2
r : C → J → Prop
inst✝¹ : Fintype J
inst✝ : Fintype C
c : C
x₁✝ : C × JudgePair J
a✝² : x₁✝ ∈ ↑(Finset.filter (fun a => a.contestant = c) (A r))
x₂✝ : C × JudgePair J
a✝¹ : x₂✝ ∈ ↑(Finset.filter (fun a => a.contestant = c) (A r))
a✝ : x₁✝.2 = x₂✝.2
⊢ x₁✝.2.2 = x₂✝.2.2
Tactic:
aesop
State after:
no goals