Skip to content

Commit

Permalink
refactor(data/fintype/basic): golf card_eq_one_of_forall_eq (#6131)
Browse files Browse the repository at this point in the history
Co-authors: `lean-gptf`, Stanislas Polu

This was found by `formal-lean-wm-to-tt-m1-m2-v4-c4` when we evaluated it on theorems added to `mathlib` after we last extracted training data.
  • Loading branch information
Jesse Michael Han committed Feb 9, 2021
1 parent fdbd4bf commit bf1465c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/data/fintype/basic.lean
Expand Up @@ -698,7 +698,7 @@ lemma exists_pair_of_one_lt_card (h : 1 < card α) : ∃ (a b : α), a ≠ b :=
by { haveI : nontrivial α := one_lt_card_iff_nontrivial.1 h, exact exists_pair_ne α }

lemma card_eq_one_of_forall_eq {i : α} (h : ∀ j, j = i) : card α = 1 :=
le_antisymm (card_le_one_iff.2 (λ a b, eq.trans (h a) (h b).symm)) (card_pos.2 ⟨i, mem_univ _⟩)
fintype.card_eq_one_iff.2 ⟨i,h⟩

lemma injective_iff_surjective {f : α → α} : injective f ↔ surjective f :=
by haveI := classical.prop_decidable; exact
Expand Down

0 comments on commit bf1465c

Please sign in to comment.