Lemma t1 : forall A B:Prop, A -> (A->B) ->B.
Proof.
  refine (fun (A B:Prop) (HA:A) (HAB:A->B) => _).
  refine (HAB HA).
Qed.

Lemma t2: forall A B:Prop, A \/ B -> B\/A.
Proof.
  refine (fun (A B:Prop) (HAB:A\/B) => _).

  Check or_ind.
  refine (@or_ind A B (B\/A) (fun (HA:A) => _) (fun (HB:B) =>  _) HAB).
  refine (@or_intror B A HA).
  refine (@or_introl B A HB).
Qed.

Print t2.

Definition t2' := fun (A B : Prop) (HAB : A \/ B) =>
                    or_ind (fun HA : A => or_intror HA) (fun HB : B => or_introl HB) HAB.

Print t2'.
