Stefano M. Nicoletti

Lecture 5: Quantifier Rules

1. Aim of the lecture

We review the formalizations from Lecture 4 and introduce the natural-deduction rules for and . We first complete examples with functions and nested quantifiers. We then study how to construct and use universal and existential proofs, including the side conditions that make the four rules valid. Finally, we combine quantifiers with the propositional connectives.

Four recurring forms provide a useful review:

variable (Thing : Type)
variable (Student Reads Understands : Thing → Prop)

#check ∀ x : Thing, Student x → Reads x
#check ∃ x : Thing, Student x ∧ Reads x
#check ∀ x : Thing, Student x → Reads x → Understands x
#check ∃ x : Thing, Student x ∧ Reads x ∧ Understands x

2. Functions inside formulas

Terms built with functions can occur inside predicates, relations, and quantified statements.

variable (Thing : Type)
variable (hypatia : Thing)
variable (Student Reads Curious : Thing → Prop)
variable (motherOf : Thing → Thing)
variable (Knows : Thing → Thing → Prop)

#check Curious (motherOf hypatia)
#check ∀ x : Thing, Student x → Knows x (motherOf x)
#check ∃ x : Thing, Student x ∧ Reads (motherOf x)

The parentheses show that we first build motherOf x and then use that term as the argument of a predicate or relation.

3. Nested quantifiers

Quantifier order determines which choices may depend on others.

variable (Thing : Type)
variable (Person : Thing → Prop)
variable (Knows : Thing → Thing → Prop)

-- Every person knows someone.
#check ∀ x : Thing, Person x →
  ∃ y : Thing, Person y ∧ Knows x y

-- Someone knows every person.
#check ∃ x : Thing, Person x ∧
  ∀ y : Thing, Person y → Knows x y

-- Nobody knows every person.
#check ¬∃ x : Thing, Person x ∧
  ∀ y : Thing, Person y → Knows x y

In the first statement, the witness y may change when x changes. The second statement requires one fixed x who knows every relevant y.

4. Universal introduction, ∀I

Universal quantifier introduction, ∀I

To prove ∀ y : Thing, A y, introduce an arbitrary x. The goal becomes A x. Prove it without using any special property of x; the conclusion then holds for every object in the domain.

-- Universal introduction, ∀I. -- The universal goal is opened by introducing a new arbitrary thing `x`. -- Only the first `intro` applies ∀I; the next two introduce implications. theorem lecture05_forall_intro (Thing : Type) (Person Curious : Thing Prop) : y : Thing, Person y Curious y Curious y := Thing:TypePerson:Thing PropCurious:Thing Prop (y : Thing), Person y Curious y Curious y Thing:TypePerson:Thing PropCurious:Thing Propx:ThingPerson x Curious x Curious x Thing:TypePerson:Thing PropCurious:Thing Propx:ThinghXPerson:Person xCurious x Curious x Thing:TypePerson:Thing PropCurious:Thing Propx:ThinghXPerson:Person xhXCurious:Curious xCurious x All goals completed! 🐙

Only the first intro applies ∀I. The following two introduce the assumptions of the implications.

The arbitrariness condition

The object introduced by ∀I cannot be a particular object selected because of a special property. From hHypatiaCurious : Curious hypatia, for example, we cannot conclude ∀ y : Thing, Curious y. After intro x, the goal would be Curious x, whereas the assumption proves only Curious hypatia.

Formally, the variable used in the derivation must not occur free in any open assumption. In Curious x, x is free. In ∀ y : Thing, Curious y, y is bound. Lean enforces this condition through scope: intro x creates a fresh local variable inside the universal goal.

If a source proof deliberately reuses an existing name, Lean may display the older variable as x✝:

x✝ : Thing
hXCurious : Curious x✝
x : Thing
|- Curious x

The dagger only marks automatic renaming. Curious x✝ and Curious x remain different types.

5. Universal elimination, ∀E

Universal quantifier elimination, ∀E

Given ∀ x : Thing, A x, choose a term t and apply the universal proof to it. This yields A t.

-- A fact about Hypatia does not establish the same fact for every thing. -- After `intro x`, `hHypatiaCurious : Curious hypatia` cannot close the goal -- `Curious x`. If a source proof reuses the name `x`, Lean displays the older -- local variable as `x✝`; the two local objects remain distinct. -- Universal elimination, ∀E. -- Every student reads; Marta is a student; therefore Marta reads. theorem lecture05_forall_elim (Thing : Type) (Student Reads : Thing Prop) (marta : Thing) (hEveryStudentReads : x : Thing, Student x Reads x) (hMartaStudent : Student marta) : Reads marta := Thing:TypeStudent:Thing PropReads:Thing Propmarta:ThinghEveryStudentReads: (x : Thing), Student x Reads xhMartaStudent:Student martaReads marta Thing:TypeStudent:Thing PropReads:Thing Propmarta:ThinghEveryStudentReads: (x : Thing), Student x Reads xhMartaStudent:Student martahIfMartaStudentThenReads:Student marta Reads martaReads marta Thing:TypeStudent:Thing PropReads:Thing Propmarta:ThinghEveryStudentReads: (x : Thing), Student x Reads xhMartaStudent:Student martahIfMartaStudentThenReads:Student marta Reads martahMartaReads:Reads martaReads marta All goals completed! 🐙

Applying the universal assumption to marta produces Student marta → Reads marta, which can then be applied to hMartaStudent.

The chosen term need not be a simple name. It can be built by a function. If motherOf : Thing → Thing and hEverythingCurious : ∀ x : Thing, Curious x, then hEverythingCurious (motherOf hypatia) proves Curious (motherOf hypatia). Lean checks the term's type and handles bound variables without accidental capture.

6. Existential introduction, ∃I

Existential quantifier introduction, ∃I

To prove ∃ x : Thing, A x, choose a witness t and prove A t. Lean's constructor is Exists.intro.

-- Existential introduction, ∃I. -- Choose Marta as the witness and use the assumption that she reads. theorem lecture05_exists_intro (Thing : Type) (Reads : Thing Prop) (marta : Thing) (hMartaReads : Reads marta) : x : Thing, Reads x := Thing:TypeReads:Thing Propmarta:ThinghMartaReads:Reads marta x, Reads x Thing:TypeReads:Thing Propmarta:ThinghMartaReads:Reads martaReads marta All goals completed! 🐙

Choosing marta turns the existential goal into Reads marta, which is already available as an assumption.

The witness can also be a compound term. To prove ∃ x : Thing, Curious x, we may choose motherOf hypatia when we have a proof of Curious (motherOf hypatia).

7. Existential elimination, ∃E

Existential quantifier elimination, ∃E

Given ∃ x : Thing, A x, we know that a witness exists but may not assume its identity. To derive B, introduce an arbitrary witness y together with A y, and derive a conclusion that does not depend on the identity of y.

-- Existential elimination, ∃E. -- Someone filed a report; whenever someone files a report, an investigation -- starts; therefore an investigation starts. theorem lecture05_exists_elim (Thing : Type) (FiledReport : Thing Prop) (InvestigationStarts : Prop) (hSomeoneFiledReport : x : Thing, FiledReport x) (hReportStartsInvestigation : (x : Thing) FiledReport x InvestigationStarts) : InvestigationStarts := Thing:TypeFiledReport:Thing PropInvestigationStarts:ProphSomeoneFiledReport: x, FiledReport xhReportStartsInvestigation: (x : Thing), FiledReport x InvestigationStartsInvestigationStarts Thing:TypeFiledReport:Thing PropInvestigationStarts:ProphSomeoneFiledReport: x, FiledReport xhReportStartsInvestigation: (x : Thing), FiledReport x InvestigationStarts (a : Thing), FiledReport a InvestigationStarts Thing:TypeFiledReport:Thing PropInvestigationStarts:ProphSomeoneFiledReport: x, FiledReport xhReportStartsInvestigation: (x : Thing), FiledReport x InvestigationStartsy:ThingFiledReport y InvestigationStarts Thing:TypeFiledReport:Thing PropInvestigationStarts:ProphSomeoneFiledReport: x, FiledReport xhReportStartsInvestigation: (x : Thing), FiledReport x InvestigationStartsy:ThinghYFiledReport:FiledReport yInvestigationStarts Thing:TypeFiledReport:Thing PropInvestigationStarts:ProphSomeoneFiledReport: x, FiledReport xhReportStartsInvestigation: (x : Thing), FiledReport x InvestigationStartsy:ThinghYFiledReport:FiledReport yhIfYFiledThenInvestigationStarts:FiledReport y InvestigationStartsInvestigationStarts Thing:TypeFiledReport:Thing PropInvestigationStarts:ProphSomeoneFiledReport: x, FiledReport xhReportStartsInvestigation: (x : Thing), FiledReport x InvestigationStartsy:ThinghYFiledReport:FiledReport yhIfYFiledThenInvestigationStarts:FiledReport y InvestigationStartshInvestigationStarts:InvestigationStartsInvestigationStarts All goals completed! 🐙

The x in the second assumption is a bound placeholder. We instantiate it with the local witness y, obtaining FiledReport y → InvestigationStarts, and then apply that implication to hYFiledReport.

The conclusion is fixed before the existential is opened and contains no free occurrence of y. Lean enforces this independence through the scope of y and the type of Exists.elim: the witness cannot escape the local derivation unless it is packaged inside another existential statement.

8. Combining the rules

Quantifier rules can be combined in one proof.

-- A more complex example combining ∃E, ∀E, and ∃I. -- Someone has an umbrella; everyone with an umbrella stays dry; -- therefore someone stays dry. theorem lecture05_exists_elim_combined (Thing : Type) (HasUmbrella StaysDry : Thing Prop) (hSomeoneHasUmbrella : x : Thing, HasUmbrella x) (hUmbrellaStaysDry : x : Thing, HasUmbrella x StaysDry x) : x : Thing, StaysDry x := Thing:TypeHasUmbrella:Thing PropStaysDry:Thing ProphSomeoneHasUmbrella: x, HasUmbrella xhUmbrellaStaysDry: (x : Thing), HasUmbrella x StaysDry x x, StaysDry x Thing:TypeHasUmbrella:Thing PropStaysDry:Thing ProphSomeoneHasUmbrella: x, HasUmbrella xhUmbrellaStaysDry: (x : Thing), HasUmbrella x StaysDry x (a : Thing), HasUmbrella a x, StaysDry x Thing:TypeHasUmbrella:Thing PropStaysDry:Thing ProphSomeoneHasUmbrella: x, HasUmbrella xhUmbrellaStaysDry: (x : Thing), HasUmbrella x StaysDry xy:ThingHasUmbrella y x, StaysDry x Thing:TypeHasUmbrella:Thing PropStaysDry:Thing ProphSomeoneHasUmbrella: x, HasUmbrella xhUmbrellaStaysDry: (x : Thing), HasUmbrella x StaysDry xy:ThinghYHasUmbrella:HasUmbrella y x, StaysDry x Thing:TypeHasUmbrella:Thing PropStaysDry:Thing ProphSomeoneHasUmbrella: x, HasUmbrella xhUmbrellaStaysDry: (x : Thing), HasUmbrella x StaysDry xy:ThinghYHasUmbrella:HasUmbrella yStaysDry y Thing:TypeHasUmbrella:Thing PropStaysDry:Thing ProphSomeoneHasUmbrella: x, HasUmbrella xhUmbrellaStaysDry: (x : Thing), HasUmbrella x StaysDry xy:ThinghYHasUmbrella:HasUmbrella yhIfYHasUmbrellaThenStaysDry:HasUmbrella y StaysDry yStaysDry y Thing:TypeHasUmbrella:Thing PropStaysDry:Thing ProphSomeoneHasUmbrella: x, HasUmbrella xhUmbrellaStaysDry: (x : Thing), HasUmbrella x StaysDry xy:ThinghYHasUmbrella:HasUmbrella yhIfYHasUmbrellaThenStaysDry:HasUmbrella y StaysDry yhYStaysDry:StaysDry yStaysDry y All goals completed! 🐙

Here Exists.elim opens the first existential, applying hUmbrellaStaysDry to y uses ∀E, and Exists.intro y uses the same object as the witness of the new existential.

Universal quantification and conjunction

Every student who reads takes notes and understands. We introduce an arbitrary student, apply both universal assumptions, and construct the conjunction.

-- Combine ∀I, →I, ∀E, and ∧I. theorem lecture05_forall_conjunction_combined (Thing : Type) (Student Reads TakesNotes Understands : Thing Prop) (hReadersTakeNotes : x : Thing, Student x Reads x TakesNotes x) (hReadersUnderstand : x : Thing, Student x Reads x Understands x) : x : Thing, Student x Reads x TakesNotes x Understands x := Thing:TypeStudent:Thing PropReads:Thing PropTakesNotes:Thing PropUnderstands:Thing ProphReadersTakeNotes: (x : Thing), Student x Reads x TakesNotes xhReadersUnderstand: (x : Thing), Student x Reads x Understands x (x : Thing), Student x Reads x TakesNotes x Understands x Thing:TypeStudent:Thing PropReads:Thing PropTakesNotes:Thing PropUnderstands:Thing ProphReadersTakeNotes: (x : Thing), Student x Reads x TakesNotes xhReadersUnderstand: (x : Thing), Student x Reads x Understands xx:ThingStudent x Reads x TakesNotes x Understands x Thing:TypeStudent:Thing PropReads:Thing PropTakesNotes:Thing PropUnderstands:Thing ProphReadersTakeNotes: (x : Thing), Student x Reads x TakesNotes xhReadersUnderstand: (x : Thing), Student x Reads x Understands xx:ThinghXStudent:Student xReads x TakesNotes x Understands x Thing:TypeStudent:Thing PropReads:Thing PropTakesNotes:Thing PropUnderstands:Thing ProphReadersTakeNotes: (x : Thing), Student x Reads x TakesNotes xhReadersUnderstand: (x : Thing), Student x Reads x Understands xx:ThinghXStudent:Student xhXReads:Reads xTakesNotes x Understands x Thing:TypeStudent:Thing PropReads:Thing PropTakesNotes:Thing PropUnderstands:Thing ProphReadersTakeNotes: (x : Thing), Student x Reads x TakesNotes xhReadersUnderstand: (x : Thing), Student x Reads x Understands xx:ThinghXStudent:Student xhXReads:Reads xTakesNotes xThing:TypeStudent:Thing PropReads:Thing PropTakesNotes:Thing PropUnderstands:Thing ProphReadersTakeNotes: (x : Thing), Student x Reads x TakesNotes xhReadersUnderstand: (x : Thing), Student x Reads x Understands xx:ThinghXStudent:Student xhXReads:Reads xUnderstands x Thing:TypeStudent:Thing PropReads:Thing PropTakesNotes:Thing PropUnderstands:Thing ProphReadersTakeNotes: (x : Thing), Student x Reads x TakesNotes xhReadersUnderstand: (x : Thing), Student x Reads x Understands xx:ThinghXStudent:Student xhXReads:Reads xTakesNotes x Thing:TypeStudent:Thing PropReads:Thing PropTakesNotes:Thing PropUnderstands:Thing ProphReadersTakeNotes: (x : Thing), Student x Reads x TakesNotes xhReadersUnderstand: (x : Thing), Student x Reads x Understands xx:ThinghXStudent:Student xhXReads:Reads xhIfXStudentThenReadingImpliesNotes:Student x Reads x TakesNotes xTakesNotes x Thing:TypeStudent:Thing PropReads:Thing PropTakesNotes:Thing PropUnderstands:Thing ProphReadersTakeNotes: (x : Thing), Student x Reads x TakesNotes xhReadersUnderstand: (x : Thing), Student x Reads x Understands xx:ThinghXStudent:Student xhXReads:Reads xhIfXStudentThenReadingImpliesNotes:Student x Reads x TakesNotes xhIfXReadsThenTakesNotes:Reads x TakesNotes xTakesNotes x Thing:TypeStudent:Thing PropReads:Thing PropTakesNotes:Thing PropUnderstands:Thing ProphReadersTakeNotes: (x : Thing), Student x Reads x TakesNotes xhReadersUnderstand: (x : Thing), Student x Reads x Understands xx:ThinghXStudent:Student xhXReads:Reads xhIfXStudentThenReadingImpliesNotes:Student x Reads x TakesNotes xhIfXReadsThenTakesNotes:Reads x TakesNotes xhXTakesNotes:TakesNotes xTakesNotes x All goals completed! 🐙 Thing:TypeStudent:Thing PropReads:Thing PropTakesNotes:Thing PropUnderstands:Thing ProphReadersTakeNotes: (x : Thing), Student x Reads x TakesNotes xhReadersUnderstand: (x : Thing), Student x Reads x Understands xx:ThinghXStudent:Student xhXReads:Reads xUnderstands x Thing:TypeStudent:Thing PropReads:Thing PropTakesNotes:Thing PropUnderstands:Thing ProphReadersTakeNotes: (x : Thing), Student x Reads x TakesNotes xhReadersUnderstand: (x : Thing), Student x Reads x Understands xx:ThinghXStudent:Student xhXReads:Reads xhIfXStudentThenReadingImpliesUnderstanding:Student x Reads x Understands xUnderstands x Thing:TypeStudent:Thing PropReads:Thing PropTakesNotes:Thing PropUnderstands:Thing ProphReadersTakeNotes: (x : Thing), Student x Reads x TakesNotes xhReadersUnderstand: (x : Thing), Student x Reads x Understands xx:ThinghXStudent:Student xhXReads:Reads xhIfXStudentThenReadingImpliesUnderstanding:Student x Reads x Understands xhIfXReadsThenUnderstands:Reads x Understands xUnderstands x Thing:TypeStudent:Thing PropReads:Thing PropTakesNotes:Thing PropUnderstands:Thing ProphReadersTakeNotes: (x : Thing), Student x Reads x TakesNotes xhReadersUnderstand: (x : Thing), Student x Reads x Understands xx:ThinghXStudent:Student xhXReads:Reads xhIfXStudentThenReadingImpliesUnderstanding:Student x Reads x Understands xhIfXReadsThenUnderstands:Reads x Understands xhXUnderstands:Understands xUnderstands x All goals completed! 🐙

Existential quantification and disjunction

Someone visits Rome or Athens. We open the existential and consider both cases of the disjunction. Each case supplies a witness who sees a museum.

-- Combine ∃E, ∨E, ∀E, and ∃I. theorem lecture05_exists_or_combined (Thing : Type) (VisitsRome VisitsAthens SeesMuseum : Thing Prop) (hSomeoneVisitsACity : x : Thing, VisitsRome x VisitsAthens x) (hRomeVisitorsSeeMuseum : x : Thing, VisitsRome x SeesMuseum x) (hAthensVisitorsSeeMuseum : x : Thing, VisitsAthens x SeesMuseum x) : x : Thing, SeesMuseum x := Thing:TypeVisitsRome:Thing PropVisitsAthens:Thing PropSeesMuseum:Thing ProphSomeoneVisitsACity: x, VisitsRome x VisitsAthens xhRomeVisitorsSeeMuseum: (x : Thing), VisitsRome x SeesMuseum xhAthensVisitorsSeeMuseum: (x : Thing), VisitsAthens x SeesMuseum x x, SeesMuseum x Thing:TypeVisitsRome:Thing PropVisitsAthens:Thing PropSeesMuseum:Thing ProphSomeoneVisitsACity: x, VisitsRome x VisitsAthens xhRomeVisitorsSeeMuseum: (x : Thing), VisitsRome x SeesMuseum xhAthensVisitorsSeeMuseum: (x : Thing), VisitsAthens x SeesMuseum x (a : Thing), VisitsRome a VisitsAthens a x, SeesMuseum x Thing:TypeVisitsRome:Thing PropVisitsAthens:Thing PropSeesMuseum:Thing ProphSomeoneVisitsACity: x, VisitsRome x VisitsAthens xhRomeVisitorsSeeMuseum: (x : Thing), VisitsRome x SeesMuseum xhAthensVisitorsSeeMuseum: (x : Thing), VisitsAthens x SeesMuseum xy:ThingVisitsRome y VisitsAthens y x, SeesMuseum x Thing:TypeVisitsRome:Thing PropVisitsAthens:Thing PropSeesMuseum:Thing ProphSomeoneVisitsACity: x, VisitsRome x VisitsAthens xhRomeVisitorsSeeMuseum: (x : Thing), VisitsRome x SeesMuseum xhAthensVisitorsSeeMuseum: (x : Thing), VisitsAthens x SeesMuseum xy:ThinghYVisitsRomeOrAthens:VisitsRome y VisitsAthens y x, SeesMuseum x cases hYVisitsRomeOrAthens with Thing:TypeVisitsRome:Thing PropVisitsAthens:Thing PropSeesMuseum:Thing ProphSomeoneVisitsACity: x, VisitsRome x VisitsAthens xhRomeVisitorsSeeMuseum: (x : Thing), VisitsRome x SeesMuseum xhAthensVisitorsSeeMuseum: (x : Thing), VisitsAthens x SeesMuseum xy:ThinghYVisitsRome:VisitsRome y x, SeesMuseum x Thing:TypeVisitsRome:Thing PropVisitsAthens:Thing PropSeesMuseum:Thing ProphSomeoneVisitsACity: x, VisitsRome x VisitsAthens xhRomeVisitorsSeeMuseum: (x : Thing), VisitsRome x SeesMuseum xhAthensVisitorsSeeMuseum: (x : Thing), VisitsAthens x SeesMuseum xy:ThinghYVisitsRome:VisitsRome ySeesMuseum y Thing:TypeVisitsRome:Thing PropVisitsAthens:Thing PropSeesMuseum:Thing ProphSomeoneVisitsACity: x, VisitsRome x VisitsAthens xhRomeVisitorsSeeMuseum: (x : Thing), VisitsRome x SeesMuseum xhAthensVisitorsSeeMuseum: (x : Thing), VisitsAthens x SeesMuseum xy:ThinghYVisitsRome:VisitsRome yhIfYVisitsRomeThenSeesMuseum:VisitsRome y SeesMuseum ySeesMuseum y Thing:TypeVisitsRome:Thing PropVisitsAthens:Thing PropSeesMuseum:Thing ProphSomeoneVisitsACity: x, VisitsRome x VisitsAthens xhRomeVisitorsSeeMuseum: (x : Thing), VisitsRome x SeesMuseum xhAthensVisitorsSeeMuseum: (x : Thing), VisitsAthens x SeesMuseum xy:ThinghYVisitsRome:VisitsRome yhIfYVisitsRomeThenSeesMuseum:VisitsRome y SeesMuseum yhYSeesMuseum:SeesMuseum ySeesMuseum y All goals completed! 🐙 Thing:TypeVisitsRome:Thing PropVisitsAthens:Thing PropSeesMuseum:Thing ProphSomeoneVisitsACity: x, VisitsRome x VisitsAthens xhRomeVisitorsSeeMuseum: (x : Thing), VisitsRome x SeesMuseum xhAthensVisitorsSeeMuseum: (x : Thing), VisitsAthens x SeesMuseum xy:ThinghYVisitsAthens:VisitsAthens y x, SeesMuseum x Thing:TypeVisitsRome:Thing PropVisitsAthens:Thing PropSeesMuseum:Thing ProphSomeoneVisitsACity: x, VisitsRome x VisitsAthens xhRomeVisitorsSeeMuseum: (x : Thing), VisitsRome x SeesMuseum xhAthensVisitorsSeeMuseum: (x : Thing), VisitsAthens x SeesMuseum xy:ThinghYVisitsAthens:VisitsAthens ySeesMuseum y Thing:TypeVisitsRome:Thing PropVisitsAthens:Thing PropSeesMuseum:Thing ProphSomeoneVisitsACity: x, VisitsRome x VisitsAthens xhRomeVisitorsSeeMuseum: (x : Thing), VisitsRome x SeesMuseum xhAthensVisitorsSeeMuseum: (x : Thing), VisitsAthens x SeesMuseum xy:ThinghYVisitsAthens:VisitsAthens yhIfYVisitsAthensThenSeesMuseum:VisitsAthens y SeesMuseum ySeesMuseum y Thing:TypeVisitsRome:Thing PropVisitsAthens:Thing PropSeesMuseum:Thing ProphSomeoneVisitsACity: x, VisitsRome x VisitsAthens xhRomeVisitorsSeeMuseum: (x : Thing), VisitsRome x SeesMuseum xhAthensVisitorsSeeMuseum: (x : Thing), VisitsAthens x SeesMuseum xy:ThinghYVisitsAthens:VisitsAthens yhIfYVisitsAthensThenSeesMuseum:VisitsAthens y SeesMuseum yhYSeesMuseum:SeesMuseum ySeesMuseum y All goals completed! 🐙

Nested quantifiers

The existential witness may depend on the person introduced by the universal quantifier. We open the existential only after fixing that person.

-- Combine nested quantifiers, ∃E, ∃I, and ∧I. -- Every person knows at least one person. Therefore, for every person, there -- is someone whom they know and who is a person. theorem lecture05_nested_quantifiers_combined (Thing : Type) (Person : Thing Prop) (Knows : Thing Thing Prop) (hEveryPersonKnowsSomeone : x : Thing, Person x y : Thing, Person y Knows x y) : x : Thing, Person x y : Thing, Knows x y Person y := Thing:TypePerson:Thing PropKnows:Thing Thing ProphEveryPersonKnowsSomeone: (x : Thing), Person x y, Person y Knows x y (x : Thing), Person x y, Knows x y Person y Thing:TypePerson:Thing PropKnows:Thing Thing ProphEveryPersonKnowsSomeone: (x : Thing), Person x y, Person y Knows x yx:ThingPerson x y, Knows x y Person y Thing:TypePerson:Thing PropKnows:Thing Thing ProphEveryPersonKnowsSomeone: (x : Thing), Person x y, Person y Knows x yx:ThinghXPerson:Person x y, Knows x y Person y Thing:TypePerson:Thing PropKnows:Thing Thing ProphEveryPersonKnowsSomeone: (x : Thing), Person x y, Person y Knows x yx:ThinghXPerson:Person xhIfXPersonThenKnowsSomeone:Person x y, Person y Knows x y y, Knows x y Person y Thing:TypePerson:Thing PropKnows:Thing Thing ProphEveryPersonKnowsSomeone: (x : Thing), Person x y, Person y Knows x yx:ThinghXPerson:Person xhIfXPersonThenKnowsSomeone:Person x y, Person y Knows x yhXKnowsSomeone: y, Person y Knows x y y, Knows x y Person y Thing:TypePerson:Thing PropKnows:Thing Thing ProphEveryPersonKnowsSomeone: (x : Thing), Person x y, Person y Knows x yx:ThinghXPerson:Person xhIfXPersonThenKnowsSomeone:Person x y, Person y Knows x yhXKnowsSomeone: y, Person y Knows x y (a : Thing), Person a Knows x a y, Knows x y Person y Thing:TypePerson:Thing PropKnows:Thing Thing ProphEveryPersonKnowsSomeone: (x : Thing), Person x y, Person y Knows x yx:ThinghXPerson:Person xhIfXPersonThenKnowsSomeone:Person x y, Person y Knows x yhXKnowsSomeone: y, Person y Knows x yy:ThingPerson y Knows x y y, Knows x y Person y Thing:TypePerson:Thing PropKnows:Thing Thing ProphEveryPersonKnowsSomeone: (x : Thing), Person x y, Person y Knows x yx:ThinghXPerson:Person xhIfXPersonThenKnowsSomeone:Person x y, Person y Knows x yhXKnowsSomeone: y, Person y Knows x yy:ThinghYPersonAndXKnowsY:Person y Knows x y y, Knows x y Person y Thing:TypePerson:Thing PropKnows:Thing Thing ProphEveryPersonKnowsSomeone: (x : Thing), Person x y, Person y Knows x yx:ThinghXPerson:Person xhIfXPersonThenKnowsSomeone:Person x y, Person y Knows x yhXKnowsSomeone: y, Person y Knows x yy:ThinghYPersonAndXKnowsY:Person y Knows x yKnows x y Person y Thing:TypePerson:Thing PropKnows:Thing Thing ProphEveryPersonKnowsSomeone: (x : Thing), Person x y, Person y Knows x yx:ThinghXPerson:Person xhIfXPersonThenKnowsSomeone:Person x y, Person y Knows x yhXKnowsSomeone: y, Person y Knows x yy:ThinghYPersonAndXKnowsY:Person y Knows x yKnows x yThing:TypePerson:Thing PropKnows:Thing Thing ProphEveryPersonKnowsSomeone: (x : Thing), Person x y, Person y Knows x yx:ThinghXPerson:Person xhIfXPersonThenKnowsSomeone:Person x y, Person y Knows x yhXKnowsSomeone: y, Person y Knows x yy:ThinghYPersonAndXKnowsY:Person y Knows x yPerson y Thing:TypePerson:Thing PropKnows:Thing Thing ProphEveryPersonKnowsSomeone: (x : Thing), Person x y, Person y Knows x yx:ThinghXPerson:Person xhIfXPersonThenKnowsSomeone:Person x y, Person y Knows x yhXKnowsSomeone: y, Person y Knows x yy:ThinghYPersonAndXKnowsY:Person y Knows x yKnows x y All goals completed! 🐙 Thing:TypePerson:Thing PropKnows:Thing Thing ProphEveryPersonKnowsSomeone: (x : Thing), Person x y, Person y Knows x yx:ThinghXPerson:Person xhIfXPersonThenKnowsSomeone:Person x y, Person y Knows x yhXKnowsSomeone: y, Person y Knows x yy:ThinghYPersonAndXKnowsY:Person y Knows x yPerson y All goals completed! 🐙

Existential quantification and negation

A witness submitted but received no confirmation. The universal rule produces a confirmation for that witness, and the negation produces False.

-- Combine ∃E, ∧E, ∀E, and ¬E. theorem lecture05_exists_negation_combined (Thing : Type) (Submitted ReceivedConfirmation : Thing Prop) (hSubmissionGetsConfirmation : x : Thing, Submitted x ReceivedConfirmation x) (hCounterexample : x : Thing, Submitted x ¬ReceivedConfirmation x) : False := Thing:TypeSubmitted:Thing PropReceivedConfirmation:Thing ProphSubmissionGetsConfirmation: (x : Thing), Submitted x ReceivedConfirmation xhCounterexample: x, Submitted x ¬ReceivedConfirmation xFalse Thing:TypeSubmitted:Thing PropReceivedConfirmation:Thing ProphSubmissionGetsConfirmation: (x : Thing), Submitted x ReceivedConfirmation xhCounterexample: x, Submitted x ¬ReceivedConfirmation x (a : Thing), Submitted a ¬ReceivedConfirmation a False Thing:TypeSubmitted:Thing PropReceivedConfirmation:Thing ProphSubmissionGetsConfirmation: (x : Thing), Submitted x ReceivedConfirmation xhCounterexample: x, Submitted x ¬ReceivedConfirmation xy:ThingSubmitted y ¬ReceivedConfirmation y False Thing:TypeSubmitted:Thing PropReceivedConfirmation:Thing ProphSubmissionGetsConfirmation: (x : Thing), Submitted x ReceivedConfirmation xhCounterexample: x, Submitted x ¬ReceivedConfirmation xy:ThinghYSubmittedAndNoConfirmation:Submitted y ¬ReceivedConfirmation yFalse Thing:TypeSubmitted:Thing PropReceivedConfirmation:Thing ProphSubmissionGetsConfirmation: (x : Thing), Submitted x ReceivedConfirmation xhCounterexample: x, Submitted x ¬ReceivedConfirmation xy:ThinghYSubmittedAndNoConfirmation:Submitted y ¬ReceivedConfirmation yhYSubmitted:Submitted yFalse Thing:TypeSubmitted:Thing PropReceivedConfirmation:Thing ProphSubmissionGetsConfirmation: (x : Thing), Submitted x ReceivedConfirmation xhCounterexample: x, Submitted x ¬ReceivedConfirmation xy:ThinghYSubmittedAndNoConfirmation:Submitted y ¬ReceivedConfirmation yhYSubmitted:Submitted yhYNoConfirmation:¬ReceivedConfirmation yFalse Thing:TypeSubmitted:Thing PropReceivedConfirmation:Thing ProphSubmissionGetsConfirmation: (x : Thing), Submitted x ReceivedConfirmation xhCounterexample: x, Submitted x ¬ReceivedConfirmation xy:ThinghYSubmittedAndNoConfirmation:Submitted y ¬ReceivedConfirmation yhYSubmitted:Submitted yhYNoConfirmation:¬ReceivedConfirmation yhIfYSubmittedThenConfirmation:Submitted y ReceivedConfirmation yFalse Thing:TypeSubmitted:Thing PropReceivedConfirmation:Thing ProphSubmissionGetsConfirmation: (x : Thing), Submitted x ReceivedConfirmation xhCounterexample: x, Submitted x ¬ReceivedConfirmation xy:ThinghYSubmittedAndNoConfirmation:Submitted y ¬ReceivedConfirmation yhYSubmitted:Submitted yhYNoConfirmation:¬ReceivedConfirmation yhIfYSubmittedThenConfirmation:Submitted y ReceivedConfirmation yhYReceivedConfirmation:ReceivedConfirmation yFalse Thing:TypeSubmitted:Thing PropReceivedConfirmation:Thing ProphSubmissionGetsConfirmation: (x : Thing), Submitted x ReceivedConfirmation xhCounterexample: x, Submitted x ¬ReceivedConfirmation xy:ThinghYSubmittedAndNoConfirmation:Submitted y ¬ReceivedConfirmation yhYSubmitted:Submitted yhYNoConfirmation:¬ReceivedConfirmation yhIfYSubmittedThenConfirmation:Submitted y ReceivedConfirmation yhYReceivedConfirmation:ReceivedConfirmation yhContradiction:FalseFalse All goals completed! 🐙

Existential quantification and biconditional

We open the existential, instantiate the biconditional at its witness, and use Iff.mp to extract the required direction. The same object witnesses the goal.

-- Combine ∃E, ∀E, ↔E, and ∃I. -- Being a square is equivalent to having four equal sides. A square exists; -- therefore, something has four equal sides. theorem lecture05_exists_iff_combined (Thing : Type) (Square HasFourEqualSides : Thing Prop) (hEquivalence : x : Thing, Square x HasFourEqualSides x) (hSquareExists : x : Thing, Square x) : x : Thing, HasFourEqualSides x := Thing:TypeSquare:Thing PropHasFourEqualSides:Thing ProphEquivalence: (x : Thing), Square x HasFourEqualSides xhSquareExists: x, Square x x, HasFourEqualSides x Thing:TypeSquare:Thing PropHasFourEqualSides:Thing ProphEquivalence: (x : Thing), Square x HasFourEqualSides xhSquareExists: x, Square x (a : Thing), Square a x, HasFourEqualSides x Thing:TypeSquare:Thing PropHasFourEqualSides:Thing ProphEquivalence: (x : Thing), Square x HasFourEqualSides xhSquareExists: x, Square xy:ThingSquare y x, HasFourEqualSides x Thing:TypeSquare:Thing PropHasFourEqualSides:Thing ProphEquivalence: (x : Thing), Square x HasFourEqualSides xhSquareExists: x, Square xy:ThinghYSquare:Square y x, HasFourEqualSides x Thing:TypeSquare:Thing PropHasFourEqualSides:Thing ProphEquivalence: (x : Thing), Square x HasFourEqualSides xhSquareExists: x, Square xy:ThinghYSquare:Square yHasFourEqualSides y Thing:TypeSquare:Thing PropHasFourEqualSides:Thing ProphEquivalence: (x : Thing), Square x HasFourEqualSides xhSquareExists: x, Square xy:ThinghYSquare:Square yhEquivalenceForY:Square y HasFourEqualSides yHasFourEqualSides y Thing:TypeSquare:Thing PropHasFourEqualSides:Thing ProphEquivalence: (x : Thing), Square x HasFourEqualSides xhSquareExists: x, Square xy:ThinghYSquare:Square yhEquivalenceForY:Square y HasFourEqualSides yhForwardDirection:Square y HasFourEqualSides yHasFourEqualSides y Thing:TypeSquare:Thing PropHasFourEqualSides:Thing ProphEquivalence: (x : Thing), Square x HasFourEqualSides xhSquareExists: x, Square xy:ThinghYSquare:Square yhEquivalenceForY:Square y HasFourEqualSides yhForwardDirection:Square y HasFourEqualSides yhYHasFourEqualSides:HasFourEqualSides yHasFourEqualSides y All goals completed! 🐙

In each example, we first handle the outer constructor of the goal, make local witnesses explicit, and then apply the propositional rules.

9. Working strategy

When reading a quantified formula, ask:

This strategy extends the one used for propositional connectives. Inspect the main constructor of the goal for an introduction rule and compound assumptions for useful elimination rules.

10. Sources and further reading